-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
멤버 생성 컨트롤러 DTO를 추가함. Github issue #3
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
src/main/java/beforespring/socialfeed/member/controller/MemberController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package beforespring.socialfeed.member.controller;public class MemberController { | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/beforespring/socialfeed/member/controller/dto/CreateMemberDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
src/main/java/beforespring/socialfeed/member/domain/PasswordHasherImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package beforespring.socialfeed.member.domain;public class PasswordHasherImpl { | ||
} |