Skip to content

Commit aff45f3

Browse files
committed
feat: name 필드 추가
- 조회 DTO 변환 메소드 추가
1 parent 652f31f commit aff45f3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/main/java/dmu/dasom/api/domain/applicant/entity/Applicant.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dmu.dasom.api.domain.applicant.entity;
22

3+
import dmu.dasom.api.domain.applicant.dto.ApplicantDetailsResponseDto;
34
import dmu.dasom.api.domain.applicant.dto.ApplicantResponseDto;
45
import dmu.dasom.api.domain.applicant.enums.ApplicantStatus;
56
import jakarta.persistence.*;
@@ -27,6 +28,10 @@ public class Applicant {
2728
@Id
2829
private Long id;
2930

31+
@Column(name = "name", nullable = false, length = 16)
32+
@Size(max = 16)
33+
private String name;
34+
3035
@Column(name = "student_no", nullable = false, length = 8)
3136
@Pattern(regexp = "^[0-9]{8}$")
3237
@Size(min = 8, max = 8)
@@ -77,14 +82,26 @@ public void updateStatus(final ApplicantStatus status) {
7782
public ApplicantResponseDto toApplicantResponse() {
7883
return ApplicantResponseDto.builder()
7984
.id(this.id)
85+
.name(this.name)
86+
.studentNo(this.studentNo)
87+
.status(this.status)
88+
.build();
89+
}
90+
91+
public ApplicantDetailsResponseDto toApplicantDetailsResponse() {
92+
return ApplicantDetailsResponseDto.builder()
93+
.id(this.id)
94+
.name(this.name)
8095
.studentNo(this.studentNo)
8196
.contact(this.contact)
8297
.email(this.email)
8398
.grade(this.grade)
8499
.reasonForApply(this.reasonForApply)
85100
.activityWish(this.activityWish)
101+
.isPrivacyPolicyAgreed(this.isPrivacyPolicyAgreed)
86102
.status(this.status)
87103
.createdAt(this.createdAt)
104+
.updatedAt(this.updatedAt)
88105
.build();
89106
}
90107

0 commit comments

Comments
 (0)