Skip to content

Commit

Permalink
fix : 알림 내역 API 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
LHS-11 committed Jan 6, 2024
1 parent 92bfedb commit 084d1e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Slice;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
Expand All @@ -24,7 +24,7 @@ public class NotificationController {

@GetMapping
@Operation(summary = "유저의 알림 내역 조회 API", description = "유저의 알림 내역을 조회합니다.")
public CommonResponse<Slice<NotificationListInfoResponseDto>> findAllNotification(@AuthUser User user, @RequestParam int page, @RequestParam int size) {
public CommonResponse<Page<NotificationListInfoResponseDto>> findAllNotification(@AuthUser User user, @RequestParam int page, @RequestParam int size) {
log.info("알림 내역 조회 API, user = {}", user.getUserId());
// Sort sort = Sort.by(Sort.Direction.fromString(sortOrder), sortField);
return CommonResponse.success(notificationService.findAllNotification(user, page, size));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

import com.cmc.zenefitserver.domain.user.dao.UserRepository;
import com.cmc.zenefitserver.domain.user.domain.User;
import com.cmc.zenefitserver.domain.userpolicy.dao.UserPolicyRepository;
import com.cmc.zenefitserver.global.infra.fcm.FCMService;
import com.cmc.zenefitserver.global.infra.notification.dao.NotificationQueryRepository;
import com.cmc.zenefitserver.global.infra.notification.dao.NotificationRepository;
import com.cmc.zenefitserver.global.infra.notification.dto.NotificationListInfoResponseDto;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Slice;
import org.springframework.stereotype.Service;

import java.util.List;
Expand All @@ -26,7 +25,7 @@ public class NotificationService {
private final FCMService fcmService;


public Slice<NotificationListInfoResponseDto> findAllNotification(User user, int page, int size) {
public Page<NotificationListInfoResponseDto> findAllNotification(User user, int page, int size) {
PageRequest pageable = PageRequest.of(page, size);
return notificationQueryRepository.searchNotificationBySlice(user, pageable);
}
Expand Down

0 comments on commit 084d1e6

Please sign in to comment.