Public Access
Refactor Steam adapter packages and update docs
Move steam_adapter sources from domain.* to modules.* and rename controller package to api. Update package declarations and imports across SteamTestController, SteamPlayerSummaryResponse, SteamClientConfig, and SteamApiService. Update README to re-label Controller -> API layer and Domain -> Business layer and adjust wording about layer boundaries. Also normalize file endings/newlines in several Java files. No functional logic changes were made.
This commit is contained in:
1 parent
a1b11882de
commit
1dc2efba01
10 files changed
+16
-11
No files matched your search
@@ -19,20 +19,20 @@ The project strictly follows a Domain-Driven / Clean Architecture (Ports & Adapt
|
|||||||
|
|
||||||
### Layer Breakdown
|
### Layer Breakdown
|
||||||
|
|
||||||
1. **Controller / Web Layer (`controller`)**
|
1. **API / Web Layer (`api`)**
|
||||||
* Contains REST endpoints, DTOs (`Request`/`Response` records), and Global Exception Handlers.
|
* Contains REST endpoints, DTOs (`Request`/`Response` records), and Global Exception Handlers.
|
||||||
* Uses `ApiMapper` to map between DTOs and Domain Models.
|
* Uses `ApiMapper` to map between DTOs and Domain Models.
|
||||||
* **Rule:** This layer delegates to the Service layer and never accesses persistence directly.
|
* **Rule:** This layer delegates to the Service layer and never accesses persistence directly.
|
||||||
|
|
||||||
2. **Domain / Core Layer (`model`, `service`, `exception`)**
|
2. **Business / Core Layer (`model`, `service`, `exception`)**
|
||||||
* The heart of the application. Contains pure Java classes (Models) and Business Logic (Services).
|
* The heart of the application. Contains pure Java classes (Models) and Business Logic (Services).
|
||||||
* Throws specific business exceptions (e.g., `InvalidCredentialsException`).
|
* Throws specific business exceptions (e.g., `InvalidCredentialsException`).
|
||||||
* **Rule:** This layer has **no dependencies** on the Controller or Persistence layer. It defines interfaces that the persistence layer must implement.
|
* **Rule:** This layer has **no dependencies** on the API or Persistence layer. It defines interfaces that the persistence layer must implement.
|
||||||
|
|
||||||
3. **Persistence Layer (`persistence`)**
|
3. **Persistence Layer (`persistence`)**
|
||||||
* Handles database operations. Contains JPA Entities (`UserEntity`), Spring Data Repositories, and the `EntityMapper`.
|
* Handles database operations. Contains JPA Entities (`UserEntity`), Spring Data Repositories, and the `EntityMapper`.
|
||||||
* Implements the interfaces defined in the Domain layer.
|
* Implements the interfaces defined in the Domain layer.
|
||||||
* **Rule:** Entities never leak into the Controller layer.
|
* **Rule:** Entities never leak into the API layer.
|
||||||
|
|
||||||
*Note: Future implementations will include ArchUnit tests to automatically enforce these architectural boundaries during the CI pipeline.*
|
*Note: Future implementations will include ArchUnit tests to automatically enforce these architectural boundaries during the CI pipeline.*
|
||||||
|
|
||||||
|
|||||||
@@ -10,3 +10,4 @@ public class CoreServiceApplication {
|
|||||||
SpringApplication.run(CoreServiceApplication.class, args);
|
SpringApplication.run(CoreServiceApplication.class, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,3 +66,4 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
|
|||||||
filterChain.doFilter(request, response);
|
filterChain.doFilter(request, response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -13,3 +13,4 @@ public class JwtConfig {
|
|||||||
|
|
||||||
private String secret;
|
private String secret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,3 +53,4 @@ public class JwtService {
|
|||||||
return Keys.hmacShaKeyFor(keyBytes);
|
return Keys.hmacShaKeyFor(keyBytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package core_service.domain.steam_adapter.controller;
|
package core_service.modules.steam_adapter.api;
|
||||||
|
|
||||||
import core_service.domain.steam_adapter.controller.dto.response.SteamPlayerSummaryResponse;
|
import core_service.modules.steam_adapter.api.dto.response.SteamPlayerSummaryResponse;
|
||||||
import core_service.domain.steam_adapter.service.SteamApiService;
|
import core_service.modules.steam_adapter.service.SteamApiService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package core_service.domain.steam_adapter.controller.dto.response;
|
package core_service.modules.steam_adapter.api.dto.response;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package core_service.domain.steam_adapter.config;
|
package core_service.modules.steam_adapter.config;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package core_service.domain.steam_adapter.service;
|
package core_service.modules.steam_adapter.service;
|
||||||
|
|
||||||
import core_service.domain.steam_adapter.controller.dto.response.SteamPlayerSummaryResponse;
|
import core_service.modules.steam_adapter.api.dto.response.SteamPlayerSummaryResponse;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@@ -16,3 +16,4 @@ public record UserPrincipal(
|
|||||||
return Long.parseLong(id);
|
return Long.parseLong(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in new issue
Block a user