Skip to content

Commit

Permalink
Merge pull request #89 from Team-Going/feature/88
Browse files Browse the repository at this point in the history
[fix] 여행 My TODO 상세 정보 조회 API 스펙 변경
  • Loading branch information
SunwoongH authored Jan 14, 2024
2 parents 47c9b2e + fbbce34 commit 28b5b7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@

@Builder(access = AccessLevel.PRIVATE)
public record MyTodoResponse(
String name,
Long participantId,
String title,
int count
) {
public static MyTodoResponse of(String name, int count) {
public static MyTodoResponse of(Long participantId, String title, int count) {
return MyTodoResponse.builder()
.name(name)
.participantId(participantId)
.title(title)
.count(count)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ public class TripDetailService {

public MyTodoResponse getMyTodoDetail(Long userId, Long tripId) {
Trip findTrip = getTrip(tripId);
List<Participant> participants = findTrip.getParticipants();
Participant ownerParticipant = getOwnerParticipant(userId, participants);
int count = getIncompleteTodoCount(userId, tripId);
return MyTodoResponse.of(findTrip.getTitle(), count);
return MyTodoResponse.of(ownerParticipant.getId(), findTrip.getTitle(), count);
}

public OurTodoResponse getOurTodoDetail(Long userId, Long tripId) {
Expand Down

0 comments on commit 28b5b7e

Please sign in to comment.