Skip to content

Commit

Permalink
feat: 응답에 cursorId 포함 (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdkdhoho committed Feb 8, 2024
1 parent 2dece8d commit df81ed4
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
public record FollowersResponse(
List<FollowerInfo> followers,
int totalCount,
Long cursorId,
boolean hasNext
) {

public static FollowersResponse of(List<User> users, int totalCount, boolean hasNext) {
return FollowersResponse.builder()
.followers(FollowerInfo.toList(users))
.totalCount(totalCount)
.cursorId(users.get(users.size() - 1).getId())
.hasNext(hasNext)
.build();
}
Expand Down

0 comments on commit df81ed4

Please sign in to comment.