@@ -1,30 +0,0 @@
|
||||
package ru.soune.nocopy.repository;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import ru.soune.nocopy.entity.monitoring.FoundViolationEntity;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface FoundViolationRepository extends JpaRepository<FoundViolationEntity, String> {
|
||||
|
||||
List<FoundViolationEntity> findByFileIdOrderByFoundAtDesc(String fileId);
|
||||
|
||||
List<FoundViolationEntity> findByUserIdOrderByFoundAtDesc(Long userId);
|
||||
|
||||
@Query("SELECT fv FROM FoundViolationEntity fv WHERE fv.userId = :userId AND fv.isNew = true")
|
||||
List<FoundViolationEntity> findNewViolationsByUser(@Param("userId") Long userId);
|
||||
|
||||
@Query("SELECT fv FROM FoundViolationEntity fv WHERE fv.file.id = :fileId AND fv.foundUrl = :foundUrl")
|
||||
List<FoundViolationEntity> findDuplicate(@Param("fileId") String fileId, @Param("foundUrl") String foundUrl);
|
||||
|
||||
List<FoundViolationEntity> findByFoundAtBetween(LocalDateTime start, LocalDateTime end);
|
||||
|
||||
@Query("SELECT COUNT(fv) FROM FoundViolationEntity fv WHERE fv.userId = :userId AND fv.isNew = true")
|
||||
long countNewByUserId(@Param("userId") Long userId);
|
||||
}
|
||||
Reference in New Issue
Block a user