Skip to content

Commit

Permalink
[Feat] Member Entity에 Column 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
NARUBROWN committed Feb 13, 2024
1 parent 092fffd commit a911450
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 3 deletions.
23 changes: 23 additions & 0 deletions src/main/java/server/inuappcenter/kr/data/domain/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,28 @@ public class Member extends BaseTimeEntity {
@Column(name = "git_repository_link")
private String gitRepositoryLink;

@Column(name = "behance_link")
private String behanceLink;

@Column(name = "phone_number")
private String phoneNumber;

@Column(name = "student_number")
private String studentNumber;

private String department;

public Member (MemberRequestDto memberRequestDto) {
this.name = memberRequestDto.getName();
this.description = memberRequestDto.getDescription();
this.profileImage = memberRequestDto.getProfileImage();
this.email = memberRequestDto.getEmail();
this.blogLink = memberRequestDto.getBlogLink();
this.gitRepositoryLink = memberRequestDto.getGitRepositoryLink();
this.behanceLink = memberRequestDto.getBehanceLink();
this.phoneNumber = memberRequestDto.getPhoneNumber();
this.studentNumber = memberRequestDto.getStudentNumber();
this.department = memberRequestDto.getDepartment();
}

public void updateMember(Long id, MemberRequestDto memberRequestDto) {
Expand All @@ -49,6 +64,10 @@ public void updateMember(Long id, MemberRequestDto memberRequestDto) {
this.email = memberRequestDto.getEmail();
this.blogLink = memberRequestDto.getBlogLink();
this.gitRepositoryLink = memberRequestDto.getGitRepositoryLink();
this.behanceLink = memberRequestDto.getBehanceLink();
this.phoneNumber = memberRequestDto.getPhoneNumber();
this.studentNumber = memberRequestDto.getStudentNumber();
this.department = memberRequestDto.getDepartment();
}

public MemberResponseDto toMemberResponseDto(Member member) {
Expand All @@ -62,6 +81,10 @@ public MemberResponseDto toMemberResponseDto(Member member) {
.gitRepositoryLink(member.getGitRepositoryLink())
.lastModifiedDate(member.getLastModifiedDate())
.createdDate(member.getCreatedDate())
.behanceLink(member.getBehanceLink())
.phoneNumber(member.getPhoneNumber())
.studentNumber(member.getStudentNumber())
.department(member.getDepartment())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,38 @@ public class MemberRequestDto {
example = "[email protected]",
description = "이메일"
)
@NotBlank
@Email
private String email;

@Schema(
example = "https://...",
description = "Git 저장소 URL"
description = "Github 저장소 URL"
)
@Pattern(regexp = "^https?://.*$", message = "gitRepositoryLink의 URL 형식이 올바르지 않습니다.")
private String gitRepositoryLink;

@Schema(
example = "https://...",
description = "Behance URL"
)
@Pattern(regexp = "^https?://.*$", message = "Behance의 URL 형식이 올바르지 않습니다.")
private String behanceLink;

@Schema(
example = "010-0000-0000",
description = "전화번호"
)
private String phoneNumber;

@Schema(
example = "000000000",
description = "학번"
)
private String studentNumber;

@Schema(
example = "컴퓨터공학부",
description = "학과"
)
private String department;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ public class MemberResponseDto {
private final String blogLink;
private final String email;
private final String gitRepositoryLink;
private final String behanceLink;
private final String phoneNumber;
private final String studentNumber;
private final String department;
private final LocalDateTime createdDate;
private final LocalDateTime lastModifiedDate;

@Builder
private MemberResponseDto(Long member_id, String name, String description, String profileImage, String blogLink, String email, String gitRepositoryLink,
LocalDateTime createdDate, LocalDateTime lastModifiedDate) {
LocalDateTime createdDate, LocalDateTime lastModifiedDate, String behanceLink, String phoneNumber, String studentNumber, String department) {
this.member_id = member_id;
this.name = name;
this.description = description;
Expand All @@ -30,6 +34,10 @@ private MemberResponseDto(Long member_id, String name, String description, Strin
this.gitRepositoryLink = gitRepositoryLink;
this.createdDate = createdDate;
this.lastModifiedDate = lastModifiedDate;
this.behanceLink = behanceLink;
this.phoneNumber = phoneNumber;
this.studentNumber = studentNumber;
this.department = department;
}

public static MemberResponseDto entityToDto(Member member) {
Expand All @@ -43,6 +51,10 @@ public static MemberResponseDto entityToDto(Member member) {
.gitRepositoryLink(member.getGitRepositoryLink())
.createdDate(member.getCreatedDate())
.lastModifiedDate(member.getLastModifiedDate())
.behanceLink(member.getBehanceLink())
.phoneNumber(member.getPhoneNumber())
.studentNumber(member.getStudentNumber())
.department(member.getDepartment())
.build();
}
}

0 comments on commit a911450

Please sign in to comment.