From 3a00f2390cef16a77b3e076c9d501313331853d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=9D=B8=ED=99=94?= Date: Sun, 23 Nov 2025 16:13:53 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=95=A8=EB=B2=94=20=EC=95=84=EC=9D=B4?= =?UTF-8?q?=ED=85=9C=20=EC=A0=84=EC=B2=B4=20=EC=A1=B0=ED=9A=8C=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/album/controller/AlbumController.java | 5 ++--- .../album/dto/response/AlbumPhotoItemsResponse.java | 13 ++++++++----- .../album/repository/AlbumPhotoRepository.java | 4 +--- .../domain/album/service/AlbumService.java | 5 +++-- 4 files changed, 14 insertions(+), 13 deletions(-) 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); }