Skip to content

Commit

Permalink
GRAD2-2817
Browse files Browse the repository at this point in the history
TVR Delete Process - Backend Changes Endpoints
  • Loading branch information
arybakov-cgi committed Aug 21, 2024
1 parent 8f362e5 commit 7f8269f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -486,15 +486,18 @@ public ResponseEntity<String> launchRegenerateSchoolReports(@RequestBody Student
@PreAuthorize(PermissionsConstants.RUN_GRAD_ALGORITHM)
@Operation(summary = "Re-Generate Student Reports for the given batchJobId", description = "Re-Generate Student Reports for the given batchJobId", tags = { "RE-RUN" })
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"),@ApiResponse(responseCode = "500", description = "Internal Server Error")})
public ResponseEntity<String> launchRegenerateStudentReports(@RequestBody StudentSearchRequest searchRequest, @RequestParam String reportType) {
public ResponseEntity<BatchJobResponse> launchRegenerateStudentReports(@RequestBody StudentSearchRequest searchRequest, @RequestParam String reportType) {
logger.info(" Re-Generating Student Reports by request for {} --------------------------------------------------------", reportType);
BatchJobResponse response = new BatchJobResponse();
try {
List<UUID> finalUUIDs = gradSchoolOfRecordFilter.filterStudents(searchRequest);
logger.info(" Number of Students [{}] ---------------------------------------------------------", finalUUIDs.size());
int numberOfReports = restUtils.processStudentReports(finalUUIDs, reportType);
return ResponseEntity.ok(numberOfReports + " student " + reportType + " reports successfully");
response.setMessage(numberOfReports + " student " + reportType + " reports successfully");
return ResponseEntity.ok(response);
} catch (Exception e) {
return ResponseEntity.status(500).body(e.getLocalizedMessage());
response.setException(e.getLocalizedMessage());
return ResponseEntity.status(500).body(response);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ public class BatchJobResponse {
private String localDownload;

private String exception;
private String message;
}

0 comments on commit 7f8269f

Please sign in to comment.