From 20e1a020bfcfb002a1b8c8997440abc70bcf4d9d Mon Sep 17 00:00:00 2001 From: Sim-km Date: Sat, 26 Apr 2025 22:25:50 +0900 Subject: [PATCH] =?UTF-8?q?ASAP-426=20=EB=A6=B0=ED=8A=B8=20=EB=B0=98?= =?UTF-8?q?=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../asap/bootstrap/web/auth/api/AuthApi.kt | 46 +++++++++---------- .../web/auth/controller/AuthController.kt | 46 ++++++++++--------- .../asap/bootstrap/web/image/api/ImageApi.kt | 17 ++++--- .../web/image/controller/ImageController.kt | 22 ++++----- .../controller/DraftLetterController.kt | 26 ++++++----- .../web/space/controller/SpaceController.kt | 5 +- .../web/user/controller/UserController.kt | 5 +- .../letter/entity/ReceiveDraftLetterEntity.kt | 5 +- 8 files changed, 91 insertions(+), 81 deletions(-) diff --git a/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/auth/api/AuthApi.kt b/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/auth/api/AuthApi.kt index 84497bf..cd12672 100644 --- a/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/auth/api/AuthApi.kt +++ b/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/auth/api/AuthApi.kt @@ -20,7 +20,6 @@ import org.springframework.web.bind.annotation.RequestMapping @Tag(name = "Auth", description = "Auth API") @RequestMapping("/api/v1/auth") interface AuthApi { - @Operation(summary = "소셜 로그인") @PostMapping("/login/{provider}") @ApiResponses( @@ -31,9 +30,9 @@ interface AuthApi { content = [ Content( mediaType = "application/json", - schema = Schema(implementation = SocialLoginResponse.Success::class) - ) - ] + schema = Schema(implementation = SocialLoginResponse.Success::class), + ), + ], ), ApiResponse( responseCode = "401", @@ -41,9 +40,9 @@ interface AuthApi { content = [ Content( mediaType = "application/json", - schema = Schema(implementation = SocialLoginResponse.NonRegistered::class) - ) - ] + schema = Schema(implementation = SocialLoginResponse.NonRegistered::class), + ), + ], ), ApiResponse( responseCode = "4XX", @@ -51,19 +50,18 @@ interface AuthApi { content = [ Content( mediaType = "application/json", - schema = Schema(implementation = ExceptionResponse::class) - ) - ] - ) - ] + schema = Schema(implementation = ExceptionResponse::class), + ), + ], + ), + ], ) fun socialLogin( - @Schema(description = "소셜 로그인 플랫폼, ex) KAKAO") + @Schema(description = "소셜 로그인 플랫폼, ex) KAKAO, GOOGLE, NAVER") @PathVariable provider: String, - @RequestBody request: SocialLoginRequest + @RequestBody request: SocialLoginRequest, ): ResponseEntity - @Operation(summary = "토큰 재발급") @PostMapping("/reissue") @ApiResponses( @@ -74,9 +72,9 @@ interface AuthApi { content = [ Content( mediaType = "application/json", - schema = Schema(implementation = ReissueResponse::class) - ) - ] + schema = Schema(implementation = ReissueResponse::class), + ), + ], ), ApiResponse( responseCode = "4XX", @@ -84,13 +82,13 @@ interface AuthApi { content = [ Content( mediaType = "application/json", - schema = Schema(implementation = ExceptionResponse::class) - ) - ] + schema = Schema(implementation = ExceptionResponse::class), + ), + ], ), - ] + ], ) fun reissueToken( - @RequestBody request: ReissueRequest + @RequestBody request: ReissueRequest, ): ReissueResponse -} \ No newline at end of file +} diff --git a/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/auth/controller/AuthController.kt b/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/auth/controller/AuthController.kt index 1b76616..408411e 100644 --- a/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/auth/controller/AuthController.kt +++ b/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/auth/controller/AuthController.kt @@ -14,40 +14,44 @@ import org.springframework.web.bind.annotation.RestController @RestController class AuthController( private val socialLoginUsecase: SocialLoginUsecase, - private val reissueTokenUsecase: ReissueTokenUsecase + private val reissueTokenUsecase: ReissueTokenUsecase, ) : AuthApi { - override fun socialLogin( provider: String, - request: SocialLoginRequest + request: SocialLoginRequest, ): ResponseEntity { - val command = SocialLoginUsecase.Command( - provider = provider, - accessToken = request.accessToken - ) + val command = + SocialLoginUsecase.Command( + provider = provider, + accessToken = request.accessToken, + ) return when (val response = socialLoginUsecase.login(command)) { - is SocialLoginUsecase.Success -> ResponseEntity.ok( - SocialLoginResponse.Success( - response.accessToken, - response.refreshToken, - response.isProcessedOnboarding + is SocialLoginUsecase.Success -> + ResponseEntity.ok( + SocialLoginResponse.Success( + response.accessToken, + response.refreshToken, + response.isProcessedOnboarding, + ), ) - ) - is SocialLoginUsecase.NonRegistered -> ResponseEntity.status(HttpStatus.UNAUTHORIZED) - .body(SocialLoginResponse.NonRegistered(response.registerToken)) + is SocialLoginUsecase.NonRegistered -> + ResponseEntity + .status(HttpStatus.UNAUTHORIZED) + .body(SocialLoginResponse.NonRegistered(response.registerToken)) } } override fun reissueToken(request: ReissueRequest): ReissueResponse { - val response = reissueTokenUsecase.reissue( - ReissueTokenUsecase.Command( - refreshToken = request.refreshToken + val response = + reissueTokenUsecase.reissue( + ReissueTokenUsecase.Command( + refreshToken = request.refreshToken, + ), ) - ) return ReissueResponse( accessToken = response.accessToken, - refreshToken = response.refreshToken + refreshToken = response.refreshToken, ) } -} \ No newline at end of file +} diff --git a/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/image/api/ImageApi.kt b/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/image/api/ImageApi.kt index c2f7e97..e817c6d 100644 --- a/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/image/api/ImageApi.kt +++ b/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/image/api/ImageApi.kt @@ -15,7 +15,6 @@ import org.springframework.web.multipart.MultipartFile @Tag(name = "Image", description = "Image API") @RequestMapping("/api/v1/images") interface ImageApi { - @Operation( summary = "이미지 업로드", description = "이미지를 업로드합니다.", @@ -30,18 +29,18 @@ interface ImageApi { Header( name = "Authorization", description = "액세스 토큰", - required = true - ) - ] + required = true, + ), + ], ), ApiResponse( responseCode = "4XX", - description = "이미지 업로드 실패" - ) - ] + description = "이미지 업로드 실패", + ), + ], ) fun uploadImage( @RequestPart image: MultipartFile, - @AccessUser userId: String + @AccessUser userId: String, ): UploadImageResponse -} \ No newline at end of file +} diff --git a/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/image/controller/ImageController.kt b/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/image/controller/ImageController.kt index 77b7663..a1513d9 100644 --- a/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/image/controller/ImageController.kt +++ b/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/image/controller/ImageController.kt @@ -10,21 +10,21 @@ import org.springframework.web.multipart.MultipartFile @RestController class ImageController( private val uploadImageUsecase: UploadImageUsecase, - private val fileConverter: FileConverter -): ImageApi { - + private val fileConverter: FileConverter, +) : ImageApi { override fun uploadImage( image: MultipartFile, - userId: String + userId: String, ): UploadImageResponse { - val response = uploadImageUsecase.upload( - UploadImageUsecase.Command( - image = fileConverter.convert(image), - userId = userId + val response = + uploadImageUsecase.upload( + UploadImageUsecase.Command( + image = fileConverter.convert(image), + userId = userId, + ), ) - ) return UploadImageResponse( - imageUrl = response.imageUrl + imageUrl = response.imageUrl, ) } -} \ No newline at end of file +} diff --git a/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/letter/controller/DraftLetterController.kt b/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/letter/controller/DraftLetterController.kt index 6c2b078..649d8ba 100644 --- a/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/letter/controller/DraftLetterController.kt +++ b/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/letter/controller/DraftLetterController.kt @@ -42,7 +42,7 @@ class DraftLetterController( override fun updatePhysicalDraft( draftId: String, userId: String, - request: UpdatePhysicalDraftLetterRequest + request: UpdatePhysicalDraftLetterRequest, ) { updateDraftLetterUsecase.command( UpdateDraftLetterUsecase.Command.Physical( @@ -75,14 +75,15 @@ class DraftLetterController( override fun getAllPhysicalDrafts(userId: String): GetAllPhysicalDraftLetterResponse { val response = getPhysicalDraftLetterUsecase.getAll(GetPhysicalDraftLetterUsecase.Query.All(userId)) return GetAllPhysicalDraftLetterResponse( - drafts = response.drafts.map { - PhysicalDraftLetterInfo( - draftKey = it.draftKey, - senderName = it.senderName, - content = it.content, - lastUpdated = it.lastUpdated, - ) - } + drafts = + response.drafts.map { + PhysicalDraftLetterInfo( + draftKey = it.draftKey, + senderName = it.senderName, + content = it.content, + lastUpdated = it.lastUpdated, + ) + }, ) } @@ -107,7 +108,7 @@ class DraftLetterController( override fun getPhysicalDraftLetter( draftKey: String, - userId: String + userId: String, ): GetPhysicalDraftLetterResponse { val response = getPhysicalDraftLetterUsecase.getByKey(GetPhysicalDraftLetterUsecase.Query.ByKey(draftKey, userId)) return GetPhysicalDraftLetterResponse( @@ -140,7 +141,10 @@ class DraftLetterController( ) } - override fun deletePhysicalDraft(draftId: String, userId: String) { + override fun deletePhysicalDraft( + draftId: String, + userId: String, + ) { removeDraftLetterUsecase.deleteBy( RemoveDraftLetterUsecase.Command.Physical( draftId = draftId, diff --git a/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/space/controller/SpaceController.kt b/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/space/controller/SpaceController.kt index 914f01c..46ae14c 100644 --- a/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/space/controller/SpaceController.kt +++ b/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/space/controller/SpaceController.kt @@ -91,7 +91,10 @@ class SpaceController( ) } - override fun updateSpaceMain(spaceId: String, userId: String) { + override fun updateSpaceMain( + spaceId: String, + userId: String, + ) { updateSpaceUsecase.update( UpdateSpaceUsecase.Command.Main( userId = userId, diff --git a/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/user/controller/UserController.kt b/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/user/controller/UserController.kt index 33e7c3f..bb41345 100644 --- a/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/user/controller/UserController.kt +++ b/Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/user/controller/UserController.kt @@ -40,7 +40,10 @@ class UserController( ) } - override fun deleteUser(userId: String, request: UnregisterUserRequest?) { + override fun deleteUser( + userId: String, + request: UnregisterUserRequest?, + ) { deleteUserUsecase.delete( DeleteUserUsecase.Command( userId = userId, diff --git a/Infrastructure-Module/Persistence/src/main/kotlin/com/asap/persistence/jpa/letter/entity/ReceiveDraftLetterEntity.kt b/Infrastructure-Module/Persistence/src/main/kotlin/com/asap/persistence/jpa/letter/entity/ReceiveDraftLetterEntity.kt index 2ef2081..f2be6e4 100644 --- a/Infrastructure-Module/Persistence/src/main/kotlin/com/asap/persistence/jpa/letter/entity/ReceiveDraftLetterEntity.kt +++ b/Infrastructure-Module/Persistence/src/main/kotlin/com/asap/persistence/jpa/letter/entity/ReceiveDraftLetterEntity.kt @@ -10,7 +10,7 @@ import java.time.LocalDateTime @Entity @Table( - name = "receive_draft_letters" + name = "receive_draft_letters", ) class ReceiveDraftLetterEntity( id: String, @@ -59,5 +59,4 @@ class ReceiveDraftLetterEntity( columnDefinition = "VARCHAR(20)", ) var type: ReceiveDraftLetterType = type - -} \ No newline at end of file +}