RED-8702: Explore document databases to store entityLog
* bugfix
This commit is contained in:
parent
d29de295a8
commit
1f9b592ac1
@ -2,6 +2,7 @@ package com.iqser.red.persistence.service.v1.external.api.impl.controller;
|
||||
|
||||
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.READ_REDACTION_LOG;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -37,7 +38,7 @@ public class EntityLogController implements EntityLogResource {
|
||||
|
||||
accessControlService.checkViewPermissionsToDossier(dossierId);
|
||||
accessControlService.validateFileResourceExistence(fileId);
|
||||
return entityLogResponseMapper.toLogResponse(entityLogService.getEntityLog(dossierId, fileId, excludedTypes, includeUnprocessed));
|
||||
return entityLogResponseMapper.toLogResponse(entityLogService.getEntityLog(dossierId, fileId, excludedTypes == null ? new ArrayList<>() : excludedTypes, includeUnprocessed));
|
||||
}
|
||||
|
||||
|
||||
@ -55,7 +56,7 @@ public class EntityLogController implements EntityLogResource {
|
||||
@PreAuthorize("hasAuthority('" + READ_REDACTION_LOG + "')")
|
||||
public EntityLogResponse getEntityLogWithEntriesOnPages(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestBody List<Integer> pageNumbers) {
|
||||
@RequestParam(value = "pageNumbers") List<Integer> pageNumbers) {
|
||||
|
||||
accessControlService.checkViewPermissionsToDossier(dossierId);
|
||||
accessControlService.validateFileResourceExistence(fileId);
|
||||
|
||||
@ -42,11 +42,11 @@ public interface EntityLogResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "400", description = "Request contains error."), @ApiResponse(responseCode = "404", description = "The dossier / file / entity log is not found.")})
|
||||
EntityLogResponse getEntityLog(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(value = "excludedType", required = false) List<String> excludedTypes,
|
||||
@RequestParam(value = "excludedTypes", required = false) List<String> excludedTypes,
|
||||
@RequestParam(value = "includeUnprocessed", required = false, defaultValue = FALSE) boolean includeUnprocessed);
|
||||
|
||||
|
||||
@PostMapping(value = ENTITY_LOG_PATH + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE + "/filtered", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@GetMapping(value = ENTITY_LOG_PATH + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE + "/filtered", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Gets the entity log for a fileId greater than the specified date", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "400", description = "Request contains error."), @ApiResponse(responseCode = "404", description = "The dossier / file / entity log is not found.")})
|
||||
EntityLogResponse getFilteredEntityLog(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@ -54,13 +54,13 @@ public interface EntityLogResource {
|
||||
@RequestBody FilteredEntityLogRequest filteredEntityLogRequest);
|
||||
|
||||
|
||||
@PostMapping(value = ENTITY_LOG_PATH + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE + "/pages", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@GetMapping(value = ENTITY_LOG_PATH + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE + "/pages", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Gets the entity log for a fileId with all entities found on the given page numbers", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "400", description = "Request contains error."), @ApiResponse(responseCode = "404", description = "The dossier / file / entity log is not found.")})
|
||||
EntityLogResponse getEntityLogWithEntriesOnPages(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody List<Integer> pageNumbers);
|
||||
EntityLogResponse getEntityLogWithEntriesOnPages(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestParam(value = "pageNumbers") List<Integer> pageNumbers);
|
||||
|
||||
|
||||
@PostMapping(value = ENTITY_LOG_PATH + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE + ANALYSIS_NUMBER_PATH_VARIABLE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@GetMapping(value = ENTITY_LOG_PATH + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE + ANALYSIS_NUMBER_PATH_VARIABLE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Gets the entity log for a fileId with all entities being analysed in or after iteration with given number", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "400", description = "Request contains error."), @ApiResponse(responseCode = "404", description = "The dossier / file / entity log is not found.")})
|
||||
EntityLogResponse getEntityLogWithEntriesAnalysedAfterIteration(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
|
||||
@ -44,7 +44,7 @@ public interface EntityLogEntryDocumentRepository extends MongoRepository<Entity
|
||||
List<EntityLogEntryDocument> findByEntityLogIdAndNotContainedOrFirstContainedByElementInList(String entityLogId, Collection<Integer> containingNodeIds);
|
||||
|
||||
|
||||
@Query("{'entityLogId' : ?0, 'positions': { $elemMatch: { 'pageNumber': { $in: ?0 } } } }")
|
||||
@Query("{'entityLogId' : ?0, 'positions': { $elemMatch: { 'pageNumber': { $in: ?1 } } } }")
|
||||
List<EntityLogEntryDocument> findByEntityLogIdAndPositionsPageNumberIn(String entityLogId, List<Integer> pageNumbers);
|
||||
|
||||
@Query(value = "{ 'entityLogId': ?0, 'type': { '$nin': ?1 } }")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user