From 12fc5aba2f7dc09ff80a99315252e1ad8c4836d3 Mon Sep 17 00:00:00 2001 From: hwangdaesun Date: Tue, 8 Oct 2024 00:32:00 +0900 Subject: [PATCH 1/8] =?UTF-8?q?docs/#522=20:=20swagger=20summary=20?= =?UTF-8?q?=EB=B0=8F=20description=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapter/in/member/UpdatePasswordController.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/UpdatePasswordController.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/UpdatePasswordController.java index 9bddfef2..57430c5e 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/UpdatePasswordController.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/UpdatePasswordController.java @@ -27,7 +27,7 @@ @RestController @RequiredArgsConstructor @RequestMapping("/v1") -@Tag(name = "[비밀번호 변경]") +@Tag(name = "[비밀번호 찾기]") public class UpdatePasswordController { private final PasswordValidationUsecase passwordValidationUsecase; @@ -40,8 +40,8 @@ public class UpdatePasswordController { private final UpdatePasswordUsecase updatePasswordUsecase; @Operation( - summary = "비밀번호 변경 전 이메일 검증 및 메일 전송", - description = "비밀번호 변경하기 전, 이메일 검증 및 이메일을 재전송한다.") + summary = "비밀번호 찾기 전 이메일 검증 및 메일 전송", + description = "비밀번호 찾기 전, 이메일 검증 및 이메일을 재전송한다.") @PostMapping("/email") @ApiErrorExceptionsExample(UpdatePassword_validateEmailExceptionDocs.class) public ApiResponse> validateEmail( @@ -61,8 +61,8 @@ public void redirect(@RequestParam String email, HttpServletResponse response) { } @Operation( - summary = "비밀번호 찾기 및 변경", - description = "비밀번호 변경시 사용하고, 비밀번호를 찾을 시에도 무조건 비밀번호를 변경한다.") + summary = "비밀번호 찾기", + description = "비밀번호를 찾을 때 사용한다. 단, 비밀번호 찾기 버튼을 누르는 것이지 실제로는 새로운 비밀번호로 수정한다.") @PatchMapping("/members/password") @ApiErrorExceptionsExample(UpdatePassword_updatePasswordExceptionDocs.class) public ApiResponse> updatePassword( From 1d134d3486711253dbfcf5f04bc76ee6b239c5e3 Mon Sep 17 00:00:00 2001 From: hwangdaesun Date: Tue, 8 Oct 2024 00:33:49 +0900 Subject: [PATCH 2/8] =?UTF-8?q?refactor/#522=20:=20=ED=81=B4=EB=9E=98?= =?UTF-8?q?=EC=8A=A4=EB=AA=85=20update=20->=20find=EB=A1=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ntroller.java => FindPasswordController.java} | 16 ++++++++-------- ...wordRequest.java => FindPasswordRequest.java} | 4 ++-- ...indPassword_updatePasswordExceptionDocs.java} | 2 +- ...FindPassword_validateEmailExceptionDocs.java} | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) rename BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/{UpdatePasswordController.java => FindPasswordController.java} (83%) rename BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/request/{UpdatePasswordRequest.java => FindPasswordRequest.java} (88%) rename BE/exceed/src/main/java/com/gaebaljip/exceed/common/docs/member/{UpdatePassword_updatePasswordExceptionDocs.java => FindPassword_updatePasswordExceptionDocs.java} (92%) rename BE/exceed/src/main/java/com/gaebaljip/exceed/common/docs/member/{UpdatePassword_validateEmailExceptionDocs.java => FindPassword_validateEmailExceptionDocs.java} (90%) diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/UpdatePasswordController.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java similarity index 83% rename from BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/UpdatePasswordController.java rename to BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java index 57430c5e..fd6d1da0 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/UpdatePasswordController.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.*; import com.gaebaljip.exceed.adapter.in.member.request.SendEmailRequest; -import com.gaebaljip.exceed.adapter.in.member.request.UpdatePasswordRequest; +import com.gaebaljip.exceed.adapter.in.member.request.FindPasswordRequest; import com.gaebaljip.exceed.application.port.in.member.CheckCodeUsecase; import com.gaebaljip.exceed.application.port.in.member.GetCodeUsecase; import com.gaebaljip.exceed.application.port.in.member.PasswordValidationUsecase; @@ -16,8 +16,8 @@ import com.gaebaljip.exceed.common.ApiResponse; import com.gaebaljip.exceed.common.ApiResponse.CustomBody; import com.gaebaljip.exceed.common.ApiResponseGenerator; -import com.gaebaljip.exceed.common.docs.member.UpdatePassword_updatePasswordExceptionDocs; -import com.gaebaljip.exceed.common.docs.member.UpdatePassword_validateEmailExceptionDocs; +import com.gaebaljip.exceed.common.docs.member.FindPassword_updatePasswordExceptionDocs; +import com.gaebaljip.exceed.common.docs.member.FindPassword_validateEmailExceptionDocs; import com.gaebaljip.exceed.common.swagger.ApiErrorExceptionsExample; import io.swagger.v3.oas.annotations.Operation; @@ -28,7 +28,7 @@ @RequiredArgsConstructor @RequestMapping("/v1") @Tag(name = "[비밀번호 찾기]") -public class UpdatePasswordController { +public class FindPasswordController { private final PasswordValidationUsecase passwordValidationUsecase; private final GetCodeUsecase getCodeUsecase; @@ -43,7 +43,7 @@ public class UpdatePasswordController { summary = "비밀번호 찾기 전 이메일 검증 및 메일 전송", description = "비밀번호 찾기 전, 이메일 검증 및 이메일을 재전송한다.") @PostMapping("/email") - @ApiErrorExceptionsExample(UpdatePassword_validateEmailExceptionDocs.class) + @ApiErrorExceptionsExample(FindPassword_validateEmailExceptionDocs.class) public ApiResponse> validateEmail( @RequestBody @Valid SendEmailRequest request) { passwordValidationUsecase.execute(request.email()); @@ -64,9 +64,9 @@ public void redirect(@RequestParam String email, HttpServletResponse response) { summary = "비밀번호 찾기", description = "비밀번호를 찾을 때 사용한다. 단, 비밀번호 찾기 버튼을 누르는 것이지 실제로는 새로운 비밀번호로 수정한다.") @PatchMapping("/members/password") - @ApiErrorExceptionsExample(UpdatePassword_updatePasswordExceptionDocs.class) - public ApiResponse> updatePassword( - @RequestBody @Valid UpdatePasswordRequest request) { + @ApiErrorExceptionsExample(FindPassword_updatePasswordExceptionDocs.class) + public ApiResponse> findPassword( + @RequestBody @Valid FindPasswordRequest request) { passwordValidationUsecase.execute(request.email()); checkCodeUsecase.execute(request.email(), request.code()); updatePasswordUsecase.execute(request.email(), request.newPassword()); diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/request/UpdatePasswordRequest.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/request/FindPasswordRequest.java similarity index 88% rename from BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/request/UpdatePasswordRequest.java rename to BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/request/FindPasswordRequest.java index 72522c6b..4e699a60 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/request/UpdatePasswordRequest.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/request/FindPasswordRequest.java @@ -8,11 +8,11 @@ import lombok.Builder; -public record UpdatePasswordRequest( +public record FindPasswordRequest( @Email(message = ValidationMessage.INVALID_EMAIL) String email, @Password(message = ValidationMessage.INVALID_PASSWORD) String newPassword, @NotBlank(message = "인증 코드를 " + ValidationMessage.NOT_BLANK) String code) { @Builder - public UpdatePasswordRequest {} + public FindPasswordRequest {} } diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/docs/member/UpdatePassword_updatePasswordExceptionDocs.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/docs/member/FindPassword_updatePasswordExceptionDocs.java similarity index 92% rename from BE/exceed/src/main/java/com/gaebaljip/exceed/common/docs/member/UpdatePassword_updatePasswordExceptionDocs.java rename to BE/exceed/src/main/java/com/gaebaljip/exceed/common/docs/member/FindPassword_updatePasswordExceptionDocs.java index e049be3c..ddcb2c16 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/docs/member/UpdatePassword_updatePasswordExceptionDocs.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/docs/member/FindPassword_updatePasswordExceptionDocs.java @@ -9,7 +9,7 @@ import com.gaebaljip.exceed.common.swagger.SwaggerExampleExceptions; @ExceptionDoc -public class UpdatePassword_updatePasswordExceptionDocs implements SwaggerExampleExceptions { +public class FindPassword_updatePasswordExceptionDocs implements SwaggerExampleExceptions { @ExplainError("회원이 존재하지 않을 때") public EatCeedException 회원이_존재하지_않을_때 = MemberNotFoundException.EXECPTION; diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/docs/member/UpdatePassword_validateEmailExceptionDocs.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/docs/member/FindPassword_validateEmailExceptionDocs.java similarity index 90% rename from BE/exceed/src/main/java/com/gaebaljip/exceed/common/docs/member/UpdatePassword_validateEmailExceptionDocs.java rename to BE/exceed/src/main/java/com/gaebaljip/exceed/common/docs/member/FindPassword_validateEmailExceptionDocs.java index f8467423..041c97f6 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/docs/member/UpdatePassword_validateEmailExceptionDocs.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/docs/member/FindPassword_validateEmailExceptionDocs.java @@ -8,7 +8,7 @@ import com.gaebaljip.exceed.common.swagger.SwaggerExampleExceptions; @ExceptionDoc -public class UpdatePassword_validateEmailExceptionDocs implements SwaggerExampleExceptions { +public class FindPassword_validateEmailExceptionDocs implements SwaggerExampleExceptions { @ExplainError("회원이 존재하지 않을 때") public EatCeedException 회원이_존재하지_않을_때 = MemberNotFoundException.EXECPTION; From 19b006dd20bc837ff8d9645cf728b48f4ef00f25 Mon Sep 17 00:00:00 2001 From: hwangdaesun Date: Tue, 8 Oct 2024 00:47:02 +0900 Subject: [PATCH 3/8] =?UTF-8?q?refactor/#522=20:=20=EB=B9=84=EB=B0=80?= =?UTF-8?q?=EB=B2=88=ED=98=B8=20=EC=B0=BE=EA=B8=B0=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?MailTemplate=20=EC=83=81=EC=88=98=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapter/in/member/FindPasswordController.java | 3 +-- .../java/com/gaebaljip/exceed/common/MailTemplate.java | 10 +++++----- .../common/event/handler/SendEmailEventListener.java | 10 +++++----- .../{updatePassword.html => findPassword.html} | 6 +++--- 4 files changed, 14 insertions(+), 15 deletions(-) rename BE/exceed/src/main/resources/templates/{updatePassword.html => findPassword.html} (68%) diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java index fd6d1da0..f6b09657 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java @@ -7,8 +7,8 @@ import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import com.gaebaljip.exceed.adapter.in.member.request.SendEmailRequest; import com.gaebaljip.exceed.adapter.in.member.request.FindPasswordRequest; +import com.gaebaljip.exceed.adapter.in.member.request.SendEmailRequest; import com.gaebaljip.exceed.application.port.in.member.CheckCodeUsecase; import com.gaebaljip.exceed.application.port.in.member.GetCodeUsecase; import com.gaebaljip.exceed.application.port.in.member.PasswordValidationUsecase; @@ -67,7 +67,6 @@ public void redirect(@RequestParam String email, HttpServletResponse response) { @ApiErrorExceptionsExample(FindPassword_updatePasswordExceptionDocs.class) public ApiResponse> findPassword( @RequestBody @Valid FindPasswordRequest request) { - passwordValidationUsecase.execute(request.email()); checkCodeUsecase.execute(request.email(), request.code()); updatePasswordUsecase.execute(request.email(), request.newPassword()); return ApiResponseGenerator.success(HttpStatus.OK); diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/MailTemplate.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/MailTemplate.java index ad45ce8a..49026ca6 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/MailTemplate.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/MailTemplate.java @@ -2,14 +2,14 @@ public class MailTemplate { public static final String SIGN_UP_TEMPLATE = "signup"; - public static final String UPDATE_PASSWORD_TEMPLATE = "updatePassword"; + public static final String FIND_PASSWORD_TEMPLATE = "findPassword"; public static final String SIGN_UP_TITLE = "Eatceed 회원가입 인증 메일"; - public static final String UPDATE_PASSWORD_TITLE = "Eatceed 비밀번호 변경 메일"; + public static final String FIND_PASSWORD_TITLE = "Eatceed 비밀번호 찾기 메일"; public static final String SIGN_UP_MAIL_CONTEXT = "signupLink"; - public static final String UPDATE_PASSWORD_MAIL_CONTEXT = "updatePasswordLink"; + public static final String FIND_PASSWORD_MAIL_CONTEXT = "findPasswordLink"; public static final String SIGN_UP_EMAIL = "email"; - public static final String UPDATE_PASSWORD_EMAIL = "email"; + public static final String FIND_PASSWORD_EMAIL = "email"; public static final String REPLY_TO_SIGN_UP_MAIL_URL = "/v1/signUp-redirect"; - public static final String REPLY_TO_UPDATE_PASSWORD_MAIL_URL = "/v1/updatePassword-redirect"; + public static final String REPLY_TO_FIND_PASSWORD_MAIL_URL = "/v1/findPassword-redirect"; } diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/event/handler/SendEmailEventListener.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/event/handler/SendEmailEventListener.java index bfb1ea96..39aa5bf7 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/event/handler/SendEmailEventListener.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/event/handler/SendEmailEventListener.java @@ -34,13 +34,13 @@ public void handle(SendEmailEvent event) { codePort.saveWithExpiration(event.getEmail(), Code.create(), expiredTime); Context context = new Context(); context.setVariable( - MailTemplate.UPDATE_PASSWORD_MAIL_CONTEXT, - URL + MailTemplate.REPLY_TO_UPDATE_PASSWORD_MAIL_URL); - context.setVariable(MailTemplate.UPDATE_PASSWORD_EMAIL, "?email=" + event.getEmail()); + MailTemplate.FIND_PASSWORD_MAIL_CONTEXT, + URL + MailTemplate.REPLY_TO_FIND_PASSWORD_MAIL_URL); + context.setVariable(MailTemplate.FIND_PASSWORD_EMAIL, "?email=" + event.getEmail()); emailPort.sendEmail( event.getEmail(), - MailTemplate.UPDATE_PASSWORD_TITLE, - MailTemplate.UPDATE_PASSWORD_TEMPLATE, + MailTemplate.FIND_PASSWORD_TITLE, + MailTemplate.FIND_PASSWORD_TEMPLATE, context); } } diff --git a/BE/exceed/src/main/resources/templates/updatePassword.html b/BE/exceed/src/main/resources/templates/findPassword.html similarity index 68% rename from BE/exceed/src/main/resources/templates/updatePassword.html rename to BE/exceed/src/main/resources/templates/findPassword.html index 5f6bb359..beb61fcb 100644 --- a/BE/exceed/src/main/resources/templates/updatePassword.html +++ b/BE/exceed/src/main/resources/templates/findPassword.html @@ -2,14 +2,14 @@ - Eatceed 비밀번호 변경 + Eatceed 비밀번호 찾기

