From 18b2a03c1be6eee74e173ba64baa1040175693f1 Mon Sep 17 00:00:00 2001 From: joon Date: Sun, 14 Apr 2024 17:37:25 +0900 Subject: [PATCH] =?UTF-8?q?:recycle:=20Refactor:=20=ED=9A=8C=EC=9B=90?= =?UTF-8?q?=EA=B0=80=EC=9E=85=20validation=20=EC=B6=94=EA=B0=80(#171)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TheGoods/web/dto/member/MemberRequestDTO.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/umc/TheGoods/web/dto/member/MemberRequestDTO.java b/src/main/java/com/umc/TheGoods/web/dto/member/MemberRequestDTO.java index 0e8059f..d125959 100644 --- a/src/main/java/com/umc/TheGoods/web/dto/member/MemberRequestDTO.java +++ b/src/main/java/com/umc/TheGoods/web/dto/member/MemberRequestDTO.java @@ -9,6 +9,9 @@ import javax.persistence.Column; import javax.persistence.criteria.CriteriaBuilder; +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Pattern; import java.util.Date; import java.util.List; @@ -18,12 +21,21 @@ public class MemberRequestDTO { @NoArgsConstructor @AllArgsConstructor public static class JoinDTO { + @NotBlank(message = "닉네임을 입력해주세요") private String nickname; + @NotBlank(message = "이름을 입력해주세요") private String name; + @NotBlank(message = "비밀번호를 입력해주세요") + @Pattern(regexp = "(?=.*[0-9])(?=.*[a-zA-Z])(?=.*\\W)(?=\\S+$).{8,16}", message = "비밀번호는 8~16자 영문, 숫자, 특수문자를 사용하세요.") private String password; + @NotBlank(message = "이메일을 입력해주세요") + @Email(message = "이메일 형식이 올바르지 않습니다.") private String email; + @NotBlank(message = "생일을 입력해주세요") private Date birthday; + @NotBlank(message = "휴대폰 번호를 입력해주세요") private String phone; + @NotBlank(message = "성별을 입력해주세요") private Gender gender; private List memberTerm;//약관 동의