Skip to content

Commit

Permalink
Merge pull request #54 from Kusitms-29th-Meetup-TeamE/feat/53/experience
Browse files Browse the repository at this point in the history
Fix: 배움나누기 목록 조회 api 수정
  • Loading branch information
nohy6630 authored May 19, 2024
2 parents 0c9cc8e + 1f48517 commit ef94b84
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public void updateLastAppointment() {
));
directChatRoom.setLastAppointment(directChatRoom.getNextAppointment());
directChatRoom.setNextAppointment(null);
directChatRoom.getExperience().incrementReviewCount();
}
reviewRepository.saveAll(reviews);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
@Getter
@Builder
public class ExperienceRes {
private Long id;
private String type;
private String title;
private String imageUrl;
private String name;
private Long age;
Expand All @@ -18,7 +20,9 @@ public class ExperienceRes {

public static ExperienceRes of(Experience experience) {
return ExperienceRes.builder()
.id(experience.getId())
.type(experience.getType().getDescription())
.title(experience.getDescription())
.imageUrl(experience.getUser().getImageUrl())
.name(experience.getUser().getName())
.age(experience.getUser().getAge())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,8 @@ public static Experience of(MyExperienceReq req, User user) {
.reviewCount(0L)
.build();
}

public void incrementReviewCount() {
this.reviewCount++;
}
}

0 comments on commit ef94b84

Please sign in to comment.