Skip to content

Commit

Permalink
fix: friendList Response에 totalSize 추가 (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
gunom authored Dec 23, 2023
2 parents f26a93d + 7475b1a commit 29db1a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ public ResponseEntity<FriendList> getFriendsForEachRelation(
val response = AllRelationFriendList.of(
newFriends, newFriends.size(),
bestFriends, bestFriends.size(),
soulMates, soulMates.size()
soulMates, soulMates.size(),
newFriends.size() + bestFriends.size() + soulMates.size()
);
return ResponseEntity.ok(response);
}
Expand Down
18 changes: 11 additions & 7 deletions src/main/java/org/sopt/app/presentation/poke/PokeResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,29 @@ public static class AllRelationFriendList implements FriendList{
@Schema(description = "대표 친한 친구 2명")
private List<SimplePokeProfile> newFriend;
@Schema(description = "친한 친구 수", example = "1")
private Integer newFriendSize;
private int newFriendSize;
@Schema(description = "대표 단짝 친구 2명")
private List<SimplePokeProfile> bestFriend;
@Schema(description = "단짝 친구 수", example = "1")
private Integer bestFriendSize;
private int bestFriendSize;
@Schema(description = "대표 소울메이트 친구 2명")
private List<SimplePokeProfile> soulmate;
@Schema(description = "소울메이트 친구 수", example = "1")
private Integer soulmateSize;
private int soulmateSize;
@Schema(description = "전체 친구 수", example = "1")
private int totalSize;

public static AllRelationFriendList of(
List<SimplePokeProfile> newFriend, Integer newFriendSize,
List<SimplePokeProfile> bestFriend, Integer bestFriendSize,
List<SimplePokeProfile> soulmate, Integer soulmateSize
List<SimplePokeProfile> newFriend, int newFriendSize,
List<SimplePokeProfile> bestFriend, int bestFriendSize,
List<SimplePokeProfile> soulmate, int soulmateSize,
int totalSize
) {
return new AllRelationFriendList(
newFriend, newFriendSize,
bestFriend, bestFriendSize,
soulmate, soulmateSize
soulmate, soulmateSize,
totalSize
);
}
}
Expand Down

0 comments on commit 29db1a1

Please sign in to comment.