Skip to content

Commit 77d227d

Browse files
committed
fix: createdAt 필요없이 들어간 부분 제거
1 parent 5bd85d4 commit 77d227d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/main/java/com/moaguide/domain/ArticleContent/ArticleContentRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ public interface ArticleContentRepository extends JpaRepository<ArticleContent,
8080
"WHERE c.categoryId.categoryId = :categoryId AND c.articleId != :articleId " +
8181
"ORDER BY FUNCTION('RAND')")
8282
List<RelatedContentDto> findRelatedArticles(@Param("categoryId") Long categoryId,
83-
@Param("articleId") Long articleId,@Param("createAt") Timestamp createdAt);
83+
@Param("articleId") Long articleId);
8484

8585
// 조회수 증가
8686
@Modifying
8787
@Query("UPDATE ArticleContent a SET a.views = a.views + 1 WHERE a.articleId = :articleId")
88-
void incrementViewCount(@Param("articleId") Long articleId,@Param("createAt") Timestamp createdAt);
88+
void incrementViewCount(@Param("articleId") Long articleId);
8989
}

src/main/java/com/moaguide/service/ArticleContent/ArticleDetailService.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class ArticleDetailService {
2727
// 조회수 증가를 위한 메서드
2828
@Transactional
2929
public void incrementViews(Long articleId) {
30-
articleContentRepository.incrementViewCount(articleId,TimeServie.getNowTimestamp());
30+
articleContentRepository.incrementViewCount(articleId);
3131
}
3232

3333
public Object getArticleDetail(Long articleId, String role) {
@@ -97,8 +97,7 @@ public List<RelatedContentDto> getRelatedArticles(Long articleId) {
9797
Long categoryId = article.getCategoryId().getCategoryId();
9898

9999
// 쿼리 결과 가져오기
100-
List<RelatedContentDto> allRelatedArticles = articleContentRepository.findRelatedArticles(categoryId, articleId,
101-
TimeServie.getNowTimestamp());
100+
List<RelatedContentDto> allRelatedArticles = articleContentRepository.findRelatedArticles(categoryId, articleId);
102101

103102
// 상위 3개만 반환
104103
return allRelatedArticles.stream().limit(3).collect(Collectors.toList());

0 commit comments

Comments
 (0)