Skip to content

Commit

Permalink
Merge pull request #223 from WE-ARE-RACCOONS/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ywj9811 authored Apr 12, 2024
2 parents 2aa3568 + 347121f commit 26f9464
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ private SeniorMapper() {
public static Senior mapToSenior(User user, SeniorSignUpRequest request) {
return Senior.builder()
.user(user)
.info(mapToInfo(request))
.info(mapToInfo(user, request))
.certification(request.certification())
.build();
}

public static Info mapToInfo(SeniorSignUpRequest request) {
public static Info mapToInfo(User user, SeniorSignUpRequest request) {
String[] fields = request.field().split(",");
Set<String> fieldNames = Field.fieldNames();
Set<String> postgraduNames = Postgradu.postgraduNames();
Expand All @@ -47,7 +47,7 @@ public static Info mapToInfo(SeniorSignUpRequest request) {
.etcPostgradu(false)
.etcField(false)
.totalInfo(request.major() + request.lab() + request.field()
+ request.professor() + request.postgradu() + request.keyword());
+ request.professor() + request.postgradu() + request.keyword() + user.getNickName());

for (String field : fields) {
if (!fieldNames.contains(field)) {
Expand Down Expand Up @@ -82,12 +82,12 @@ public static Profile mapToProfile(SeniorMyPageProfileRequest profileRequest) {
public static Senior mapToSenior(User user, SeniorChangeRequest request) {
return Senior.builder()
.user(user)
.info(mapToInfo(request))
.info(mapToInfo(user, request))
.certification(request.certification())
.build();
}

public static Info mapToInfo(SeniorChangeRequest request) {
public static Info mapToInfo(User user, SeniorChangeRequest request) {
String[] fields = request.field().split(",");
Set<String> fieldNames = Field.fieldNames();
Set<String> postgraduNames = Postgradu.postgraduNames();
Expand All @@ -102,7 +102,7 @@ public static Info mapToInfo(SeniorChangeRequest request) {
.etcPostgradu(true)
.etcField(true)
.totalInfo(request.major() + request.lab() + request.field()
+ request.professor() + request.postgradu() + request.keyword());
+ request.professor() + request.postgradu() + request.keyword() + user.getNickName());

for (String field : fields) {
if (fieldNames.contains(field)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class Info {
@Column(nullable = false, columnDefinition = "TEXT")
private String totalInfo; // 모든 Info정보 String으로 가지는 컬럼 - 검색시 사용

protected void updateMyPage(SeniorMyPageProfileRequest request) {
protected void updateMyPage(String nickName, SeniorMyPageProfileRequest request) {
String[] fileds = request.field().split(",");
Set<String> fieldNames = Field.fieldNames();
this.keyword = request.keyword();
Expand All @@ -59,10 +59,10 @@ protected void updateMyPage(SeniorMyPageProfileRequest request) {
}
this.etcField = true;
}
combineTotalInfo();
combineTotalInfo(nickName);
}

private void combineTotalInfo() {
this.totalInfo = major + lab + field + professor + postgradu + keyword;
private void combineTotalInfo(String nickName) {
this.totalInfo = major + lab + field + professor + postgradu + keyword + nickName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void updateProfile(Profile profile) {
}

public void updateInfo(SeniorMyPageProfileRequest myPageProfileRequest) {
this.info.updateMyPage(myPageProfileRequest);
this.info.updateMyPage(this.user.getNickName(), myPageProfileRequest);
}

public void updateCertification(String certification) {
Expand Down

0 comments on commit 26f9464

Please sign in to comment.