Merge branch 'dev' into NCBACK-33
# Conflicts: # src/main/java/ru/soune/nocopy/entity/file/ImageProtection.java # src/main/java/ru/soune/nocopy/entity/user/User.java # src/main/java/ru/soune/nocopy/handler/ImageFoundRequestHandler.java # src/main/java/ru/soune/nocopy/repository/AuthTokenRepository.java # src/main/java/ru/soune/nocopy/service/file/impl/FileUploadServiceImpl.java
This commit is contained in:
@@ -274,7 +274,7 @@ public class FileEntityHandler implements RequestHandler {
|
||||
FileEntity fileEntity = fileEntityRepository.findById(fileId)
|
||||
.orElseThrow(() -> new FileEntityNotFoundException(fileId));
|
||||
|
||||
if (fileEntity.getStatus().equals(FileStatus.DELETED)) {
|
||||
if (fileEntity.getStatus().equals(FileStatus.DELETED) || fileRequest.getFullDelete() == 1) {
|
||||
fileEntityService.deleteFromDisk(fileEntity);
|
||||
response = DeleteFileResponse.builder()
|
||||
.fileId(fileRequest.getFileId())
|
||||
|
||||
@@ -7,9 +7,12 @@ import org.springframework.stereotype.Component;
|
||||
import ru.soune.nocopy.dto.BaseRequest;
|
||||
import ru.soune.nocopy.dto.BaseResponse;
|
||||
import ru.soune.nocopy.dto.MessageCode;
|
||||
import ru.soune.nocopy.dto.file.GoogleVisionSearchResponse;
|
||||
import ru.soune.nocopy.dto.file.ImageSearchRequest;
|
||||
import ru.soune.nocopy.dto.file.YandexSearchResponse;
|
||||
import ru.soune.nocopy.service.search.YandexSearchService;
|
||||
import ru.soune.nocopy.service.GoogleVisionSearchService;
|
||||
import ru.soune.nocopy.service.YandexSearchService;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@@ -20,6 +23,8 @@ public class ImageFoundRequestHandler implements RequestHandler {
|
||||
|
||||
private final YandexSearchService yandexSearchService;
|
||||
|
||||
private final GoogleVisionSearchService googleVisionSearchService;
|
||||
|
||||
@Override
|
||||
public BaseResponse handle(BaseRequest request) throws Exception {
|
||||
ImageSearchRequest imageSearchRequest = objectMapper.convertValue(request.getMessageBody(),
|
||||
@@ -29,6 +34,9 @@ public class ImageFoundRequestHandler implements RequestHandler {
|
||||
|
||||
YandexSearchResponse response = yandexSearchService.searchByFileEntity(fileId);
|
||||
|
||||
//TODO uncommited when add billing
|
||||
// GoogleVisionSearchResponse googleVisionSearchResponse = googleVisionSearchService.searchByFileEntity(fileId);
|
||||
|
||||
return new BaseResponse(request.getMsgId(), MessageCode.SUCCESS.getCode(),
|
||||
MessageCode.SUCCESS.getDescription(), response);
|
||||
}
|
||||
|
||||
@@ -138,15 +138,6 @@ public class RegRequestValidator implements Validator {
|
||||
errors.rejectValue("password", "password.contains.spaces",
|
||||
"Password cannot contain spaces");
|
||||
}
|
||||
|
||||
// recomment if need complexity
|
||||
// checkPasswordComplexity(password, errors);
|
||||
|
||||
// reccoment if need check simply standart password
|
||||
// checkCommonPasswords(password, errors);
|
||||
|
||||
// reccoment if need check simply standart password
|
||||
// checkForSequences(password, errors);
|
||||
}
|
||||
|
||||
private void checkPasswordComplexity(String password, Errors errors) {
|
||||
|
||||
Reference in New Issue
Block a user