Skip to content

Commit

Permalink
fix : 광고 조회시 업로드일자 기준으로 조회하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
tlarbals824 committed Mar 9, 2024
1 parent 8f04ea2 commit 598ea61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public Page<Advertisement> findSavedAllByUserId(Pageable pageable, Long userId)
public Page<Advertisement> findAllWithKeyword(Pageable pageable, List<String> keywordList, OrderType orderType) {
if(Objects.isNull(keywordList)||keywordList.isEmpty()){
if(orderType.equals(OrderType.RECENT)){
return advertisementJpaRepository.findAll(pageable)
return advertisementJpaRepository.findAllOrderByUploadDateDesc(pageable)
.map(advertiseMapper::toDomain);
}
if(orderType.equals(OrderType.POPULAR)){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,11 @@ having count(distinct ak.keyword) = :keywordSize
where ae.id = :advertiseId
""")
void updateViewCount(Long advertiseId);

@Query("""
select ae
from AdvertisementEntity ae
order by ae.uploadDate desc
""")
Page<AdvertisementEntity> findAllOrderByUploadDateDesc(Pageable pageable);
}

0 comments on commit 598ea61

Please sign in to comment.