dev add violation notion
Test Workflow / test (push) Successful in 9s

This commit is contained in:
vladp
2026-03-17 16:35:27 +07:00
parent 15d1824757
commit f1e0f9594e
10 changed files with 549 additions and 2 deletions
@@ -0,0 +1,24 @@
package ru.soune.nocopy.repository;
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.violation.ViolationNotion;
import java.util.List;
@Repository
public interface ViolationNotionRepository extends JpaRepository<ViolationNotion, Long> {
@Query("SELECT vn FROM ViolationNotion vn " +
"JOIN FETCH vn.user " +
"WHERE vn.file.id = :fileId " +
"ORDER BY vn.createdAt DESC")
List<ViolationNotion> findByFileId(@Param("fileId") String fileId);
@Query("SELECT COUNT(vn) FROM ViolationNotion vn WHERE vn.file.id = :fileId")
long countByFileId(@Param("fileId") String fileId);
void deleteByFileId(String fileId);
}