Skip to content

Commit

Permalink
Merge pull request #55 from FlouD-2024/mypage
Browse files Browse the repository at this point in the history
feat: add previous field in friendPageInfo
  • Loading branch information
Kang1221 authored Mar 17, 2024
2 parents c189915 + 8280f5d commit 163d00b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
public class MypageFriendListResponseDto {
private List<MyWaiting> waitingList;
private List<MyFriend> myFriendList;
private PageInfo frinedPageInfo;
private PageInfo pageInfo;
}
6 changes: 3 additions & 3 deletions src/main/java/floud/demo/service/MyPageService.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class MyPageService {
private final UsersRepository usersRepository;
private final GoalRepository goalRepository;
private final FriendshipRepository friendshipRepository;
private final AlarmRepository alarmRepository;
private final CommunityRepository communityRepository;


Expand Down Expand Up @@ -183,7 +182,7 @@ private MypageFriendListResponseDto findFriends(Pageable pageable, Users me){
return MypageFriendListResponseDto.builder()
.waitingList(myWaitingList)
.myFriendList(myFriendList)
.frinedPageInfo(setFriendPageInfo(acceptedFriends))
.pageInfo(setFriendPageInfo(acceptedFriends))
.build();
}

Expand Down Expand Up @@ -220,7 +219,7 @@ private PageInfo setPageInfo(Page<Community> postPage){
return PageInfo.builder()
.last(!postPage.hasNext())
.previous(postPage.hasPrevious())
.nowPage(postPage.getNumber()+1)
.nowPage(postPage.getNumber())
.totalPages(postPage.getTotalPages())
.totalElements(postPage.getTotalElements())
.build();
Expand All @@ -229,6 +228,7 @@ private PageInfo setPageInfo(Page<Community> postPage){
private PageInfo setFriendPageInfo(Page<Friendship> friendshipPage){
return PageInfo.builder()
.last(!friendshipPage.hasNext())
.previous(friendshipPage.hasPrevious())
.nowPage(friendshipPage.getNumber())
.totalPages(friendshipPage.getTotalPages())
.totalElements(friendshipPage.getTotalElements())
Expand Down

0 comments on commit 163d00b

Please sign in to comment.