Revision 50680
Added by Panagiotis Kanakakis about 6 years ago
MonitorApiImpl.java | ||
---|---|---|
3 | 3 |
import eu.dnetlib.api.functionality.ValidatorService; |
4 | 4 |
import eu.dnetlib.api.functionality.ValidatorServiceException; |
5 | 5 |
import eu.dnetlib.domain.functionality.validator.StoredJob; |
6 |
import eu.dnetlib.repo.manager.shared.Constants; |
|
6 | 7 |
import eu.dnetlib.repo.manager.shared.JobsOfUser; |
7 |
import eu.dnetlib.repo.manager.shared.Constants; |
|
8 | 8 |
import gr.uoa.di.driver.util.ServiceLocator; |
9 | 9 |
import io.swagger.annotations.ApiParam; |
10 | 10 |
import org.apache.log4j.Logger; |
11 | 11 |
import org.json.JSONException; |
12 | 12 |
import org.springframework.stereotype.Component; |
13 |
import org.springframework.web.bind.annotation.PathVariable; |
|
14 | 13 |
import org.springframework.web.bind.annotation.RequestParam; |
15 | 14 |
|
16 | 15 |
import javax.annotation.Resource; |
17 |
import java.util.Date; |
|
18 | 16 |
|
19 | 17 |
@Component |
20 | 18 |
public class MonitorApiImpl implements MonitorApi { |
... | ... | |
40 | 38 |
|
41 | 39 |
@Override |
42 | 40 |
public JobsOfUser getJobsOfUser(@RequestParam("user") @ApiParam(value = "User email", required = true) String user, |
43 |
@RequestParam("jobType") @ApiParam(value = "Equals to filter job type on validation history page", required = true) String jobType,
|
|
41 |
@RequestParam(value = "jobType", required = false) @ApiParam(value = "Equals to filter job type on validation history page") String jobType,
|
|
44 | 42 |
@RequestParam("offset") @ApiParam(value = "Page number", required = true) String offset, |
45 | 43 |
@RequestParam(value = "limit", required = false, defaultValue = "10") @ApiParam(value = "Null value") String limit, |
46 |
@RequestParam(value = "dateFrom", required = false, defaultValue = "2018-02-08") @ApiParam(value = "Null value") String dateFrom,
|
|
47 |
@RequestParam(value = "dateTo", required = false, defaultValue = "2018-02-08") @ApiParam(value = "Null value") String dateTo,
|
|
44 |
@RequestParam(value = "dateFrom", required = false) @ApiParam(value = "Null value") String dateFrom, |
|
45 |
@RequestParam(value = "dateTo", required = false) @ApiParam(value = "Null value") String dateTo, |
|
48 | 46 |
@RequestParam("validationStatus") @ApiParam(value = "Equals to filter validation jobs", required = true) String validationStatus, |
49 | 47 |
@RequestParam("includeJobsTotal") @ApiParam(value = "Always true", required = true) String includeJobsTotal) throws JSONException, ValidatorServiceException { |
50 | 48 |
|
51 | 49 |
LOGGER.debug("Getting jobs of user : " + user); |
52 | 50 |
LOGGER.debug(user + "/" + jobType + "/" + offset + "/" + dateFrom + "/" + dateTo + "/" + validationStatus + "/" + includeJobsTotal); |
53 | 51 |
JobsOfUser retJobs = new JobsOfUser(); |
52 |
LOGGER.debug("Size fo jobs list -> " + getValidationService().getStoredJobsNew(user, jobType, Integer.parseInt(offset), |
|
53 |
Integer.parseInt(limit), dateFrom, dateTo, validationStatus)); |
|
54 | 54 |
retJobs.setJobs(getValidationService().getStoredJobsNew(user, jobType, Integer.parseInt(offset), |
55 | 55 |
Integer.parseInt(limit), dateFrom, dateTo, validationStatus)); |
56 | 56 |
if (Boolean.parseBoolean(includeJobsTotal)) { |
Also available in: Unified diff
1.Bug fixes on monitor api.