From d09525395304f8544d21d7e3e6292f7f23a03e3f Mon Sep 17 00:00:00 2001 From: JeongUijeong Date: Thu, 14 Dec 2023 15:10:15 +0900 Subject: [PATCH 1/7] =?UTF-8?q?refactor:=20=EC=83=9D=EC=84=B1=EC=9E=90=20?= =?UTF-8?q?=EC=A0=91=EA=B7=BC=20=EB=A0=88=EB=B2=A8=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member/dto/request/CheckPasswordRequestDto.java | 5 +++-- .../domain/member/dto/request/RefreshRequestDto.java | 5 +++-- .../domain/member/dto/request/SignInRequestDto.java | 8 ++++---- .../domain/member/dto/request/SignUpRequestDto.java | 5 +++-- .../domain/member/dto/request/UpdateMemberRequestDto.java | 5 +++-- .../domain/member/dto/response/MemberResponseDto.java | 5 +++-- .../domain/member/dto/response/SignInResponseDto.java | 5 +++-- .../domain/member/dto/response/TokenResponseDto.java | 5 +++-- 8 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/CheckPasswordRequestDto.java b/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/CheckPasswordRequestDto.java index af1324bc..0bfafe93 100644 --- a/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/CheckPasswordRequestDto.java +++ b/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/CheckPasswordRequestDto.java @@ -1,19 +1,20 @@ package com.fc.shimpyo_be.domain.member.dto.request; import jakarta.validation.constraints.NotBlank; +import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; @Getter -@NoArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) public class CheckPasswordRequestDto { @NotBlank(message = "비밀번호를 입력하세요.") private String password; @Builder - public CheckPasswordRequestDto(String password) { + private CheckPasswordRequestDto(String password) { this.password = password; } } diff --git a/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/RefreshRequestDto.java b/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/RefreshRequestDto.java index 3523d5d6..740aecb6 100644 --- a/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/RefreshRequestDto.java +++ b/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/RefreshRequestDto.java @@ -1,12 +1,13 @@ package com.fc.shimpyo_be.domain.member.dto.request; import jakarta.validation.constraints.NotBlank; +import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; @Getter -@NoArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) public class RefreshRequestDto { @NotBlank(message = "Access Token 을 입력하세요.") @@ -15,7 +16,7 @@ public class RefreshRequestDto { private String refreshToken; @Builder - public RefreshRequestDto(String accessToken, String refreshToken) { + private RefreshRequestDto(String accessToken, String refreshToken) { this.accessToken = accessToken; this.refreshToken = refreshToken; } diff --git a/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignInRequestDto.java b/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignInRequestDto.java index ea765cdf..4be9b0e6 100644 --- a/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignInRequestDto.java +++ b/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignInRequestDto.java @@ -2,14 +2,14 @@ import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Pattern; -import jakarta.validation.constraints.Size; +import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; @Getter -@NoArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) public class SignInRequestDto { @NotBlank(message = "이메일을 입력하세요.") @@ -19,12 +19,12 @@ public class SignInRequestDto { private String password; @Builder - public SignInRequestDto(String email, String password) { + private SignInRequestDto(String email, String password) { this.email = email; this.password = password; } - public UsernamePasswordAuthenticationToken toAuthentication(){ + public UsernamePasswordAuthenticationToken toAuthentication() { return new UsernamePasswordAuthenticationToken(this.email, this.password); } } diff --git a/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignUpRequestDto.java b/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignUpRequestDto.java index 30dedcd0..0c64bcc9 100644 --- a/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignUpRequestDto.java +++ b/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignUpRequestDto.java @@ -5,13 +5,14 @@ import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Pattern; import jakarta.validation.constraints.Size; +import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import org.springframework.security.crypto.password.PasswordEncoder; @Getter -@NoArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) public class SignUpRequestDto { @NotBlank(message = "이메일을 입력하세요.") @@ -26,7 +27,7 @@ public class SignUpRequestDto { private String passwordConfirm; @Builder - public SignUpRequestDto(String email, String name, String password, String passwordConfirm) { + private SignUpRequestDto(String email, String name, String password, String passwordConfirm) { this.email = email; this.name = name; this.password = password; diff --git a/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/UpdateMemberRequestDto.java b/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/UpdateMemberRequestDto.java index 0bef7927..445f874f 100644 --- a/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/UpdateMemberRequestDto.java +++ b/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/UpdateMemberRequestDto.java @@ -1,11 +1,12 @@ package com.fc.shimpyo_be.domain.member.dto.request; +import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; @Getter -@NoArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) public class UpdateMemberRequestDto { private String password; @@ -13,7 +14,7 @@ public class UpdateMemberRequestDto { private String photoUrl; @Builder - public UpdateMemberRequestDto(String password, String passwordConfirm, String photoUrl) { + private UpdateMemberRequestDto(String password, String passwordConfirm, String photoUrl) { this.password = password; this.passwordConfirm = passwordConfirm; this.photoUrl = photoUrl; diff --git a/src/main/java/com/fc/shimpyo_be/domain/member/dto/response/MemberResponseDto.java b/src/main/java/com/fc/shimpyo_be/domain/member/dto/response/MemberResponseDto.java index 949a10c4..aa80ac89 100644 --- a/src/main/java/com/fc/shimpyo_be/domain/member/dto/response/MemberResponseDto.java +++ b/src/main/java/com/fc/shimpyo_be/domain/member/dto/response/MemberResponseDto.java @@ -1,12 +1,13 @@ package com.fc.shimpyo_be.domain.member.dto.response; import com.fc.shimpyo_be.domain.member.entity.Member; +import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; @Getter -@NoArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) public class MemberResponseDto { private Long memberId; @@ -15,7 +16,7 @@ public class MemberResponseDto { private String photoUrl; @Builder - public MemberResponseDto(Long memberId, String email, String name, String photoUrl) { + private MemberResponseDto(Long memberId, String email, String name, String photoUrl) { this.memberId = memberId; this.email = email; this.name = name; diff --git a/src/main/java/com/fc/shimpyo_be/domain/member/dto/response/SignInResponseDto.java b/src/main/java/com/fc/shimpyo_be/domain/member/dto/response/SignInResponseDto.java index 89fd6040..352c70cd 100644 --- a/src/main/java/com/fc/shimpyo_be/domain/member/dto/response/SignInResponseDto.java +++ b/src/main/java/com/fc/shimpyo_be/domain/member/dto/response/SignInResponseDto.java @@ -1,18 +1,19 @@ package com.fc.shimpyo_be.domain.member.dto.response; +import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; @Getter -@NoArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) public class SignInResponseDto { private MemberResponseDto member; private TokenResponseDto token; @Builder - public SignInResponseDto(MemberResponseDto member, TokenResponseDto token) { + private SignInResponseDto(MemberResponseDto member, TokenResponseDto token) { this.member = member; this.token = token; } diff --git a/src/main/java/com/fc/shimpyo_be/domain/member/dto/response/TokenResponseDto.java b/src/main/java/com/fc/shimpyo_be/domain/member/dto/response/TokenResponseDto.java index 582a440b..7d5ce9f5 100644 --- a/src/main/java/com/fc/shimpyo_be/domain/member/dto/response/TokenResponseDto.java +++ b/src/main/java/com/fc/shimpyo_be/domain/member/dto/response/TokenResponseDto.java @@ -1,11 +1,12 @@ package com.fc.shimpyo_be.domain.member.dto.response; +import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; @Getter -@NoArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) public class TokenResponseDto { private String grantType; @@ -14,7 +15,7 @@ public class TokenResponseDto { private String refreshToken; @Builder - public TokenResponseDto(String grantType, String accessToken, long accessTokenExpiresIn, + private TokenResponseDto(String grantType, String accessToken, long accessTokenExpiresIn, String refreshToken) { this.grantType = grantType; this.accessToken = accessToken; From 29410b614469bbccaa03b8eb68e40db6cb484583 Mon Sep 17 00:00:00 2001 From: JeongUijeong Date: Thu, 14 Dec 2023 15:10:36 +0900 Subject: [PATCH 2/7] =?UTF-8?q?test:=20=EC=A3=BC=EC=84=9D=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 --- .../domain/member/docs/AuthRestControllerDocsTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/fc/shimpyo_be/domain/member/docs/AuthRestControllerDocsTest.java b/src/test/java/com/fc/shimpyo_be/domain/member/docs/AuthRestControllerDocsTest.java index a3208c56..e4350f54 100644 --- a/src/test/java/com/fc/shimpyo_be/domain/member/docs/AuthRestControllerDocsTest.java +++ b/src/test/java/com/fc/shimpyo_be/domain/member/docs/AuthRestControllerDocsTest.java @@ -57,7 +57,7 @@ void signUp() throws Exception { given(authService.signUp(any(SignUpRequestDto.class))).willReturn(memberResponseDto); - // when + // when then mockMvc.perform(post("/api/auth/signup") .content(objectMapper.writeValueAsString(signUpRequestDto)) .contentType(MediaType.APPLICATION_JSON)) @@ -118,7 +118,7 @@ void signIn() throws Exception { given(authService.signIn(any(SignInRequestDto.class))).willReturn(signInResponseDto); - // when + // when then mockMvc.perform(post("/api/auth/signin") .content(objectMapper.writeValueAsString(signInRequestDto)) .contentType(MediaType.APPLICATION_JSON)) @@ -187,7 +187,7 @@ void refresh() throws Exception { given(authService.refresh(any(RefreshRequestDto.class))).willReturn(signInResponseDto); - // when + // when then mockMvc.perform(post("/api/auth/refresh") .content(objectMapper.writeValueAsString(refreshRequestDto)) .contentType(MediaType.APPLICATION_JSON)) From 4fdd94588f03d199eb9c8cefbb1ab11b0ece8a37 Mon Sep 17 00:00:00 2001 From: JeongUijeong Date: Thu, 14 Dec 2023 15:27:44 +0900 Subject: [PATCH 3/7] =?UTF-8?q?refactor:=20=EC=83=9D=EC=84=B1=EC=9E=90=20?= =?UTF-8?q?=EC=A0=91=EA=B7=BC=20=EB=A0=88=EB=B2=A8=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fc/shimpyo_be/domain/member/entity/Member.java | 2 +- .../com/fc/shimpyo_be/domain/member/entity/RefreshToken.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/fc/shimpyo_be/domain/member/entity/Member.java b/src/main/java/com/fc/shimpyo_be/domain/member/entity/Member.java index bf843d32..94917b07 100644 --- a/src/main/java/com/fc/shimpyo_be/domain/member/entity/Member.java +++ b/src/main/java/com/fc/shimpyo_be/domain/member/entity/Member.java @@ -41,7 +41,7 @@ public class Member extends BaseTimeEntity { private Authority authority; @Builder - public Member(Long id, String email, String name, String password, String photoUrl, + private Member(Long id, String email, String name, String password, String photoUrl, Authority authority) { this.id = id; this.email = email; diff --git a/src/main/java/com/fc/shimpyo_be/domain/member/entity/RefreshToken.java b/src/main/java/com/fc/shimpyo_be/domain/member/entity/RefreshToken.java index 2d194fec..211d0864 100644 --- a/src/main/java/com/fc/shimpyo_be/domain/member/entity/RefreshToken.java +++ b/src/main/java/com/fc/shimpyo_be/domain/member/entity/RefreshToken.java @@ -20,7 +20,7 @@ public class RefreshToken { private String token; @Builder - public RefreshToken(Long id, String token) { + private RefreshToken(Long id, String token) { this.id = id; this.token = token; } From afccce466f5481869ecb602b8cfdb3b68d19b92a Mon Sep 17 00:00:00 2001 From: JeongUijeong Date: Thu, 14 Dec 2023 23:20:36 +0900 Subject: [PATCH 4/7] =?UTF-8?q?refactor:=20=ED=8C=A8=ED=84=B4=EA=B3=BC=20m?= =?UTF-8?q?in,=20max=20=EC=83=81=EC=88=98=EB=A1=9C=20=EA=B4=80=EB=A6=AC?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/member/dto/request/SignUpRequestDto.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignUpRequestDto.java b/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignUpRequestDto.java index 0c64bcc9..3f7bb9ac 100644 --- a/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignUpRequestDto.java +++ b/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignUpRequestDto.java @@ -15,11 +15,15 @@ @NoArgsConstructor(access = AccessLevel.PROTECTED) public class SignUpRequestDto { + private final String emailRegexp = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"; + private final int nameMin = 2; + private final int nameMax = 30; + @NotBlank(message = "이메일을 입력하세요.") - @Pattern(regexp = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", message = "이메일 형식에 맞게 입력해주세요.") + @Pattern(regexp = emailRegexp, message = "이메일 형식에 맞게 입력해주세요.") private String email; @NotBlank(message = "이름을 입력하세요.") - @Size(min = 2, max = 30, message = "이름은 최소 2자 이상 최대 30자 이내로 입력하세요.") + @Size(min = nameMin, max = nameMax, message = "이름은 최소 2자 이상 최대 30자 이내로 입력하세요.") private String name; @NotBlank(message = "비밀번호를 입력하세요.") private String password; From 0b1e31f02451b688dfe8b951b66a0df7b03e1e9c Mon Sep 17 00:00:00 2001 From: JeongUijeong Date: Thu, 14 Dec 2023 23:25:19 +0900 Subject: [PATCH 5/7] =?UTF-8?q?refactor:=20=EB=B9=84=EB=B0=80=EB=B2=88?= =?UTF-8?q?=ED=98=B8=20=ED=8C=A8=ED=84=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shimpyo_be/domain/member/dto/request/SignUpRequestDto.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignUpRequestDto.java b/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignUpRequestDto.java index 3f7bb9ac..77470d55 100644 --- a/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignUpRequestDto.java +++ b/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignUpRequestDto.java @@ -16,6 +16,7 @@ public class SignUpRequestDto { private final String emailRegexp = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"; + private final String passwordRegexp = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[@$#^()!%*?&])[A-Za-z\\d@$!#^()%*?&]{8,30}$"; private final int nameMin = 2; private final int nameMax = 30; @@ -26,8 +27,10 @@ public class SignUpRequestDto { @Size(min = nameMin, max = nameMax, message = "이름은 최소 2자 이상 최대 30자 이내로 입력하세요.") private String name; @NotBlank(message = "비밀번호를 입력하세요.") + @Pattern(regexp = passwordRegexp) private String password; @NotBlank(message = "비밀번호 확인을 입력하세요.") + @Pattern(regexp = passwordRegexp) private String passwordConfirm; @Builder From f8f01af1ac884dab975828eaeedbb9e1e3fd10e6 Mon Sep 17 00:00:00 2001 From: JeongUijeong Date: Thu, 14 Dec 2023 23:45:36 +0900 Subject: [PATCH 6/7] =?UTF-8?q?refactor:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20debug=20=EB=A1=9C=EA=B9=85=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/member/controller/AuthRestController.java | 6 ------ .../domain/member/controller/MemberRestController.java | 5 ----- 2 files changed, 11 deletions(-) diff --git a/src/main/java/com/fc/shimpyo_be/domain/member/controller/AuthRestController.java b/src/main/java/com/fc/shimpyo_be/domain/member/controller/AuthRestController.java index 07744978..d62db927 100644 --- a/src/main/java/com/fc/shimpyo_be/domain/member/controller/AuthRestController.java +++ b/src/main/java/com/fc/shimpyo_be/domain/member/controller/AuthRestController.java @@ -9,7 +9,6 @@ import com.fc.shimpyo_be.global.common.ResponseDto; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; @@ -17,7 +16,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -@Slf4j @RestController @RequiredArgsConstructor @RequestMapping("/api/auth") @@ -28,7 +26,6 @@ public class AuthRestController { @PostMapping("/signup") public ResponseEntity> signUp( @Valid @RequestBody SignUpRequestDto signUpRequestDto) { - log.debug("email: {}, name: {}", signUpRequestDto.getEmail(), signUpRequestDto.getName()); return ResponseEntity.status(HttpStatus.CREATED).body( ResponseDto.res(HttpStatus.CREATED, authService.signUp(signUpRequestDto), "성공적으로 회원가입 했습니다.")); @@ -37,7 +34,6 @@ public ResponseEntity> signUp( @PostMapping("/signin") public ResponseEntity> signIn( @Valid @RequestBody SignInRequestDto signInRequestDto) { - log.debug("email: {}", signInRequestDto.getEmail()); return ResponseEntity.status(HttpStatus.OK).body( ResponseDto.res(HttpStatus.OK, authService.signIn(signInRequestDto), "성공적으로 로그인 했습니다.")); @@ -46,8 +42,6 @@ public ResponseEntity> signIn( @PostMapping("/refresh") public ResponseEntity> refresh( @Valid @RequestBody RefreshRequestDto refreshRequestDto) { - log.debug("accessToken: {}, refreshToken: {}", refreshRequestDto.getAccessToken(), - refreshRequestDto.getRefreshToken()); return ResponseEntity.status(HttpStatus.OK).body( ResponseDto.res(HttpStatus.OK, authService.refresh(refreshRequestDto), "성공적으로 토큰을 재발급 했습니다.")); diff --git a/src/main/java/com/fc/shimpyo_be/domain/member/controller/MemberRestController.java b/src/main/java/com/fc/shimpyo_be/domain/member/controller/MemberRestController.java index 5393e4eb..629d2e16 100644 --- a/src/main/java/com/fc/shimpyo_be/domain/member/controller/MemberRestController.java +++ b/src/main/java/com/fc/shimpyo_be/domain/member/controller/MemberRestController.java @@ -7,7 +7,6 @@ import com.fc.shimpyo_be.global.common.ResponseDto; import com.fc.shimpyo_be.global.util.SecurityUtil; import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; @@ -17,7 +16,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -@Slf4j @RestController @RequiredArgsConstructor @RequestMapping("/api/members") @@ -28,7 +26,6 @@ public class MemberRestController { @GetMapping public ResponseEntity> getMember() { - log.debug("memberId: {}", securityUtil.getCurrentMemberId()); return ResponseEntity.status(HttpStatus.OK).body( ResponseDto.res(HttpStatus.OK, memberService.getMember(), "성공적으로 회원 정보를 조회했습니다.")); @@ -37,7 +34,6 @@ public ResponseEntity> getMember() { @PatchMapping public ResponseEntity> updateMember(@RequestBody UpdateMemberRequestDto updateMemberRequestDto) { - log.debug("memberId: {}", securityUtil.getCurrentMemberId()); return ResponseEntity.status(HttpStatus.OK).body( ResponseDto.res(HttpStatus.OK, memberService.updateMember(updateMemberRequestDto), "성공적으로 회원 정보를 수정했습니다.")); @@ -46,7 +42,6 @@ public ResponseEntity> updateMember(@RequestBody @PostMapping public ResponseEntity> checkPassword( @RequestBody CheckPasswordRequestDto checkPasswordRequestDto) { - log.debug("memberId: {}", securityUtil.getCurrentMemberId()); memberService.checkPassword(checkPasswordRequestDto); return ResponseEntity.status(HttpStatus.OK).body( ResponseDto.res(HttpStatus.OK, "비밀번호가 일치합니다.")); From a91a0f74342962e69b1e6560c729bfa2aa499d21 Mon Sep 17 00:00:00 2001 From: JeongUijeong Date: Thu, 14 Dec 2023 23:46:50 +0900 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20=ED=8C=A8=ED=84=B4,=20=EC=B5=9C?= =?UTF-8?q?=EC=86=8C/=EC=B5=9C=EB=8C=80=20=EA=B8=80=EC=9E=90=EC=88=98?= =?UTF-8?q?=EB=A5=BC=20=EC=A0=95=EC=A0=81=20=EC=83=81=EC=88=98=EB=A1=9C=20?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=ED=95=98=EB=8F=84=EB=A1=9D=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 --- .../member/dto/request/SignUpRequestDto.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignUpRequestDto.java b/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignUpRequestDto.java index 77470d55..ed0425f2 100644 --- a/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignUpRequestDto.java +++ b/src/main/java/com/fc/shimpyo_be/domain/member/dto/request/SignUpRequestDto.java @@ -15,22 +15,22 @@ @NoArgsConstructor(access = AccessLevel.PROTECTED) public class SignUpRequestDto { - private final String emailRegexp = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"; - private final String passwordRegexp = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[@$#^()!%*?&])[A-Za-z\\d@$!#^()%*?&]{8,30}$"; - private final int nameMin = 2; - private final int nameMax = 30; + private static final String EMAIL_REGEX = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"; + private static final int NAME_MIN = 2; + private static final int NAME_MAX = 30; + private static final String PASSWORD_REGEX = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[@$#^()!%*?&])[A-Za-z\\d@$!#^()%*?&]{8,30}$"; @NotBlank(message = "이메일을 입력하세요.") - @Pattern(regexp = emailRegexp, message = "이메일 형식에 맞게 입력해주세요.") + @Pattern(regexp = EMAIL_REGEX, message = "이메일 형식에 맞게 입력해주세요.") private String email; @NotBlank(message = "이름을 입력하세요.") - @Size(min = nameMin, max = nameMax, message = "이름은 최소 2자 이상 최대 30자 이내로 입력하세요.") + @Size(min = NAME_MIN, max = NAME_MAX, message = "이름은 최소 2자 이상 최대 30자 이내로 입력하세요.") private String name; @NotBlank(message = "비밀번호를 입력하세요.") - @Pattern(regexp = passwordRegexp) + @Pattern(regexp = PASSWORD_REGEX) private String password; @NotBlank(message = "비밀번호 확인을 입력하세요.") - @Pattern(regexp = passwordRegexp) + @Pattern(regexp = PASSWORD_REGEX) private String passwordConfirm; @Builder