RED-3813: image similarity hotifx #685
@ -34,6 +34,14 @@ public class ImageSimilaritySearchController implements ImageSimilaritySearchRes
|
||||
public ResponseEntity<ImageSimilaritySearchResponse> getSimilarImages(@RequestBody ImageSimilaritySearchRequest imageSimilaritySearchRequest) {
|
||||
|
||||
log.info("received similiar image search request {}", imageSimilaritySearchRequest);
|
||||
if (imageSimilaritySearchRequest.getAnnotationId() == null || imageSimilaritySearchRequest.getScope() == null || (imageSimilaritySearchRequest.getScope().getFileId()
|
||||
== null
|
||||
&& imageSimilaritySearchRequest.getScope().getTemplateId()
|
||||
== null
|
||||
&& imageSimilaritySearchRequest.getScope().getDossierId()
|
||||
== null)) {
|
||||
return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
List<ImageDocument> similarImages = this.imageSimilarityService.findSimilarImages(imageSimilaritySearchRequest.getAnnotationId(),
|
||||
imageSimilaritySearchRequest.getDistance(),
|
||||
imageSimilaritySearchRequest.getScope());
|
||||
|
||||
@ -21,7 +21,7 @@ public interface ImageSimilaritySearchResource {
|
||||
|
||||
@ResponseStatus(value = HttpStatus.OK)
|
||||
@Operation(summary = "Gets similiar images to given image", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "404", description = "Not found")})
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "404", description = "Not found"), @ApiResponse(responseCode = "400", description = "Bad request: missing parameter")})
|
||||
@PostMapping(value = IMAGE_SIMILARITY_SEARCH_PATH, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
ResponseEntity<ImageSimilaritySearchResponse> getSimilarImages(@RequestBody ImageSimilaritySearchRequest imageSimilaritySearchRequest);
|
||||
|
||||
|
||||
@ -59,9 +59,9 @@ public final class ActionRoles {
|
||||
public static final String READ_GENERAL_CONFIGURATION = "red-read-general-configuration";
|
||||
public static final String WRITE_GENERAL_CONFIGURATION = "red-write-general-configuration";
|
||||
|
||||
// IMAGE SIMILIARITY SEARCH
|
||||
// IMAGE SIMILARITY SEARCH
|
||||
|
||||
public static final String GET_SIMILAR_IMAGES = "red-get-similiar-images";
|
||||
public static final String GET_SIMILAR_IMAGES = "red-get-similar-images";
|
||||
|
||||
// Preferences
|
||||
public static final String MANAGE_USER_PREFERENCES = "red-manage-user-preferences";
|
||||
|
||||
@ -32,6 +32,7 @@ import static com.iqser.red.service.persistence.management.v1.processor.roles.Ac
|
||||
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.GET_HIGHLIGHTS;
|
||||
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.GET_REPORT_TEMPLATES;
|
||||
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.GET_RSS;
|
||||
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.GET_SIMILAR_IMAGES;
|
||||
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.GET_TENANTS;
|
||||
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.IMPORT_FILES;
|
||||
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.MANAGE_ACL_PERMISSIONS;
|
||||
@ -149,8 +150,7 @@ public final class ApplicationRoles {
|
||||
DOWNLOAD_REDACTION_PREVIEW_FILE,
|
||||
DOWNLOAD_REPORT_TEMPLATE,
|
||||
EXCLUDE_INCLUDE_FILE,
|
||||
EXCLUDE_INCLUDE_PAGES,
|
||||
GET_REPORT_TEMPLATES,
|
||||
EXCLUDE_INCLUDE_PAGES, GET_REPORT_TEMPLATES, GET_SIMILAR_IMAGES,
|
||||
MANAGE_USER_PREFERENCES,
|
||||
MANAGE_VIEWED_PAGES,
|
||||
PROCESS_DOWNLOAD,
|
||||
@ -201,8 +201,7 @@ public final class ApplicationRoles {
|
||||
DELETE_DICTIONARY_TYPE,
|
||||
DELETE_REPORT_TEMPLATE,
|
||||
DOWNLOAD_REPORT_TEMPLATE,
|
||||
GET_REPORT_TEMPLATES,
|
||||
MANAGE_USER_PREFERENCES,
|
||||
GET_REPORT_TEMPLATES, MANAGE_USER_PREFERENCES, GET_SIMILAR_IMAGES,
|
||||
READ_COLORS,
|
||||
READ_DICTIONARY_TYPES,
|
||||
READ_DIGITAL_SIGNATURE,
|
||||
@ -242,8 +241,7 @@ public final class ApplicationRoles {
|
||||
public static final Set<String> RED_USER_ADMIN_ACTION_ROLES = Sets.newHashSet(MANAGE_USER_PREFERENCES,
|
||||
READ_ALL_USERS,
|
||||
READ_APP_CONFIG,
|
||||
READ_GENERAL_CONFIGURATION,
|
||||
READ_GENERAL_CONFIGURATION,
|
||||
READ_GENERAL_CONFIGURATION, READ_GENERAL_CONFIGURATION, GET_SIMILAR_IMAGES,
|
||||
READ_NOTIFICATIONS,
|
||||
READ_USERS,
|
||||
UPDATE_MY_PROFILE,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user