Updated Application Evaluation API to return single object response instead of array
This commit is contained in:
@@ -39,21 +39,17 @@ public interface ApplicationEvaluationApi {
|
||||
@Parameter(required = true) @PathVariable("assignedApplicationsId") Long assignedApplicationsId,
|
||||
@Parameter( required = true) @Valid @RequestBody ApplicationEvaluationRequest evaluationRequest);
|
||||
|
||||
@Operation(
|
||||
summary = "API to get ApplicationEvaluation data for evaluation process",
|
||||
@Operation(summary = "API to get ApplicationEvaluation data for evaluation process",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) }))
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) }))
|
||||
})
|
||||
@GetMapping(value = "/application", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
ResponseEntity<Response<List<ApplicationEvaluationResponse>>> getApplicationEvaluationByApplicationId(
|
||||
ResponseEntity<Response<ApplicationEvaluationResponse>> getApplicationEvaluationByApplicationId(
|
||||
HttpServletRequest request,
|
||||
@Parameter(required = false) @RequestParam(value = "applicationId", required = false) Long applicationId,
|
||||
@Parameter(required = false) @RequestParam(value = "assignedApplicationId", required = false) Long assignedApplicationId);
|
||||
|
||||
@Parameter( required = false) @RequestParam(value = "assignedApplicationId", required = false) Long assignedApplicationId);
|
||||
@Operation(summary = "API to delete ApplicationEvaluation",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
|
||||
@@ -38,14 +38,13 @@ public class ApplicationEvaluationApiController implements ApplicationEvaluation
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<List<ApplicationEvaluationResponse>>> getApplicationEvaluationByApplicationId(
|
||||
public ResponseEntity<Response<ApplicationEvaluationResponse>> getApplicationEvaluationByApplicationId(
|
||||
HttpServletRequest request, Long applicationId, Long assignedApplicationId) {
|
||||
|
||||
List<ApplicationEvaluationResponse> responseList =
|
||||
applicationEvaluationService.getApplicationEvaluationByApplicationId(request, applicationId, assignedApplicationId);
|
||||
|
||||
ApplicationEvaluationResponse response = null;
|
||||
response = applicationEvaluationService.getApplicationEvaluationByApplicationId(request, applicationId,assignedApplicationId);
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(responseList, Status.SUCCESS, Translator.toLocale(GepafinConstant.EVALUATION_FETCHED_SUCCESSFULLY)));
|
||||
.body(new Response<>(response, Status.SUCCESS, Translator.toLocale(GepafinConstant.EVALUATION_FETCHED_SUCCESSFULLY)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user