Skip to content

Commit

Permalink
fix: 우리학교 마스코트 조회 API response 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
junseokkim committed Feb 19, 2024
1 parent 19f8c33 commit 8866052
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,13 @@ public static void setRank(JoinContributionRank joinContributionRank ,Integer ne
@NoArgsConstructor
@AllArgsConstructor // 학교 마스코트
public static class joinUniversityMascot {
String universityName;
Integer level;
Long point;
Long levelUpPoint;
Integer rank;
String mascotImage;
List<String> mascotDialog;
String universityImage;

public static joinUniversityMascot setRank(joinUniversityMascot universityMascot, Integer rank) {
universityMascot.rank = rank;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,15 @@ public static List<UniversityResponse.JoinContributionRank> toJoinContributionRa

// 학교 마스코트 조회
public static UniversityResponse.joinUniversityMascot toJoinUniversityMascot(
University university, Mascot mascot
University university, Mascot mascot, Long levelUpPoint
){
return UniversityResponse.joinUniversityMascot.builder()
.universityName(university.getName())
.mascotDialog(mascot.getRandomDialogues())
.mascotImage(mascot.getImage())
.level(university.getCurrentLevel())
.point(university.getTotalPoint())
.universityImage(university.getUniversityLogo())
.levelUpPoint(levelUpPoint)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,13 @@ public UniversityResponse.JoinContributionRanks joinContributionRankingList(Memb
@Transactional(readOnly = true) //우리 대학교 마스코트 조회
public UniversityResponse.joinUniversityMascot joinUniversityMascot(Member member) {
Member memberEntity = memberService.findByMemberId(member.getId());
University university = memberEntity.getUniversity();

UniversityResponse.joinUniversityMascot universityMascot
= UniversityMapper.toJoinUniversityMascot(
memberEntity.getUniversity()
,memberEntity.getUniversity().getMascot()
university
,university.getMascot(),
(long) (university.getCurrentLevel() * 200)
);

List<University> universityRankList = universityRepository.findAllByOrderByTotalPointDesc(); //랭킹 순 정렬
Expand Down

0 comments on commit 8866052

Please sign in to comment.