Skip to content

Commit

Permalink
fix: 해시태그를 설정하지 않은 이미지도 조회되도록 수정 (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
ht3064 authored Jul 7, 2024
1 parent 7802090 commit a8e3368
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import static com.api.pickle.domain.image.domain.QImage.image;
import static com.api.pickle.domain.imagetag.domain.QImageTag.imageTag;
import static com.api.pickle.domain.tag.domain.QTag.tag;

@RequiredArgsConstructor
public class ImageRepositoryImpl implements ImageRepositoryCustom{
Expand All @@ -35,14 +36,16 @@ public List<Image> findByImageUrls(List<String> imageUrl) {
public Slice<FetchAlbumImagesResponse> findAllImagesByCreatedDateDesc(Long albumId, int pageSize, Long lastImageId) {
List<FetchAlbumImagesResponse> results = queryFactory
.select(new QFetchAlbumImagesResponse(
imageTag.image.id,
imageTag.tag.name,
imageTag.image.imageUrl
image.id,
tag.name,
image.imageUrl
))
.from(imageTag)
.from(image)
.leftJoin(imageTag).on(image.id.eq(imageTag.image.id))
.leftJoin(tag).on(tag.id.eq(imageTag.tag.id))
.where(lastImageId(lastImageId),
imageTag.image.album.id.eq(albumId))
.orderBy(imageTag.image.createdDate.desc())
image.album.id.eq(albumId))
.orderBy(image.createdDate.desc())
.limit(pageSize + 1)
.fetch();

Expand Down

0 comments on commit a8e3368

Please sign in to comment.