diff --git a/src/main/java/com/umc/naoman/domain/photo/controller/PhotoController.java b/src/main/java/com/umc/naoman/domain/photo/controller/PhotoController.java index c96ed53..28e0945 100644 --- a/src/main/java/com/umc/naoman/domain/photo/controller/PhotoController.java +++ b/src/main/java/com/umc/naoman/domain/photo/controller/PhotoController.java @@ -44,7 +44,7 @@ public ResultResponse uploadPhotoList(@Valid @Req } @GetMapping("/all") - public ResultResponse getAllPhotoListByShareGroup(@RequestParam Long shareGroupId, + public ResultResponse getAllPhotoListByShareGroup(@RequestParam Long shareGroupId, @PageableDefault(sort = "createdAt", direction = Sort.Direction.DESC) Pageable pageable) { Page allPhotoListByShareGroup = photoService.getAllPhotoList(shareGroupId, pageable); return ResultResponse.of(RETRIEVE_PHOTO, photoConverter.toPhotoListInfo(allPhotoListByShareGroup)); diff --git a/src/main/java/com/umc/naoman/domain/photo/converter/PhotoConverter.java b/src/main/java/com/umc/naoman/domain/photo/converter/PhotoConverter.java index 86a661f..3a22467 100644 --- a/src/main/java/com/umc/naoman/domain/photo/converter/PhotoConverter.java +++ b/src/main/java/com/umc/naoman/domain/photo/converter/PhotoConverter.java @@ -42,17 +42,16 @@ public Photo toEntity(String photoUrl, String photoName, ShareGroup shareGroup) .build(); } - public PhotoResponse.PhotoListInfo toPhotoListInfo(Page photoList) { + public PhotoResponse.PagedPhotoInfo toPhotoListInfo(Page photoList) { List photoInfoList = photoList.stream() .map(this::toPhotoInfo) .collect(Collectors.toList()); - return PhotoResponse.PhotoListInfo.builder() + return PhotoResponse.PagedPhotoInfo.builder() .isLast(photoList.isLast()) .isFirst(photoList.isFirst()) .totalPage(photoList.getTotalPages()) .totalElements(photoList.getTotalElements()) - .listSize(photoInfoList.size()) .photoInfoList(photoInfoList) .build(); } @@ -62,7 +61,7 @@ public PhotoResponse.PhotoInfo toPhotoInfo(Photo photo) { .photoUrl(photo.getUrl()) .photoName(photo.getName()) .resizedPhotoName(convertExtension(photo.getName())) - .uploadTime(photo.getCreatedAt()) + .createdAt(photo.getCreatedAt()) .build(); } diff --git a/src/main/java/com/umc/naoman/domain/photo/dto/PhotoResponse.java b/src/main/java/com/umc/naoman/domain/photo/dto/PhotoResponse.java index bd14bf0..9d6de77 100644 --- a/src/main/java/com/umc/naoman/domain/photo/dto/PhotoResponse.java +++ b/src/main/java/com/umc/naoman/domain/photo/dto/PhotoResponse.java @@ -41,9 +41,8 @@ public static class PhotoUploadInfo { @Builder @AllArgsConstructor @NoArgsConstructor - public static class PhotoListInfo { + public static class PagedPhotoInfo { private List photoInfoList; - Integer listSize; Integer totalPage; Long totalElements; Boolean isFirst; @@ -58,6 +57,6 @@ public static class PhotoInfo { private String photoUrl; private String photoName; private String resizedPhotoName; - private LocalDateTime uploadTime; + private LocalDateTime createdAt; } }