Skip to content

Commit

Permalink
Chore: remove pattern of member name, fix regex of member email
Browse files Browse the repository at this point in the history
  • Loading branch information
MustSave committed Nov 1, 2023
1 parent 606b52d commit a65894c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@AllArgsConstructor
public class MemberLoginDto {
@NotEmpty
@Pattern(regexp = "^[a-zA-Z0-9+-\\_.]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$")
@Pattern(regexp = "^[a-zA-Z0-9+-_.]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$")
private String email;

private String password;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
Expand All @@ -14,15 +15,14 @@
public class MemberSignupDto {

@NotEmpty
@Pattern(regexp = "^[a-zA-Z0-9+-\\_.]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$",
@Pattern(regexp = "^[a-zA-Z0-9+-_.]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$",
message = "이메일 형식을 맞춰야합니다")
private String email;

private String password;

@NotEmpty
@Pattern(regexp = "^[a-zA-Z가-힣\\\\s]{2,15}",
message = "이름은 영문자, 한글, 공백포함 2글자부터 15글자까지 가능합니다.")
@Size(min = 2, max = 15, message = "이름은 2글자부터 15글자까지 가능합니다.")
private String name;

private String provider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public ResponseEntity<ErrorMessageDto> handleDefaultException(
Locale locale) {

logError(request, ex.getMessage(), ex);
log.error("Unhandled error", ex);

String errorMessage = messageSource.getMessage("exception", null, "예기치 못한 오류", locale);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(new ErrorMessageDto(errorMessage));
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/errors_ko_KR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ exception.illegalArgument=올바르지 않은 요청입니다.
exception.noSuchElement=리소스를 찾을 수 없습니다.

Pattern=올바른 형식이 아닙니다.
Size.name=이름은 2글자부터 15글자까지 가능합니다.
Pattern.email=올바른 이메일 형식이 아닙니다.
NotEmpty=문자를 입력해주세요.

0 comments on commit a65894c

Please sign in to comment.