비밀번호 변경

안녕하세요 체중 증량 어플 Eatceed입니다.

-

아래의 링크를 클릭해 비밀번호 변경 페이지로 이동해주세요.

+

아래의 링크를 클릭해 비밀번호 찾기 페이지로 이동해주세요.

인증을 요청하지 않았다면, 이 이메일을 무시하셔도 됩니다.

-비밀번호 변경 링크 +비밀번호 변경 링크 \ No newline at end of file From f2d7d11bd8ca39e167ba195659697b63ecc70304 Mon Sep 17 00:00:00 2001 From: hwangdaesun Date: Tue, 8 Oct 2024 00:47:29 +0900 Subject: [PATCH 4/8] =?UTF-8?q?refactor/#522=20:=20=EB=A6=AC=EB=8B=A4?= =?UTF-8?q?=EC=9D=B4=EB=A0=89=ED=8A=B8=20URL=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exceed/adapter/in/member/FindPasswordController.java | 2 +- .../gaebaljip/exceed/common/security/config/SecurityConfig.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java index f6b09657..8aa34889 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java @@ -51,7 +51,7 @@ public ApiResponse> validateEmail( } @Operation(summary = "링크 클릭시 리다이렉트", description = "AOS는 몰라도 되는 API") - @GetMapping("/updatePassword-redirect") + @GetMapping("/findPassword-redirect") public void redirect(@RequestParam String email, HttpServletResponse response) { StringBuilder sb = new StringBuilder(); String code = getCodeUsecase.execute(email); diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/security/config/SecurityConfig.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/security/config/SecurityConfig.java index 289b6aec..0e25be0c 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/security/config/SecurityConfig.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/security/config/SecurityConfig.java @@ -73,7 +73,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { "/v1/members/email/checked", "/actuator/**", "/v1/health", - "/v1//updatePassword-redirect", + "/v1//findPassword-redirect", "/v1/signUp-redirect") .permitAll() .antMatchers(HttpMethod.PUT, "/v1/members/email/confirmed") From 94604eaf43834faa21d0f01526ae30e946834875 Mon Sep 17 00:00:00 2001 From: hwangdaesun Date: Tue, 8 Oct 2024 00:47:45 +0900 Subject: [PATCH 5/8] refactor/#522 : spotless --- .../exceed/adapter/out/jpa/meal/MealPersistenceAdapter.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/out/jpa/meal/MealPersistenceAdapter.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/out/jpa/meal/MealPersistenceAdapter.java index cb6cc84e..1bddd9be 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/out/jpa/meal/MealPersistenceAdapter.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/out/jpa/meal/MealPersistenceAdapter.java @@ -8,7 +8,6 @@ import java.util.Map; import java.util.stream.Collectors; -import com.gaebaljip.exceed.common.dto.*; import org.springframework.stereotype.Component; import com.gaebaljip.exceed.adapter.out.jpa.nutritionist.MonthlyMealPort; @@ -18,6 +17,7 @@ import com.gaebaljip.exceed.application.domain.member.MemberEntity; import com.gaebaljip.exceed.application.port.out.meal.DailyMealPort; import com.gaebaljip.exceed.application.port.out.meal.MealPort; +import com.gaebaljip.exceed.common.dto.*; import lombok.RequiredArgsConstructor; @@ -45,8 +45,7 @@ public DailyMealFoods queryMealFoodsForDay(DailyMealDTO dailyMealDTO) { } @Override - public DaysMealRecordDTO queryMealFoodsForDays( - DaysMealDTO daysMealDTO) { + public DaysMealRecordDTO queryMealFoodsForDays(DaysMealDTO daysMealDTO) { List mealIds = mealRepository.findMealIdsByMemberAndMonth( daysMealDTO.startDateTime(), From 2582b3de934f8d6ae822a3e93179dfe5e5a0cb01 Mon Sep 17 00:00:00 2001 From: hwangdaesun Date: Tue, 8 Oct 2024 09:30:56 +0900 Subject: [PATCH 6/8] =?UTF-8?q?refactor/#522=20:=20=EB=B9=84=EB=B0=80?= =?UTF-8?q?=EB=B2=88=ED=98=B8=20=EC=B0=BE=EA=B8=B0=20HTTP=20METHOD=20GET?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exceed/adapter/in/member/FindPasswordController.java | 5 ++--- .../exceed/common/security/config/SecurityConfig.java | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java index 8aa34889..f938fd77 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java @@ -63,10 +63,9 @@ public void redirect(@RequestParam String email, HttpServletResponse response) { @Operation( summary = "비밀번호 찾기", description = "비밀번호를 찾을 때 사용한다. 단, 비밀번호 찾기 버튼을 누르는 것이지 실제로는 새로운 비밀번호로 수정한다.") - @PatchMapping("/members/password") + @GetMapping("/members/password") @ApiErrorExceptionsExample(FindPassword_updatePasswordExceptionDocs.class) - public ApiResponse> findPassword( - @RequestBody @Valid FindPasswordRequest request) { + public ApiResponse> findPassword(@Valid FindPasswordRequest request) { checkCodeUsecase.execute(request.email(), request.code()); updatePasswordUsecase.execute(request.email(), request.newPassword()); return ApiResponseGenerator.success(HttpStatus.OK); diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/security/config/SecurityConfig.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/security/config/SecurityConfig.java index 0e25be0c..857ef51e 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/security/config/SecurityConfig.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/security/config/SecurityConfig.java @@ -74,11 +74,12 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { "/actuator/**", "/v1/health", "/v1//findPassword-redirect", - "/v1/signUp-redirect") + "/v1/signUp-redirect", + "/v1/members/password") .permitAll() .antMatchers(HttpMethod.PUT, "/v1/members/email/confirmed") .permitAll() - .antMatchers(HttpMethod.PATCH, "/v1/members/checked", "/v1/members/password") + .antMatchers(HttpMethod.PATCH, "/v1/members/checked") .permitAll() .antMatchers(HttpMethod.POST, "/v1/members", "/v1/email") .permitAll() From a11c2f9eef801a04bc93f3b8ba7fcf6678307019 Mon Sep 17 00:00:00 2001 From: Jin Hyuk Date: Wed, 9 Oct 2024 22:30:54 +0900 Subject: [PATCH 7/8] =?UTF-8?q?test/#528:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gaebaljip/exceed/adapter/in/auth/AuthControllerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/adapter/in/auth/AuthControllerTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/adapter/in/auth/AuthControllerTest.java index 52d9fc1b..a6f03752 100644 --- a/BE/exceed/src/test/java/com/gaebaljip/exceed/adapter/in/auth/AuthControllerTest.java +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/adapter/in/auth/AuthControllerTest.java @@ -54,7 +54,7 @@ void when_login_expected_fail2() throws Exception { void when_login_expected_success() throws Exception { LoginRequest loginRequest = new LoginRequest("abcd1111!@gmail.com", "Abc@123"); TokenDTO tokenDTO = new TokenDTO("accessToken", "refreshToken"); - given(authService.execute(loginRequest)).willReturn(tokenDTO); + given(authService.login(loginRequest)).willReturn(tokenDTO); ResultActions resultActions = mockMvc.perform( From 4b0f5cf805d37899c2737330dfa022e282e35164 Mon Sep 17 00:00:00 2001 From: hwangdaesun Date: Thu, 10 Oct 2024 01:17:35 +0900 Subject: [PATCH 8/8] =?UTF-8?q?fix/#522=20:=20HTTP=20Method=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20=EB=B0=8F=20URL=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exceed/adapter/in/member/FindPasswordController.java | 4 ++-- .../exceed/common/security/config/SecurityConfig.java | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java index f938fd77..a6f9c638 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/FindPasswordController.java @@ -63,9 +63,9 @@ public void redirect(@RequestParam String email, HttpServletResponse response) { @Operation( summary = "비밀번호 찾기", description = "비밀번호를 찾을 때 사용한다. 단, 비밀번호 찾기 버튼을 누르는 것이지 실제로는 새로운 비밀번호로 수정한다.") - @GetMapping("/members/password") + @PatchMapping("/members/find-password") @ApiErrorExceptionsExample(FindPassword_updatePasswordExceptionDocs.class) - public ApiResponse> findPassword(@Valid FindPasswordRequest request) { + public ApiResponse> findPassword(@RequestBody @Valid FindPasswordRequest request) { checkCodeUsecase.execute(request.email(), request.code()); updatePasswordUsecase.execute(request.email(), request.newPassword()); return ApiResponseGenerator.success(HttpStatus.OK); diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/security/config/SecurityConfig.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/security/config/SecurityConfig.java index dbd01a1c..a9a4e417 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/security/config/SecurityConfig.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/security/config/SecurityConfig.java @@ -74,12 +74,11 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { "/actuator/**", "/v1/health", "/v1//findPassword-redirect", - "/v1/signUp-redirect", - "/v1/members/password") + "/v1/signUp-redirect") .permitAll() .antMatchers(HttpMethod.PUT, "/v1/members/email/confirmed") .permitAll() - .antMatchers(HttpMethod.PATCH, "/v1/members/checked") + .antMatchers(HttpMethod.PATCH, "/v1/members/checked", "/v1/members/find-password") .permitAll() .antMatchers(HttpMethod.POST, "/v1/members", "/v1/email") .permitAll()