From 21e3136240e937fba3edeb311659658107985462 Mon Sep 17 00:00:00 2001 From: minjun Date: Mon, 22 May 2023 21:12:10 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[Add]=20#276=20-=20=EC=A4=91=EB=B3=B5?= =?UTF-8?q?=ED=99=95=EC=9D=B8=20API=20=EA=B4=80=EB=A0=A8=20SuccessResponse?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/shop/cazait/global/error/status/SuccessStatus.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/shop/cazait/global/error/status/SuccessStatus.java b/src/main/java/shop/cazait/global/error/status/SuccessStatus.java index 5e3225d4..d6e4ff45 100644 --- a/src/main/java/shop/cazait/global/error/status/SuccessStatus.java +++ b/src/main/java/shop/cazait/global/error/status/SuccessStatus.java @@ -20,6 +20,7 @@ public enum SuccessStatus { * OK */ SUCCESS(200,"SUCCESS","요청이 완료 되었습니다."), + SIGNUP_AVAILABLE(200,"SUCCESS","회원가입이 가능합니다"), /** * Success Code : 201 From 03636a6d18479696717e2d061b28e0184359bf1b Mon Sep 17 00:00:00 2001 From: minjun Date: Mon, 22 May 2023 21:13:02 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[Refactor]=20#276=20-=20=EC=A4=91=EB=B3=B5?= =?UTF-8?q?=ED=99=95=EC=9D=B8=20response=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/shop/cazait/domain/user/service/UserService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/shop/cazait/domain/user/service/UserService.java b/src/main/java/shop/cazait/domain/user/service/UserService.java index 629ad4f3..f960ac0a 100644 --- a/src/main/java/shop/cazait/domain/user/service/UserService.java +++ b/src/main/java/shop/cazait/domain/user/service/UserService.java @@ -7,6 +7,7 @@ import static shop.cazait.global.error.status.ErrorStatus.INVALID_JWT; import static shop.cazait.global.error.status.ErrorStatus.NOT_EXIST_USER; import static shop.cazait.global.error.status.ErrorStatus.NOT_EXPIRED_TOKEN; +import static shop.cazait.global.error.status.SuccessStatus.SIGNUP_AVAILABLE; import static shop.cazait.global.error.status.SuccessStatus.SUCCESS; import java.security.InvalidAlgorithmParameterException; @@ -151,7 +152,7 @@ public SuccessResponse checkduplicateEmail(PostCheckDuplicateEmailReq po if (!userRepository.findByEmail(email).isEmpty()) { throw new UserException(EXIST_EMAIL); } - return new SuccessResponse(SUCCESS, "회원가입이 가능합니다."); + return new SuccessResponse(SIGNUP_AVAILABLE, email); } public SuccessResponse checkduplicateNickname(PostCheckDuplicateNicknameReq postCheckDuplicateNicknameReq) throws UserException { @@ -159,7 +160,7 @@ public SuccessResponse checkduplicateNickname(PostCheckDuplicateNickname if (!userRepository.findByNickname(nickname.trim()).isEmpty()) { throw new UserException(EXIST_NICKNAME); } - return new SuccessResponse(SUCCESS, "회원가입이 가능합니다."); + return new SuccessResponse(SIGNUP_AVAILABLE, nickname); }