-
Notifications
You must be signed in to change notification settings - Fork 0
feature/14-layered-to-hexagonal-admin #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
83b5a03
feat ( #14 ) : model 추가
qkrwndnjs1075 adb1b3e
feat ( #14 ) : application in/port 추가
qkrwndnjs1075 bdc4a8c
feat ( #14 ) : application out/port 추가
qkrwndnjs1075 c1f7353
feat ( #14 ) : application service 추가
qkrwndnjs1075 6609538
feat ( #14 ) : in/web controller 추가
qkrwndnjs1075 de7d106
feat ( #14 ) : in/web dto 추가
qkrwndnjs1075 f79374e
feat ( #14 ) : adapter/out mapper 추가
qkrwndnjs1075 69418c1
feat ( #14 ) : adapter/out persistence 추가
qkrwndnjs1075 883adaa
feat ( #14 ) : adapter/out jpaEntity 추가
qkrwndnjs1075 93f031c
refactor ( #14 ) : mapstruct가 자동 구현할 수 있도록 componentModel = "spring" 추가
qkrwndnjs1075 c3a2895
feat ( #14 ) : 누락된 kdoc 추가
qkrwndnjs1075 ed48eee
chore ( #14 ) : AdminWebAdapter로 이름 변경
qkrwndnjs1075 3185bc6
refactor ( #14 ) : 누락된 kdoc 추가
qkrwndnjs1075 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
...r-user/src/main/kotlin/hs/kr/entrydsm/user/domain/admin/adapter/in/web/AdminController.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.adapter.`in`.web | ||
|
|
||
| import hs.kr.entrydsm.user.domain.admin.adapter.`in`.web.dto.request.AdminLoginRequest | ||
| import hs.kr.entrydsm.user.domain.admin.application.port.`in`.AdminLoginUseCase | ||
| import hs.kr.entrydsm.user.domain.admin.application.port.`in`.AdminTokenRefreshUseCase | ||
| import hs.kr.entrydsm.user.domain.admin.application.port.`in`.DeleteAllTableUseCase | ||
| import hs.kr.entrydsm.user.domain.admin.application.port.`in`.QueryAdminByUUIDUseCase | ||
| import hs.kr.entrydsm.user.global.document.admin.AdminApiDocument | ||
| import hs.kr.entrydsm.user.global.utils.token.dto.TokenResponse | ||
| import jakarta.validation.Valid | ||
| import org.springframework.web.bind.annotation.DeleteMapping | ||
| import org.springframework.web.bind.annotation.GetMapping | ||
| import org.springframework.web.bind.annotation.PathVariable | ||
| import org.springframework.web.bind.annotation.PostMapping | ||
| import org.springframework.web.bind.annotation.PutMapping | ||
| import org.springframework.web.bind.annotation.RequestBody | ||
| import org.springframework.web.bind.annotation.RequestHeader | ||
| import org.springframework.web.bind.annotation.RequestMapping | ||
| import org.springframework.web.bind.annotation.RestController | ||
| import java.util.UUID | ||
|
|
||
| /** | ||
| * 관리자 관련 HTTP 요청을 처리하는 REST 컨트롤러 클래스입니다. | ||
| */ | ||
| @RestController | ||
| @RequestMapping("/admin") | ||
| class AdminController( | ||
| private val adminLoginUseCase: AdminLoginUseCase, | ||
| private val adminTokenRefreshUseCase: AdminTokenRefreshUseCase, | ||
| private val deleteAllTableUseCase: DeleteAllTableUseCase, | ||
| private val queryAdminByUUIDUseCase: QueryAdminByUUIDUseCase, | ||
| ) : AdminApiDocument { | ||
| /** | ||
| * 관리자 로그인을 처리합니다. | ||
| */ | ||
| @PostMapping("/auth") | ||
| override fun login( | ||
| @RequestBody @Valid | ||
| adminLoginRequest: AdminLoginRequest, | ||
| ): TokenResponse = adminLoginUseCase.login(adminLoginRequest) | ||
|
|
||
| /** | ||
| * 관리자 토큰을 갱신합니다. | ||
| */ | ||
| @PutMapping("/auth") | ||
| override fun tokenRefresh( | ||
| @RequestHeader("X-Refresh-Token") refreshToken: String, | ||
| ): TokenResponse = adminTokenRefreshUseCase.refresh(refreshToken) | ||
|
|
||
| /** | ||
| * 모든 테이블을 삭제합니다. | ||
| */ | ||
| @DeleteMapping("/auth") | ||
| override fun deleteAllTable() = deleteAllTableUseCase.deleteAllTables() | ||
|
|
||
| /** | ||
| * UUID로 관리자 정보를 조회합니다. | ||
| */ | ||
| @GetMapping("/{adminId}") | ||
| override fun findAdminById( | ||
| @PathVariable adminId: UUID, | ||
| ) = queryAdminByUUIDUseCase.queryByUUID(adminId) | ||
| } | ||
10 changes: 10 additions & 0 deletions
10
...lin/hs/kr/entrydsm/user/domain/admin/adapter/in/web/dto/response/InternalAdminResponse.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.adapter.`in`.web.dto.response | ||
|
|
||
| import java.util.UUID | ||
|
|
||
| /** | ||
| * 내부 시스템 간 관리자 정보 응답 데이터를 담는 DTO 클래스입니다. | ||
| */ | ||
| data class InternalAdminResponse( | ||
| val id: UUID, | ||
| ) |
22 changes: 22 additions & 0 deletions
22
casper-user/src/main/kotlin/hs/kr/entrydsm/user/domain/admin/adapter/out/AdminJpaEntity.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.adapter.out | ||
|
|
||
| import hs.kr.entrydsm.user.global.base.BaseUUIDEntity | ||
| import jakarta.persistence.Column | ||
| import jakarta.persistence.Entity | ||
| import java.util.UUID | ||
|
|
||
| /** | ||
| * 관리자 정보를 데이터베이스에 저장하기 위한 JPA 엔티티 클래스입니다. | ||
| * 데이터베이스의 tbl_admin 테이블과 매핑됩니다. | ||
| * | ||
| * @property adminId 관리자 로그인 ID | ||
| * @property password 해시화된 비밀번호 | ||
| */ | ||
| @Entity(name = "tbl_admin") | ||
| class AdminJpaEntity( | ||
| id: UUID?, | ||
| @Column(name = "admin_id", length = 15, nullable = false) | ||
| val adminId: String, | ||
| @Column(name = "password", length = 60, nullable = false) | ||
| val password: String, | ||
| ) : BaseUUIDEntity(id) |
16 changes: 16 additions & 0 deletions
16
...r-user/src/main/kotlin/hs/kr/entrydsm/user/domain/admin/adapter/out/mapper/AdminMapper.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.adapter.out.mapper | ||
|
|
||
| import hs.kr.entrydsm.user.domain.admin.adapter.out.AdminJpaEntity | ||
| import hs.kr.entrydsm.user.domain.admin.model.Admin | ||
| import hs.kr.entrydsm.user.global.mapper.GenericMapper | ||
| import org.mapstruct.Mapper | ||
|
|
||
| /** | ||
| * Admin 도메인 모델과 AdminJpaEntity 간의 변환을 담당하는 매퍼 클래스입니다. | ||
| */ | ||
| @Mapper | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MapStruct가 자동 구현할 수 있도록 @Mapper(componentModel = "spring")를 추가하는건 어떤가요 @qkrwndnjs1075
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 흠 그렇게 수정하고 다른 도메인 쪽들도 그렇게 수정하도록 하겠습니다. |
||
| abstract class AdminMapper : GenericMapper<AdminJpaEntity, Admin> { | ||
| abstract override fun toEntity(model: Admin): AdminJpaEntity | ||
|
|
||
| abstract override fun toModel(entity: AdminJpaEntity?): Admin? | ||
| } | ||
30 changes: 30 additions & 0 deletions
30
...otlin/hs/kr/entrydsm/user/domain/admin/adapter/out/persistence/AdminPersistenceAdapter.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.adapter.out.persistence | ||
|
|
||
| import hs.kr.entrydsm.user.domain.admin.adapter.out.mapper.AdminMapper | ||
| import hs.kr.entrydsm.user.domain.admin.adapter.out.persistence.repository.AdminRepository | ||
| import hs.kr.entrydsm.user.domain.admin.application.port.out.AdminPort | ||
| import hs.kr.entrydsm.user.domain.admin.model.Admin | ||
| import org.springframework.data.repository.findByIdOrNull | ||
| import org.springframework.stereotype.Component | ||
| import java.util.UUID | ||
|
|
||
| /** | ||
| * 관리자 데이터의 영속성 처리를 담당하는 어댑터 클래스입니다. | ||
| */ | ||
| @Component | ||
| class AdminPersistenceAdapter( | ||
| private val adminRepository: AdminRepository, | ||
| private val adminMapper: AdminMapper, | ||
| ) : AdminPort { | ||
| override fun findById(id: UUID): Admin? { | ||
| return adminRepository.findByIdOrNull(id)?.let { adminMapper.toModel(it) } | ||
| } | ||
|
|
||
| override fun findByAdminId(adminId: String): Admin? { | ||
| return adminRepository.findByAdminId(adminId)?.let { adminMapper.toModel(it) } | ||
| } | ||
|
|
||
| override fun save(admin: Admin) { | ||
| adminRepository.save(adminMapper.toEntity(admin)) | ||
| } | ||
|
coehgns marked this conversation as resolved.
|
||
| } | ||
15 changes: 15 additions & 0 deletions
15
...in/hs/kr/entrydsm/user/domain/admin/adapter/out/persistence/repository/AdminRepository.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.adapter.out.persistence.repository | ||
|
|
||
| import hs.kr.entrydsm.user.domain.admin.adapter.out.AdminJpaEntity | ||
| import org.springframework.data.jpa.repository.JpaRepository | ||
| import java.util.UUID | ||
|
|
||
| /** | ||
| * 관리자 JPA 엔티티에 대한 데이터 액세스를 담당하는 리포지토리 인터페이스입니다. | ||
| */ | ||
| interface AdminRepository : JpaRepository<AdminJpaEntity, UUID> { | ||
| /** | ||
| * 관리자 ID로 관리자를 조회합니다. | ||
| */ | ||
| fun findByAdminId(adminId: String): AdminJpaEntity? | ||
| } |
18 changes: 18 additions & 0 deletions
18
...rc/main/kotlin/hs/kr/entrydsm/user/domain/admin/application/port/in/AdminFacadeUseCase.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.application.port.`in` | ||
|
|
||
| import hs.kr.entrydsm.user.domain.admin.model.Admin | ||
|
|
||
| /** | ||
| * 관리자 Facade 기능을 정의하는 UseCase 인터페이스입니다. | ||
| */ | ||
| interface AdminFacadeUseCase { | ||
| /** | ||
| * 현재 인증된 관리자의 사용자 정보를 조회합니다. | ||
| */ | ||
| fun getCurrentUser(): Admin | ||
|
|
||
| /** | ||
| * 관리자 ID로 사용자 정보를 조회합니다. | ||
| */ | ||
| fun getUserById(adminId: String): Admin | ||
| } |
18 changes: 18 additions & 0 deletions
18
...src/main/kotlin/hs/kr/entrydsm/user/domain/admin/application/port/in/AdminLoginUseCase.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.application.port.`in` | ||
|
|
||
| import hs.kr.entrydsm.user.domain.admin.adapter.`in`.web.dto.request.AdminLoginRequest | ||
| import hs.kr.entrydsm.user.global.utils.token.dto.TokenResponse | ||
|
|
||
| /** | ||
| * 관리자 로그인 유스케이스 인터페이스입니다. | ||
| * 관리자 인증 및 토큰 발급 처리를 정의합니다. | ||
| */ | ||
| interface AdminLoginUseCase { | ||
| /** | ||
| * 관리자 로그인을 처리합니다. | ||
| * | ||
| * @param request 관리자 로그인 요청 정보 | ||
| * @return 생성된 인증 토큰 응답 | ||
| */ | ||
| fun login(request: AdminLoginRequest): TokenResponse | ||
| } |
13 changes: 13 additions & 0 deletions
13
...n/kotlin/hs/kr/entrydsm/user/domain/admin/application/port/in/AdminTokenRefreshUseCase.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.application.port.`in` | ||
|
|
||
| import hs.kr.entrydsm.user.global.utils.token.dto.TokenResponse | ||
|
|
||
| /** | ||
| * 관리자 토큰 갱신 기능을 정의하는 UseCase 인터페이스입니다. | ||
| */ | ||
| interface AdminTokenRefreshUseCase { | ||
| /** | ||
| * 관리자 토큰을 갱신합니다. | ||
| */ | ||
| fun refresh(token: String): TokenResponse | ||
| } |
11 changes: 11 additions & 0 deletions
11
...main/kotlin/hs/kr/entrydsm/user/domain/admin/application/port/in/DeleteAllTableUseCase.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.application.port.`in` | ||
|
|
||
| /** | ||
| * 모든 테이블 삭제 기능을 정의하는 UseCase 인터페이스입니다. | ||
| */ | ||
| interface DeleteAllTableUseCase { | ||
| /** | ||
| * 모든 테이블을 삭제합니다. | ||
| */ | ||
| fun deleteAllTables() | ||
| } |
14 changes: 14 additions & 0 deletions
14
...in/kotlin/hs/kr/entrydsm/user/domain/admin/application/port/in/QueryAdminByUUIDUseCase.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.application.port.`in` | ||
|
|
||
| import hs.kr.entrydsm.user.domain.admin.adapter.`in`.web.dto.response.InternalAdminResponse | ||
| import java.util.UUID | ||
|
|
||
| /** | ||
| * UUID로 관리자 조회 기능을 정의하는 UseCase 인터페이스입니다. | ||
| */ | ||
| interface QueryAdminByUUIDUseCase { | ||
| /** | ||
| * UUID로 관리자 정보를 조회합니다. | ||
| */ | ||
| fun queryByUUID(adminId: UUID): InternalAdminResponse | ||
| } |
7 changes: 7 additions & 0 deletions
7
...r-user/src/main/kotlin/hs/kr/entrydsm/user/domain/admin/application/port/out/AdminPort.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.application.port.out | ||
|
|
||
| /** | ||
| * 관리자 관련 모든 포트 인터페이스를 통합한 포트입니다. | ||
| * 관리자 데이터의 CRUD 작업을 위한 모든 인터페이스를 상속받습니다. | ||
| */ | ||
| interface AdminPort : SaveAdminPort, QueryAdminPort |
26 changes: 26 additions & 0 deletions
26
...r/src/main/kotlin/hs/kr/entrydsm/user/domain/admin/application/port/out/QueryAdminPort.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.application.port.out | ||
|
|
||
| import hs.kr.entrydsm.user.domain.admin.model.Admin | ||
| import java.util.UUID | ||
|
|
||
| /** | ||
| * 관리자 조회 작업을 위한 포트 인터페이스입니다. | ||
| * 헥사고날 아키텍처에서 도메인 계층이 인프라스트럭처 계층과 통신하기 위한 인터페이스입니다. | ||
| */ | ||
| interface QueryAdminPort { | ||
| /** | ||
| * 관리자 ID로 관리자를 조회합니다. | ||
| * | ||
| * @param adminId 조회할 관리자 ID | ||
| * @return 조회된 관리자 도메인 모델 (없으면 null) | ||
| */ | ||
| fun findByAdminId(adminId: String): Admin? | ||
|
|
||
| /** | ||
| * UUID로 관리자를 조회합니다. | ||
| * | ||
| * @param id 조회할 관리자 UUID | ||
| * @return 조회된 관리자 도메인 모델 (없으면 null) | ||
| */ | ||
| fun findById(id: UUID): Admin? | ||
| } |
16 changes: 16 additions & 0 deletions
16
...er/src/main/kotlin/hs/kr/entrydsm/user/domain/admin/application/port/out/SaveAdminPort.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.application.port.out | ||
|
|
||
| import hs.kr.entrydsm.user.domain.admin.model.Admin | ||
|
|
||
| /** | ||
| * 관리자 저장 작업을 위한 포트 인터페이스입니다. | ||
| * 헥사고날 아키텍처에서 도메인 계층이 인프라스트럭처 계층과 통신하기 위한 인터페이스입니다. | ||
| */ | ||
| interface SaveAdminPort { | ||
| /** | ||
| * 관리자 정보를 저장합니다. | ||
| * | ||
| * @param admin 저장할 관리자 도메인 모델 | ||
| */ | ||
| fun save(admin: Admin) | ||
| } |
21 changes: 21 additions & 0 deletions
21
...n/kotlin/hs/kr/entrydsm/user/domain/admin/application/service/AdminTokenRefreshService.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.application.service | ||
|
|
||
| import hs.kr.entrydsm.user.domain.admin.application.port.`in`.AdminTokenRefreshUseCase | ||
| import hs.kr.entrydsm.user.global.security.jwt.JwtTokenProvider | ||
| import hs.kr.entrydsm.user.global.utils.token.dto.TokenResponse | ||
| import org.springframework.stereotype.Service | ||
| import org.springframework.transaction.annotation.Transactional | ||
|
|
||
| /** | ||
| * 관리자 토큰 갱신 비즈니스 로직을 처리하는 서비스 클래스입니다. | ||
| */ | ||
| @Service | ||
| class AdminTokenRefreshService( | ||
| private val jwtTokenProvider: JwtTokenProvider, | ||
| ) : AdminTokenRefreshUseCase { | ||
| /** | ||
| * 관리자의 리프레시 토큰을 이용하여 새로운 액세스 토큰을 발급합니다. | ||
| */ | ||
| @Transactional | ||
| override fun refresh(refreshToken: String): TokenResponse = jwtTokenProvider.reIssue(refreshToken) | ||
| } |
18 changes: 18 additions & 0 deletions
18
...main/kotlin/hs/kr/entrydsm/user/domain/admin/application/service/DeleteAllTableService.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.application.service | ||
|
|
||
| import hs.kr.entrydsm.user.domain.admin.application.port.`in`.DeleteAllTableUseCase | ||
| import hs.kr.entrydsm.user.infrastructure.kafka.producer.DeleteAllTableProducer | ||
| import org.springframework.stereotype.Service | ||
|
|
||
| /** | ||
| * 모든 테이블 삭제 비즈니스 로직을 처리하는 서비스 클래스입니다. | ||
| */ | ||
| @Service | ||
| class DeleteAllTableService( | ||
| private val deleteAllTableProducer: DeleteAllTableProducer, | ||
| ) : DeleteAllTableUseCase { | ||
| /** | ||
| * 모든 테이블을 삭제합니다. | ||
| */ | ||
| override fun deleteAllTables() = deleteAllTableProducer.send() | ||
| } |
28 changes: 28 additions & 0 deletions
28
...in/kotlin/hs/kr/entrydsm/user/domain/admin/application/service/QueryAdminByUUIDService.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.application.service | ||
|
|
||
| import hs.kr.entrydsm.user.domain.admin.adapter.`in`.web.dto.response.InternalAdminResponse | ||
| import hs.kr.entrydsm.user.domain.admin.application.port.`in`.QueryAdminByUUIDUseCase | ||
| import hs.kr.entrydsm.user.domain.admin.application.port.out.QueryAdminPort | ||
| import hs.kr.entrydsm.user.domain.admin.exception.AdminNotFoundException | ||
| import org.springframework.stereotype.Service | ||
| import org.springframework.transaction.annotation.Transactional | ||
| import java.util.UUID | ||
|
|
||
| /** | ||
| * UUID로 관리자 조회 비즈니스 로직을 처리하는 서비스 클래스입니다. | ||
| */ | ||
| @Service | ||
| class QueryAdminByUUIDService( | ||
| private val queryAdminPort: QueryAdminPort, | ||
| ) : QueryAdminByUUIDUseCase { | ||
| /** | ||
| * UUID를 이용하여 관리자 정보를 조회합니다. | ||
| */ | ||
| @Transactional(readOnly = true) | ||
| override fun queryByUUID(adminId: UUID): InternalAdminResponse { | ||
| val admin = queryAdminPort.findById(adminId) ?: throw AdminNotFoundException | ||
| return InternalAdminResponse( | ||
| id = admin.id!!, | ||
| ) | ||
| } | ||
| } |
17 changes: 17 additions & 0 deletions
17
casper-user/src/main/kotlin/hs/kr/entrydsm/user/domain/admin/model/Admin.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| package hs.kr.entrydsm.user.domain.admin.model | ||
|
|
||
| import java.util.UUID | ||
|
|
||
| /** | ||
| * 관리자 도메인 모델을 나타내는 데이터 클래스입니다. | ||
| * 시스템 관리자의 인증 정보를 관리합니다. | ||
| * | ||
| * @property id 관리자 고유 식별자 | ||
| * @property adminId 관리자 로그인 ID | ||
| * @property password 암호화된 비밀번호 | ||
| */ | ||
| data class Admin( | ||
| val id: UUID?, | ||
| val adminId: String, | ||
| val password: String, | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.