Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #223

Merged
merged 2 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading