This commit is contained in:
@@ -323,6 +323,7 @@ server_name dev-workspace.not-copy.com;
|
|||||||
ssl_certificate_key /etc/letsencrypt/live/dev-workspace.not-copy.com/privkey.pem;
|
ssl_certificate_key /etc/letsencrypt/live/dev-workspace.not-copy.com/privkey.pem;
|
||||||
|
|
||||||
location /api/ {
|
location /api/ {
|
||||||
|
|
||||||
proxy_pass http://localhost:3001;
|
proxy_pass http://localhost:3001;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
|||||||
@@ -58,12 +58,6 @@ public interface FileEntityRepository extends JpaRepository<FileEntity, String>
|
|||||||
|
|
||||||
List<FileEntity> findFileByUserIdAndStatus(Long userId, FileStatus status);
|
List<FileEntity> findFileByUserIdAndStatus(Long userId, FileStatus status);
|
||||||
|
|
||||||
@Query("SELECT f FROM FileEntity f WHERE f.userId = :userId AND f.mimeType = :mimeType")
|
|
||||||
List<FileEntity> findByUserIdAndMimeType(Long userId, String mimeType);
|
|
||||||
|
|
||||||
@Query("SELECT f FROM FileEntity f WHERE f.mimeType = :mimeType")
|
|
||||||
List<FileEntity> findByMimeType(String mimeType);
|
|
||||||
|
|
||||||
@Query("SELECT f FROM FileEntity f WHERE f.mimeType = :mimeType AND f.userId IN :userIds")
|
@Query("SELECT f FROM FileEntity f WHERE f.mimeType = :mimeType AND f.userId IN :userIds")
|
||||||
List<FileEntity> findByMimeTypeAndUserIds(String mimeType, List<Long> userIds);
|
List<FileEntity> findByMimeTypeAndUserIds(String mimeType, List<Long> userIds);
|
||||||
|
|
||||||
@@ -75,7 +69,4 @@ public interface FileEntityRepository extends JpaRepository<FileEntity, String>
|
|||||||
Page<FileEntity> findByStatusIn(List<FileStatus> statuses, Pageable pageable);
|
Page<FileEntity> findByStatusIn(List<FileStatus> statuses, Pageable pageable);
|
||||||
|
|
||||||
List<FileEntity> findByUserIdAndStatusIn(Long userId, List<FileStatus> statuses);
|
List<FileEntity> findByUserIdAndStatusIn(Long userId, List<FileStatus> statuses);
|
||||||
|
|
||||||
@Query("SELECT f FROM FileEntity f WHERE f.userId = :userId AND f.status IN :statuses")
|
|
||||||
List<FileEntity> findByStatuses(Long userId, @Param("statuses") List<String> statuses);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,9 @@ public class ImageHashService {
|
|||||||
private final CloudStorageService cloudStorageService;
|
private final CloudStorageService cloudStorageService;
|
||||||
|
|
||||||
public Map<String, Long> calculateHash(Path imagePath) throws IOException {
|
public Map<String, Long> calculateHash(Path imagePath) throws IOException {
|
||||||
File file = cloudStorageService.readFileFromStorageByPath(imagePath.toString());
|
// File file = cloudStorageService.readFileFromStorageByPath(imagePath.toString());
|
||||||
|
File file = imagePath.toFile();
|
||||||
|
|
||||||
|
|
||||||
PHash pHash = PerceptualHashHelper.INSTANCE.generateDCTPerceptualHash(file);
|
PHash pHash = PerceptualHashHelper.INSTANCE.generateDCTPerceptualHash(file);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user