Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ public class Content {
@Column(name = "content_url")
private String contentUrl;

@Column(name = "author_id")
private Long authorId;

@Column(name = "view_count", columnDefinition = "integer default 0")
private Integer viewCount = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ public interface ContentRepository extends JpaRepository<Content, Long> {
*/
List<Content> findByTitleContaining(String title);

/**
* 작성자 ID로 컨텐츠 목록 조회
*/
List<Content> findByAuthorId(Long authorId);

/**
* 조회수 순으로 인기 컨텐츠 조회
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,14 @@ public interface ShareStatisticsRepository extends JpaRepository<ShareStatistics
/**
* 특정 기간 내 일별 공유 추이
*/
@Query("SELECT FUNCTION('DATE', s.sharedAt) as shareDate, COUNT(s) " +
"FROM ShareStatistics s " +
"WHERE s.sharedAt BETWEEN :startDate AND :endDate " +
"GROUP BY FUNCTION('DATE', s.sharedAt) " +
"ORDER BY shareDate ASC")
@Query(value = "SELECT DATE(s.shared_at) as shareDate, COUNT(s.id) " +
"FROM share_statistics s " +
"WHERE s.shared_at BETWEEN :startDate AND :endDate " +
"GROUP BY DATE(s.shared_at) " +
"ORDER BY shareDate ASC",
nativeQuery = true)
List<Object[]> countSharesByDateBetween(
@Param("startDate") LocalDateTime startDate,
@Param("endDate") LocalDateTime endDate);

}