diff --git a/src/main/java/kr/kro/photoliner/domain/album/controller/AlbumController.java b/src/main/java/kr/kro/photoliner/domain/album/controller/AlbumController.java index 12acd42..09249d7 100644 --- a/src/main/java/kr/kro/photoliner/domain/album/controller/AlbumController.java +++ b/src/main/java/kr/kro/photoliner/domain/album/controller/AlbumController.java @@ -70,10 +70,9 @@ public ResponseEntity deletePhoto( @GetMapping("/{albumId}/photos") public ResponseEntity getAlbumItems( - @PathVariable Long albumId, - @PageableDefault Pageable pageable + @PathVariable Long albumId ) { - return ResponseEntity.ok(albumService.getAlbumPhotoItems(albumId, pageable)); + return ResponseEntity.ok(albumService.getAlbumPhotoItems(albumId)); } @PostMapping("/{albumId}/photos") diff --git a/src/main/java/kr/kro/photoliner/domain/album/dto/response/AlbumPhotoItemsResponse.java b/src/main/java/kr/kro/photoliner/domain/album/dto/response/AlbumPhotoItemsResponse.java index ab36a6f..c3b5a54 100644 --- a/src/main/java/kr/kro/photoliner/domain/album/dto/response/AlbumPhotoItemsResponse.java +++ b/src/main/java/kr/kro/photoliner/domain/album/dto/response/AlbumPhotoItemsResponse.java @@ -3,15 +3,14 @@ import java.time.LocalDateTime; import java.util.List; import kr.kro.photoliner.domain.album.dto.AlbumPhotoItem; -import org.springframework.data.domain.Page; public record AlbumPhotoItemsResponse( List items ) { - public static AlbumPhotoItemsResponse from(Page albumPhotoViews) { + public static AlbumPhotoItemsResponse from(List albumPhotoItems) { return new AlbumPhotoItemsResponse( - albumPhotoViews.stream() + albumPhotoItems.stream() .map(InnerAlbumPhotoItem::from) .toList() ); @@ -23,7 +22,9 @@ public record InnerAlbumPhotoItem( String fileName, String filePath, String thumbnailPath, - LocalDateTime capturedDt + LocalDateTime capturedDt, + Double latitude, + Double longitude ) { public static InnerAlbumPhotoItem from(AlbumPhotoItem albumPhotoItem) { @@ -33,7 +34,9 @@ public static InnerAlbumPhotoItem from(AlbumPhotoItem albumPhotoItem) { albumPhotoItem.fileName(), albumPhotoItem.filePath(), albumPhotoItem.thumbnailPath(), - albumPhotoItem.capturedDt() + albumPhotoItem.capturedDt(), + albumPhotoItem.getLatitude(), + albumPhotoItem.getLongitude() ); } } diff --git a/src/main/java/kr/kro/photoliner/domain/album/repository/AlbumPhotoRepository.java b/src/main/java/kr/kro/photoliner/domain/album/repository/AlbumPhotoRepository.java index fd181e8..d1f3aa1 100644 --- a/src/main/java/kr/kro/photoliner/domain/album/repository/AlbumPhotoRepository.java +++ b/src/main/java/kr/kro/photoliner/domain/album/repository/AlbumPhotoRepository.java @@ -5,8 +5,6 @@ import kr.kro.photoliner.domain.album.dto.AlbumPhotoItems; import kr.kro.photoliner.domain.album.model.PhotoItem; import org.locationtech.jts.geom.Point; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; @@ -25,7 +23,7 @@ public interface AlbumPhotoRepository extends JpaRepository { inner join Photo p on p.id = pi.photoId where pi.album.id = :albumId """) - Page findByAlbumId(Long albumId, Pageable pageable); + List findByAlbumId(Long albumId); @Query(""" select new kr.kro.photoliner.domain.album.dto.AlbumPhotoItem( diff --git a/src/main/java/kr/kro/photoliner/domain/album/service/AlbumService.java b/src/main/java/kr/kro/photoliner/domain/album/service/AlbumService.java index b05b778..4b25eca 100644 --- a/src/main/java/kr/kro/photoliner/domain/album/service/AlbumService.java +++ b/src/main/java/kr/kro/photoliner/domain/album/service/AlbumService.java @@ -1,5 +1,6 @@ package kr.kro.photoliner.domain.album.service; +import java.util.List; import kr.kro.photoliner.domain.album.dto.AlbumPhotoItem; import kr.kro.photoliner.domain.album.dto.AlbumPhotoItems; import kr.kro.photoliner.domain.album.dto.request.AlbumCreateRequest; @@ -55,8 +56,8 @@ public AlbumsResponse getAlbums(Long userId, Pageable pageable) { } @Transactional(readOnly = true) - public AlbumPhotoItemsResponse getAlbumPhotoItems(Long albumId, Pageable pageable) { - Page albumPhotoItems = albumPhotoRepository.findByAlbumId(albumId, pageable); + public AlbumPhotoItemsResponse getAlbumPhotoItems(Long albumId) { + List albumPhotoItems = albumPhotoRepository.findByAlbumId(albumId); return AlbumPhotoItemsResponse.from(albumPhotoItems); }