DM-285: add internal component controller
This commit is contained in:
parent
ea24d26fb8
commit
8fa082f7a0
@ -0,0 +1,28 @@
|
|||||||
|
package com.iqser.red.service.persistence.v1.internal.api.controller;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.iqser.red.service.persistence.management.v1.processor.service.ComponentLogService;
|
||||||
|
import com.iqser.red.service.persistence.service.v1.api.internal.resources.InternalComponentResource;
|
||||||
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.componentlog.ComponentLog;
|
||||||
|
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.experimental.FieldDefaults;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
|
||||||
|
public class InternalComponentController implements InternalComponentResource {
|
||||||
|
|
||||||
|
ComponentLogService componentLogService;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ComponentLog getComponentLog(String dossierId, String fileId, boolean includeOverrides) {
|
||||||
|
|
||||||
|
return componentLogService.getComponentLog(dossierId, fileId, includeOverrides);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package com.iqser.red.service.persistence.service.v1.api.internal.resources;
|
||||||
|
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||||
|
|
||||||
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.componentlog.ComponentLog;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
|
|
||||||
|
@ResponseStatus(value = HttpStatus.OK)
|
||||||
|
public interface InternalComponentResource {
|
||||||
|
|
||||||
|
String COMPONENT_LOG_PATH = InternalApi.BASE_PATH + "/componentLog";
|
||||||
|
|
||||||
|
String DOSSIER_ID = "dossierId";
|
||||||
|
String DOSSIER_ID_PATH_VARIABLE = "/{" + DOSSIER_ID + "}";
|
||||||
|
|
||||||
|
String FILE_ID = "fileId";
|
||||||
|
|
||||||
|
String FILE_ID_PATH_VARIABLE = "/{" + FILE_ID + "}";
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(value = COMPONENT_LOG_PATH + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
@Operation(summary = "Gets the component log for a fileId", description = "None")
|
||||||
|
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "400", description = "Request contains error."), @ApiResponse(responseCode = "404", description = "The component log is not found.")})
|
||||||
|
ComponentLog getComponentLog(@PathVariable(DOSSIER_ID) String dossierId,
|
||||||
|
@PathVariable(FILE_ID) String fileId,
|
||||||
|
@RequestParam(name = "includeOverrides", defaultValue = "true") boolean includeOverrides);
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user