Skip to content

Commit

Permalink
Merge pull request #352 from TEAM-LIAISON/local_dev
Browse files Browse the repository at this point in the history
fix : search team member desc error
  • Loading branch information
oznchex authored Jul 25, 2024
2 parents dbec18a + 35371bb commit e2e5964
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 32 deletions.
29 changes: 19 additions & 10 deletions src/docs/asciidoc/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ <h4 id="_응답"><a class="link" href="#_응답">응답</a></h4>
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Set-Cookie: refresh-token=refreshToken; Path=/; Max-Age=604800; Expires=Thu, 1 Aug 2024 06:24:01 GMT; Secure; HttpOnly; SameSite=None
Set-Cookie: refresh-token=refreshToken; Path=/; Max-Age=604800; Expires=Thu, 1 Aug 2024 12:17:19 GMT; Secure; HttpOnly; SameSite=None
Content-Type: application/json;charset=UTF-8
Content-Length: 136

Expand Down Expand Up @@ -2175,13 +2175,13 @@ <h4 id="_응답_8"><a class="link" href="#_응답_8">응답</a></h4>
},
"completionResponse" : {
"completion" : "100.0",
"awards" : true,
"profileSkill" : true,
"profileTeamBuildingField" : true,
"profileRegion" : true,
"introduction" : true,
"antecedents" : true,
"education" : true,
"profileSkill" : true,
"awards" : true,
"attach" : true
},
"profileIntroductionResponse" : {
Expand Down Expand Up @@ -3308,12 +3308,12 @@ <h4 id="_응답_9"><a class="link" href="#_응답_9">응답</a></h4>
},
"teamCompletionResponse" : {
"teamCompletion" : "100.0",
"history" : true,
"activity" : true,
"teamMemberAnnouncement" : true,
"teamIntroduction" : true,
"teamMemberIntroduction" : true,
"teamAttach" : true,
"activity" : true,
"history" : true,
"teamProfileTeamBuildingField" : true
},
"teamProfileTeamBuildingFieldResponse" : {
Expand Down Expand Up @@ -5308,13 +5308,13 @@ <h4 id="_응답_14"><a class="link" href="#_응답_14">응답</a></h4>
},
"completionResponse" : {
"completion" : "100.0",
"awards" : true,
"profileSkill" : true,
"profileTeamBuildingField" : true,
"profileRegion" : true,
"introduction" : true,
"antecedents" : true,
"education" : true,
"profileSkill" : true,
"awards" : true,
"attach" : true
},
"profileIntroductionResponse" : {
Expand Down Expand Up @@ -5743,12 +5743,12 @@ <h4 id="_응답_15"><a class="link" href="#_응답_15">응답</a></h4>
},
"teamCompletionResponse" : {
"teamCompletion" : "100.0",
"history" : true,
"activity" : true,
"teamMemberAnnouncement" : true,
"teamIntroduction" : true,
"teamMemberIntroduction" : true,
"teamAttach" : true,
"activity" : true,
"history" : true,
"teamProfileTeamBuildingField" : true
},
"teamProfileTeamBuildingFieldResponse" : {
Expand Down Expand Up @@ -6336,9 +6336,10 @@ <h3 id="_10_5_내가_받은_매칭_조회"><a class="link" href="#_10_5_내가_
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 1277
Content-Length: 1353

[ {
"profileId" : 1,
"receivedMatchingId" : 1,
"miniProfileImg" : "https://image.linkit.im/images/linkit_logo.png",
"senderName" : "김동혁",
Expand All @@ -6348,6 +6349,7 @@ <h3 id="_10_5_내가_받은_매칭_조회"><a class="link" href="#_10_5_내가_
"matchingType" : "PROFILE",
"receivedTeamProfile" : false
}, {
"profileId" : 2,
"receivedMatchingId" : 2,
"miniProfileImg" : "https://image.linkit.im/images/linkit_logo.png",
"senderName" : "권동민",
Expand All @@ -6357,6 +6359,7 @@ <h3 id="_10_5_내가_받은_매칭_조회"><a class="link" href="#_10_5_내가_
"matchingType" : "PROFILE",
"receivedTeamProfile" : false
}, {
"profileId" : 3,
"receivedMatchingId" : 1,
"miniProfileImg" : "https://image.linkit.im/images/linkit_logo.png",
"senderName" : "링킷",
Expand All @@ -6366,6 +6369,7 @@ <h3 id="_10_5_내가_받은_매칭_조회"><a class="link" href="#_10_5_내가_
"matchingType" : "TEAM_PROFILE",
"receivedTeamProfile" : true
}, {
"profileId" : 4,
"receivedMatchingId" : 2,
"miniProfileImg" : "https://image.linkit.im/images/linkit_logo.png",
"senderName" : "링컬쳐",
Expand All @@ -6392,6 +6396,11 @@ <h3 id="_10_5_내가_받은_매칭_조회"><a class="link" href="#_10_5_내가_
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>[].profileId</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Number</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">miniProfileId / teamMiniProfileId &#8594; senderType에 따라 프론트에서 처리 바람</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>[].receivedMatchingId</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Number</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">내 이력서/팀 소개서에 매칭 PK ID</p></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,17 @@ public static MiniProfile of(
null
);
}


public void update(
final Profile profile,
final String profileTitle,
final String miniProfileImageUrl,
final Boolean isActivate
) {
this.profile = profile;
this.profileTitle = profileTitle;
this.miniProfileImg = miniProfileImageUrl;
this.isActivate = isActivate;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public ResponseEntity<Void> createMiniProfile(
return ResponseEntity.status(HttpStatus.CREATED).build();
}


@PostMapping("/mini-profile/update")
@MemberOnly
public ResponseEntity<Void> updateMiniProfile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,59 +307,47 @@ public void update(
miniProfileKeywordRepository.deleteAllByMiniProfileId(miniProfile.getId());
log.info("miniProfileImage != null case : 기존 미니프로필 키워드 삭제 완료");

miniProfileRepository.deleteByProfileId(profile.getId());
profile.updateIsMiniProfile(false);

log.info("miniProfileImage != null case : 기존 미니프로필 객체 삭제 완료");
// miniProfileRepository.deleteByProfileId(profile.getId());
// profile.updateIsMiniProfile(false);
//
// log.info("miniProfileImage != null case : 기존 미니프로필 객체 삭제 완료");

// 미니 프로필 이미지를 s3 저장 -> 해당 이미지 URL을 받아옴
final String miniProfileImageUrl = saveImage(miniProfileImage);

final MiniProfile newMiniProfileByImage = MiniProfile.of(
miniProfile.update(
profile,
miniProfileRequest.getProfileTitle(),
miniProfileImageUrl,
miniProfileRequest.getIsActivate()
);

// 미니 프로필 저장된 객체
final MiniProfile savedMiniProfile = miniProfileRepository.save(newMiniProfileByImage);

final List<MiniProfileKeyword> miniProfileKeywordList = miniProfileRequest.getMyKeywordNames().stream()
.map(keyWordName -> new MiniProfileKeyword(null, savedMiniProfile, keyWordName))
.map(keyWordName -> new MiniProfileKeyword(null, miniProfile, keyWordName))
.toList();

miniProfileKeywordRepository.saveAll(miniProfileKeywordList);
profile.updateIsMiniProfile(true);
} else {
log.info("요청 객체의 miniProfileImage가 null입니다.");

// 기존 미니 프로필 조회
final MiniProfile miniProfile = getMiniProfile(profile.getId());

// 새로운 미니 프로필 이미지 객체 생성
final MiniProfile newMiniProfileNoImage = MiniProfile.of(
miniProfile.update(
profile,
miniProfileRequest.getProfileTitle(),
miniProfile.getMiniProfileImg(),
miniProfileRequest.getIsActivate()
);

miniProfileKeywordRepository.deleteAllByMiniProfileId(miniProfile.getId());
miniProfileRepository.deleteByProfileId(profile.getId());
profile.updateIsMiniProfile(false);
log.info("저장되어 있었던 미니 프로필 객체가 삭제 되었습니다.");

final MiniProfile savedMiniProfile = miniProfileRepository.save(newMiniProfileNoImage);
final List<MiniProfileKeyword> miniProfileKeywordList = miniProfileRequest.getMyKeywordNames().stream()
.map(keyWordName -> new MiniProfileKeyword(null, savedMiniProfile, keyWordName))
.map(keyWordName -> new MiniProfileKeyword(null, miniProfile, keyWordName))
.toList();

miniProfileKeywordRepository.saveAll(miniProfileKeywordList);
profile.updateIsMiniProfile(true);
// 미니 프로필 이미지와 미니 프로필 객체의 키워드가 저장됨
}



}
}

0 comments on commit e2e5964

Please sign in to comment.