From 2ec4a90ca376696fab42bd4e5e109ff3c6f85796 Mon Sep 17 00:00:00 2001 From: yunseo02 <154687627+yunseo02@users.noreply.github.com> Date: Sun, 9 Feb 2025 15:48:49 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=8E=A8=20[#114]=20reissue=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EB=A9=94=EC=84=B8=EC=A7=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit token 발급 관련 오류 메세지를 변경하였습니다. --- .../domain/auth/controller/AuthController.java | 12 ++++++------ .../exception/code/status/AuthErrorStatus.java | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/example/mody/domain/auth/controller/AuthController.java b/src/main/java/com/example/mody/domain/auth/controller/AuthController.java index 70e281b..21ca107 100644 --- a/src/main/java/com/example/mody/domain/auth/controller/AuthController.java +++ b/src/main/java/com/example/mody/domain/auth/controller/AuthController.java @@ -181,8 +181,8 @@ public BaseResponse completeRegistration( ) ), @ApiResponse( - responseCode = "401", - description = "유효하지 않거나 만료된 Refresh Token", + responseCode = "REFRESH_TOKEN404", + description = "유효하지 않은 리프레쉬 토큰일 때 발생합니다. (디비에 동일한 리프레쉬 토큰이 없을 때 발생)", content = @Content( mediaType = "application/json", examples = @ExampleObject( @@ -190,7 +190,7 @@ public BaseResponse completeRegistration( { "timestamp": "2024-01-13T10:00:00", "code": "AUTH006", - "message": "유효하지 않은 REFRESH TOKEN입니다.", + "message": "REFRESH TOKEN이 유효하지 않습니다.", "result": null } """ @@ -243,7 +243,7 @@ public BaseResponse reissueToken( ) ), @ApiResponse( - responseCode = "401", + responseCode = "AUTH401", description = "인증되지 않은 사용자", content = @Content( mediaType = "application/json", @@ -260,7 +260,7 @@ public BaseResponse reissueToken( ) ), @ApiResponse( - responseCode = "400", + responseCode = "REFRESH_TOKEN404", description = "유효하지 않은 Refresh Token", content = @Content( mediaType = "application/json", @@ -269,7 +269,7 @@ public BaseResponse reissueToken( { "timestamp": "2024-01-13T10:00:00", "code": "AUTH006", - "message": "유효하지 않은 REFRESH TOKEN입니다.", + "message": "REFRESH TOKEN이 유효하지 않습니다.", "result": null } """ diff --git a/src/main/java/com/example/mody/global/common/exception/code/status/AuthErrorStatus.java b/src/main/java/com/example/mody/global/common/exception/code/status/AuthErrorStatus.java index 358e5fe..c63dfbf 100644 --- a/src/main/java/com/example/mody/global/common/exception/code/status/AuthErrorStatus.java +++ b/src/main/java/com/example/mody/global/common/exception/code/status/AuthErrorStatus.java @@ -12,14 +12,14 @@ @AllArgsConstructor public enum AuthErrorStatus implements BaseCodeInterface { - EMPTY_JWT(HttpStatus.UNAUTHORIZED, "AUTH001", "JWT가 없습니다."), - EXPIRED_MEMBER_JWT(HttpStatus.UNAUTHORIZED, "AUTH002", "만료된 JWT입니다."), - UNSUPPORTED_JWT(HttpStatus.UNAUTHORIZED, "AUTH003", "지원하지 않는 JWT입니다."), - - INVALID_ID_TOKEN(HttpStatus.BAD_REQUEST, "AUTH004", "유효하지 않은 ID TOKEN입니다."), - EXPIRED_REFRESH_TOKEN(HttpStatus.BAD_REQUEST, "AUTH005", "만료된 REFRESH TOKEN입니다."), - INVALID_ACCESS_TOKEN(HttpStatus.BAD_REQUEST, "AUTH005", "유효하지 않은 ACCESS TOKEN입니다."), - INVALID_REFRESH_TOKEN(HttpStatus.BAD_REQUEST, "AUTH006", "유효하지 않은 REFRESH TOKEN입니다."), + EMPTY_JWT(HttpStatus.UNAUTHORIZED, "AUTH401", "JWT가 없습니다."), + EXPIRED_MEMBER_JWT(HttpStatus.UNAUTHORIZED, "TOKEN402", "JWT가 만료되었습니다."), + UNSUPPORTED_JWT(HttpStatus.UNAUTHORIZED, "TOKEN403", "지원하지 않는 JWT입니다."), + INVALID_ID_TOKEN(HttpStatus.BAD_REQUEST, "TOKEN401", "유효하지 않은 ID TOKEN입니다."), + + EXPIRED_REFRESH_TOKEN(HttpStatus.BAD_REQUEST, "REFRESH_TOKEN401", "REFRESH TOKEN이 만료되었습니다."), + INVALID_ACCESS_TOKEN(HttpStatus.BAD_REQUEST, "ACCESS_TOKEN404", "ACCESS TOKEN이 유효하지 않습니다."), + INVALID_REFRESH_TOKEN(HttpStatus.BAD_REQUEST, "REFRESH_TOKEN404", "REFRESH TOKEN이 유효하지 않습니다."), FAILED_SOCIAL_LOGIN(HttpStatus.INTERNAL_SERVER_ERROR, "AUTH007", "소셜 로그인에 실패하였습니다."), FAILED_GITHUB_AUTHENTICATION(HttpStatus.INTERNAL_SERVER_ERROR, "AUTH008", "깃허브 서버와 통신이 실패하였습니다."), From 821ac915de2d243a3148124e5941bc71fdcfe1a8 Mon Sep 17 00:00:00 2001 From: yunseo02 <154687627+yunseo02@users.noreply.github.com> Date: Sun, 9 Feb 2025 15:51:24 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=8E=A8=20[#114]=20=EC=8A=A4=EC=9B=A8?= =?UTF-8?q?=EA=B1=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 스웨거 오류 메세지 수정 --- .../example/mody/domain/auth/controller/AuthController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/example/mody/domain/auth/controller/AuthController.java b/src/main/java/com/example/mody/domain/auth/controller/AuthController.java index 21ca107..25e3985 100644 --- a/src/main/java/com/example/mody/domain/auth/controller/AuthController.java +++ b/src/main/java/com/example/mody/domain/auth/controller/AuthController.java @@ -189,7 +189,7 @@ public BaseResponse completeRegistration( value = """ { "timestamp": "2024-01-13T10:00:00", - "code": "AUTH006", + "code": "REFRESH_TOKEN404", "message": "REFRESH TOKEN이 유효하지 않습니다.", "result": null } @@ -268,7 +268,7 @@ public BaseResponse reissueToken( value = """ { "timestamp": "2024-01-13T10:00:00", - "code": "AUTH006", + "code": "REFRESH_TOKEN404", "message": "REFRESH TOKEN이 유효하지 않습니다.", "result": null } From d50a65b1fa6cc581485db82fea98b721e8bba9e5 Mon Sep 17 00:00:00 2001 From: yunseo02 <154687627+yunseo02@users.noreply.github.com> Date: Sun, 9 Feb 2025 16:07:09 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=9D=20[#114]=20docs:=20=EC=B6=94?= =?UTF-8?q?=EC=B2=9C=20=EA=B2=B0=EA=B3=BC=20=EC=A1=B0=ED=9A=8C=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=8A=A4=EC=9B=A8=EA=B1=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 추천 결과를 조회하는 api 오류메세지의 스웨거 문서를 수정하였습니다. --- .../controller/RecommendationControllerInterface.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/example/mody/domain/recommendation/controller/RecommendationControllerInterface.java b/src/main/java/com/example/mody/domain/recommendation/controller/RecommendationControllerInterface.java index ae127d6..8a68a82 100644 --- a/src/main/java/com/example/mody/domain/recommendation/controller/RecommendationControllerInterface.java +++ b/src/main/java/com/example/mody/domain/recommendation/controller/RecommendationControllerInterface.java @@ -48,15 +48,15 @@ public interface RecommendationControllerInterface { ), @ApiResponse( responseCode = "RECOMMENDATION404", - description = "사용자의 체형 정보를 찾을 수 없음", + description = "사용자가 추천받은 결과가 없을 때 발생합니다.", content = @Content( mediaType = "application/json", examples = @ExampleObject( value = """ { "timestamp": "2025-01-17T00:48:53.9237864", - "code": "MEMBER_BODY_TYPE404", - "message": "체형 분석 결과를 찾을 수 없습니다." + "code": "RECOMMENDATION404", + "message": "해당 추천 결과를 찾을 수 없습니다." } """ )