@@ -376,24 +376,6 @@ public class ApiController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/protect/{fileId}")
|
|
||||||
public ResponseEntity<?> protect( @PathVariable(required = false) String fileId) {
|
|
||||||
Optional<FileEntity> optionalFileEntity = fileEntityRepository.findById(fileId);
|
|
||||||
|
|
||||||
if (!optionalFileEntity.isPresent()) {
|
|
||||||
return ResponseEntity.notFound().build();
|
|
||||||
}
|
|
||||||
FileEntity fileEntity = optionalFileEntity.get();
|
|
||||||
FileProtector.FileInfo fileInfo = fileUtil.createFileInfo(fileEntity);
|
|
||||||
|
|
||||||
noCopyFileService.addFile(fileInfo);
|
|
||||||
|
|
||||||
fileEntity.setProtectionStatus(ProtectionStatus.PROCESSING);
|
|
||||||
fileEntityRepository.save(fileEntity);
|
|
||||||
|
|
||||||
return ResponseEntity.ok().build();
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/check/{fileId}/{type}")
|
@GetMapping("/check/{fileId}/{type}")
|
||||||
public ResponseEntity<?> check(@PathVariable(required = false) String fileId,
|
public ResponseEntity<?> check(@PathVariable(required = false) String fileId,
|
||||||
@PathVariable(required = false) String type) {
|
@PathVariable(required = false) String type) {
|
||||||
|
|||||||
Reference in New Issue
Block a user