@@ -28,6 +28,16 @@ public interface DockViewRepository extends JpaRepository<DockView, Long> {
|
||||
@Query("SELECT dv FROM DockView dv WHERE dv.fileId IN :fileIds")
|
||||
Page<DockView> findAllByFileIds(@Param("fileIds") List<String> fileIds, Pageable pageable);
|
||||
|
||||
@Query("SELECT " +
|
||||
"COUNT(dv) as totalViews, " +
|
||||
"COUNT(DISTINCT dv.viewerIp) as uniqueIps, " +
|
||||
"COUNT(DISTINCT dv.viewerId) as uniqueUsers, " +
|
||||
"MAX(dv.createdAt) as lastViewDate, " +
|
||||
"MIN(dv.createdAt) as firstViewDate " +
|
||||
"FROM DockView dv " +
|
||||
"WHERE dv.fileId IN :fileIds")
|
||||
Optional<Object[]> findTotalViewsStatsByFileIds(@Param("fileIds") List<String> fileIds);
|
||||
|
||||
Page<DockView> findAllByViewerIdOrderByCreatedAtDesc(Long viewerId, Pageable pageable);
|
||||
|
||||
long countByFileId(String fileId);
|
||||
|
||||
Reference in New Issue
Block a user