diff --git a/src/main/java/team9502/sinchulgwinong/domain/point/dto/response/SavedPointDetailResponseDTO.java b/src/main/java/team9502/sinchulgwinong/domain/point/dto/response/SavedPointDetailResponseDTO.java index 432384e..bf4a62f 100644 --- a/src/main/java/team9502/sinchulgwinong/domain/point/dto/response/SavedPointDetailResponseDTO.java +++ b/src/main/java/team9502/sinchulgwinong/domain/point/dto/response/SavedPointDetailResponseDTO.java @@ -13,6 +13,9 @@ @AllArgsConstructor public class SavedPointDetailResponseDTO { + @Schema(description = "적립된 포인트 ID", example = "1") + private Long spId; + @Schema(description = "적립된 포인트", example = "REVIEW") private SpType type; diff --git a/src/main/java/team9502/sinchulgwinong/domain/point/dto/response/UsedPointDetailResponseDTO.java b/src/main/java/team9502/sinchulgwinong/domain/point/dto/response/UsedPointDetailResponseDTO.java index 24ae283..b933c93 100644 --- a/src/main/java/team9502/sinchulgwinong/domain/point/dto/response/UsedPointDetailResponseDTO.java +++ b/src/main/java/team9502/sinchulgwinong/domain/point/dto/response/UsedPointDetailResponseDTO.java @@ -13,6 +13,9 @@ @AllArgsConstructor public class UsedPointDetailResponseDTO { + @Schema(description = "사용된 포인트 ID", example = "1") + private Long upId; + @Schema(description = "사용된 포인트", example = "REVIEW") private UpType type; diff --git a/src/main/java/team9502/sinchulgwinong/domain/point/repository/SavedPointRepositoryCustomImpl.java b/src/main/java/team9502/sinchulgwinong/domain/point/repository/SavedPointRepositoryCustomImpl.java index 6c67b37..50d8010 100644 --- a/src/main/java/team9502/sinchulgwinong/domain/point/repository/SavedPointRepositoryCustomImpl.java +++ b/src/main/java/team9502/sinchulgwinong/domain/point/repository/SavedPointRepositoryCustomImpl.java @@ -19,9 +19,9 @@ public List findSavedPointsWithCursor(Long pointId, Long cursorId, i .selectFrom(qSavedPoint) .where( qSavedPoint.point.pointId.eq(pointId) - .and(qSavedPoint.spId.lt(cursorId)) + .and(qSavedPoint.spId.gt(cursorId)) ) - .orderBy(qSavedPoint.spId.desc()) + .orderBy(qSavedPoint.spId.asc()) .limit(limit) .fetch(); } diff --git a/src/main/java/team9502/sinchulgwinong/domain/point/repository/UsedPointRepositoryCustomImpl.java b/src/main/java/team9502/sinchulgwinong/domain/point/repository/UsedPointRepositoryCustomImpl.java index 2fc3a10..aa9c549 100644 --- a/src/main/java/team9502/sinchulgwinong/domain/point/repository/UsedPointRepositoryCustomImpl.java +++ b/src/main/java/team9502/sinchulgwinong/domain/point/repository/UsedPointRepositoryCustomImpl.java @@ -19,9 +19,9 @@ public List findUsedPointsWithCursor(Long pointId, Long cursorId, int .selectFrom(qUsedPoint) .where( qUsedPoint.point.pointId.eq(pointId) - .and(qUsedPoint.upId.lt(cursorId)) + .and(qUsedPoint.upId.gt(cursorId)) ) - .orderBy(qUsedPoint.upId.desc()) + .orderBy(qUsedPoint.upId.asc()) .limit(limit) .fetch(); } diff --git a/src/main/java/team9502/sinchulgwinong/domain/point/service/PointService.java b/src/main/java/team9502/sinchulgwinong/domain/point/service/PointService.java index 7b5dfd2..8a7b2f5 100644 --- a/src/main/java/team9502/sinchulgwinong/domain/point/service/PointService.java +++ b/src/main/java/team9502/sinchulgwinong/domain/point/service/PointService.java @@ -150,7 +150,11 @@ public PagedResponseDTO getSpDetails(UserDetailsImp } List dtoList = savedPoints.stream() - .map(sp -> new SavedPointDetailResponseDTO(sp.getSpType(), sp.getSpAmount(), sp.getCreatedAt().toLocalDate())) + .map(sp -> new SavedPointDetailResponseDTO( + sp.getSpId(), + sp.getSpType(), + sp.getSpAmount(), + sp.getCreatedAt().toLocalDate())) .collect(Collectors.toList()); return new PagedResponseDTO<>(dtoList, hasNextPage); @@ -172,7 +176,11 @@ public PagedResponseDTO getUpDetails(UserDetailsImpl } List dtoList = usedPoints.stream() - .map(up -> new UsedPointDetailResponseDTO(up.getUpType(), up.getUpAmount(), up.getCreatedAt().toLocalDate())) + .map(up -> new UsedPointDetailResponseDTO( + up.getUpId(), + up.getUpType(), + up.getUpAmount(), + up.getCreatedAt().toLocalDate())) .collect(Collectors.toList()); return new PagedResponseDTO<>(dtoList, hasNextPage); @@ -183,7 +191,11 @@ public List getPublicLatestBannerUsage() { List usedPoints = usedPointRepository.findTop3ByUpTypeOrderByCreatedAtDesc(UpType.BANNER, PageRequest.of(0, 3)); return usedPoints.stream() - .map(up -> new UsedPointDetailResponseDTO(up.getUpType(), up.getUpAmount(), up.getCreatedAt().toLocalDate())) + .map(up -> new UsedPointDetailResponseDTO( + up.getUpId(), + up.getUpType(), + up.getUpAmount(), + up.getCreatedAt().toLocalDate())) .collect(Collectors.toList()); }