chore : deploy 수정
SpecialSource Backend CI/CD / build-and-deploy (push) Successful in 1m5s

This commit is contained in:
2026-08-12 10:56:41 +09:00
parent 53f28e2f09
commit d7547a1028
4 changed files with 32 additions and 2 deletions
@@ -26,6 +26,15 @@ public class ScrapedPostQueryService {
return page.map(ScrapedPostResponse::from);
}
public Page<ScrapedPostResponse> getViewedPosts(String boardKey, Pageable pageable) {
// 조회한(viewedAt != null) 글만 최근 읽은 순으로 보여준다.
Page<ScrapedPost> page = (boardKey == null || boardKey.isBlank())
? scrapedPostRepository.findByViewedAtIsNotNullOrderByViewedAtDesc(pageable)
: scrapedPostRepository.findByBoardKeyAndViewedAtIsNotNullOrderByViewedAtDesc(boardKey, pageable);
return page.map(ScrapedPostResponse::from);
}
@Transactional
public void markViewed(Long id) {
ScrapedPost post = scrapedPostRepository.findById(id)
@@ -18,7 +18,8 @@ public record ScrapedPostResponse(
Integer likeCount,
String content,
List<String> imageUrls,
LocalDateTime scrapedAt
LocalDateTime scrapedAt,
LocalDateTime viewedAt
) {
public static ScrapedPostResponse from(ScrapedPost post) {
List<String> imageUrls = (post.getImageUrls() == null || post.getImageUrls().isBlank())
@@ -38,7 +39,8 @@ public record ScrapedPostResponse(
post.getLikeCount(),
post.getContent(),
imageUrls,
post.getScrapedAt()
post.getScrapedAt(),
post.getViewedAt()
);
}
}