Skip to content

Commit

Permalink
Init: Add member controll dto
Browse files Browse the repository at this point in the history
멤버 생성 컨트롤러 DTO를 추가함.
Github issue #3
  • Loading branch information
honeyl3ee committed Oct 25, 2023
1 parent 3e414e4 commit df8816d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package beforespring.socialfeed.member.controller;public class MemberController {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package beforespring.socialfeed.member.controller.dto;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

public class CreateMemberDto {

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
static public class Request {
@NotEmpty
private String username;
@NotEmpty
@Email(message = "이메일 형식이 올바르지 않습니다.")
private String email;
@NotEmpty
@Size(min = 10, message = "비밀번호는 최소 10자 이상이어야 합니다.")
@Pattern(
regexp = "^(?=(.*\\\\d.*)(.*[A-Za-z].*|.*[^A-Za-z\\\\d].*))|" +
"(?=(.*[A-Za-z].*)(.*[^A-Za-z\\\\d].*))(?=.*\\\\d.*)|" +
"(?=(.*[A-Za-z].*)(.*\\\\d.*))(.*[^A-Za-z\\\\d].*)$|",
message = "비밀번호는 숫자, 문자, 특수문자 중 2가지 이상을 포함해야 합니다.")
@Pattern(regexp = "(.)\\\\1{2,}", message = "3회 이상 연속되는 문자는 사용할 수 없습니다.")
private String password;

public Request(String username, String email, String password) {
this.username = username;
this.email = email;
this.password = password;
}
}

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
static public class Response {
private Long id;

public Response(Long id) {
this.id = id;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package beforespring.socialfeed.member.domain;public class PasswordHasherImpl {
}

0 comments on commit df8816d

Please sign in to comment.