From c32ec5bb46bdd08a64a39f4cb326bcc6821ef40a Mon Sep 17 00:00:00 2001 From: yang Date: Fri, 12 Apr 2024 21:54:32 +0900 Subject: [PATCH] =?UTF-8?q?RAC-341=20fix=20:=20=EC=84=A0=EB=B0=B0=20?= =?UTF-8?q?=EA=B2=80=EC=83=89=EC=8B=9C=20=EB=8B=89=EB=84=A4=EC=9E=84=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../senior/application/mapper/SeniorMapper.java | 12 ++++++------ .../domain/senior/domain/entity/Info.java | 8 ++++---- .../domain/senior/domain/entity/Senior.java | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/postgraduate/domain/senior/application/mapper/SeniorMapper.java b/src/main/java/com/postgraduate/domain/senior/application/mapper/SeniorMapper.java index 1c508608..dca2f377 100644 --- a/src/main/java/com/postgraduate/domain/senior/application/mapper/SeniorMapper.java +++ b/src/main/java/com/postgraduate/domain/senior/application/mapper/SeniorMapper.java @@ -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 fieldNames = Field.fieldNames(); Set postgraduNames = Postgradu.postgraduNames(); @@ -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)) { @@ -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 fieldNames = Field.fieldNames(); Set postgraduNames = Postgradu.postgraduNames(); @@ -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)) { diff --git a/src/main/java/com/postgraduate/domain/senior/domain/entity/Info.java b/src/main/java/com/postgraduate/domain/senior/domain/entity/Info.java index ee2dfad0..f221d537 100644 --- a/src/main/java/com/postgraduate/domain/senior/domain/entity/Info.java +++ b/src/main/java/com/postgraduate/domain/senior/domain/entity/Info.java @@ -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 fieldNames = Field.fieldNames(); this.keyword = request.keyword(); @@ -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; } } diff --git a/src/main/java/com/postgraduate/domain/senior/domain/entity/Senior.java b/src/main/java/com/postgraduate/domain/senior/domain/entity/Senior.java index 468658cc..b8090a5e 100644 --- a/src/main/java/com/postgraduate/domain/senior/domain/entity/Senior.java +++ b/src/main/java/com/postgraduate/domain/senior/domain/entity/Senior.java @@ -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) {