Skip to content

Commit

Permalink
Merge pull request #73 from Kusitms-29th-Meetup-TeamE/fix/71/page-count
Browse files Browse the repository at this point in the history
Fix: 활동 페이징 처리 수정
  • Loading branch information
Jeongho427 authored May 22, 2024
2 parents fba7ade + a4c07f3 commit 47d529f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public ReadActivitiesRes findActivities(ReadActivitiesReq activitiesReq) {
.map(Personality::of)
.collect(Collectors.toList());

long pageCount = activityRepository.countActivities(agencyTypes, personalities) / ACTIVITY_PAGE_SIZE + 1; // 전체 페이지 수 계산
long pageCount = (activityRepository.countActivities(agencyTypes, personalities) + ACTIVITY_PAGE_SIZE - 1) / ACTIVITY_PAGE_SIZE; // 전체 페이지 수 계산

List<Long> likedActivityIds = activityLikeRepository.findLikedActivityIdsByUserId(userId);
Set<Long> likedActivityIdsSet = new HashSet<>(likedActivityIds);
Expand Down Expand Up @@ -100,7 +100,7 @@ public ReadActivitiesRes findlikedActivities(ReadActivitiesReq activitiesReq) {
List<Long> likedActivityIds = activityLikeRepository.findLikedActivityIdsByUserId(userId);
Set<Long> likedActivityIdsSet = new HashSet<>(likedActivityIds);

long pageCount = likedActivityIds.size() / ACTIVITY_PAGE_SIZE + 1;
long pageCount = (likedActivityIds.size() + ACTIVITY_PAGE_SIZE - 1) / ACTIVITY_PAGE_SIZE;

List<Activity> activities = activityRepository.findLikedActivities(userId, offset, limit, agencyTypes, personalities);
List<ActivitySummaryRes> activitySummaries = activities.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public class RegisterService {
/**
* 회원가입
* client에게 RegisterRequest(name,email,password,location)를 입력 받아 비밀번호 암호화 후 저장
* email, userName 중복체크는 안 할 예정
*/
public Long register(RegisterRequest request) {
String encodedPassword = encoder.encode(request.getPassword());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,4 @@ public ResponseEntity<ReadReviewsByMeRes> readReviewsByMe() {
return ResponseEntity
.ok(reviewService.readReviewsByMe());
}


// @Operation(summary = "나의 후기 보기", description = """
// 나의 후기 보기 api 입니다.
// """)
// @GetMapping("/aboutme")
// public ResponseEntity<ReadReviewsAboutMeRes> readReviewsAboutMe() {
// //todo api 작성
// return null;
//// return ResponseEntity
//// .ok(reviewService.readReviewsAboutMe());
// }
}

0 comments on commit 47d529f

Please sign in to comment.