Revision 57966
Added by Ioannis Diplas over 4 years ago
MonitorController.java | ||
---|---|---|
30 | 30 |
produces = MediaType.APPLICATION_JSON_VALUE) |
31 | 31 |
@ResponseBody |
32 | 32 |
@PreAuthorize("hasRole('ROLE_USER')") |
33 |
public JobsOfUser getJobsOfUser(@RequestParam("user") @ApiParam(value = "User email", required = true) String user, |
|
34 |
@RequestParam(value = "jobType", required = false) |
|
33 |
public JobsOfUser getJobsOfUser(@RequestParam(value = "jobType", required = false) |
|
35 | 34 |
@ApiParam(value = "Equals to filter job type on validation history page") String jobType, |
36 | 35 |
@RequestParam("offset") @ApiParam(value = "Page number", required = true) String offset, |
37 | 36 |
@RequestParam(value = "limit", required = false,defaultValue = "10") @ApiParam(value = "Null value") String limit, |
... | ... | |
39 | 38 |
@RequestParam(value = "dateTo", required = false) @ApiParam(value = "Null value") String dateTo, |
40 | 39 |
@RequestParam("validationStatus") @ApiParam(value = "Equals to filter validation jobs", required = false) String validationStatus, |
41 | 40 |
@RequestParam("includeJobsTotal") @ApiParam(value = "Always true", required = true) String includeJobsTotal) throws JSONException, ValidatorServiceException { |
42 |
user = ((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail(); |
|
43 |
return monitorService.getJobsOfUser(user, jobType, offset, limit, dateFrom, dateTo, validationStatus, includeJobsTotal); |
|
41 |
return monitorService.getJobsOfUser(((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail(), jobType, offset, limit, dateFrom, dateTo, validationStatus, includeJobsTotal); |
|
44 | 42 |
} |
45 | 43 |
|
46 | 44 |
@RequestMapping(value = "/getJobsOfUserPerValidationStatus" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE) |
47 | 45 |
@ResponseBody |
48 | 46 |
@PreAuthorize("hasRole('ROLE_USER')") |
49 |
public int getJobsOfUserPerValidationStatus(@RequestBody String user, |
|
50 |
@RequestBody String jobType, |
|
47 |
public int getJobsOfUserPerValidationStatus(@RequestBody String jobType, |
|
51 | 48 |
@RequestBody String validationStatus) throws JSONException { |
52 |
user = ((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail(); |
|
53 |
return monitorService.getJobsOfUserPerValidationStatus(user, jobType, validationStatus); |
|
49 |
return monitorService.getJobsOfUserPerValidationStatus(((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail(), jobType, validationStatus); |
|
54 | 50 |
} |
55 | 51 |
|
56 | 52 |
@RequestMapping(value = "/getJobSummary" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE) |
Also available in: Unified diff
Clearing unnecessary "user" variables