1.Bug fixes on monitor api.
This commit is contained in:
parent
5eb0717179
commit
a08eee988f
|
@ -16,14 +16,14 @@ public interface MonitorApi {
|
||||||
@RequestMapping(value = "/getJobsOfUser" , method = RequestMethod.GET,
|
@RequestMapping(value = "/getJobsOfUser" , method = RequestMethod.GET,
|
||||||
produces = MediaType.APPLICATION_JSON_VALUE)
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
JobsOfUser getJobsOfUser(@RequestParam String user,
|
JobsOfUser getJobsOfUser(String user,
|
||||||
@RequestParam String jobType,
|
String jobType,
|
||||||
@RequestParam String offset,
|
String offset,
|
||||||
@RequestParam String limit,
|
String limit,
|
||||||
@RequestParam String dateFrom,
|
String dateFrom,
|
||||||
@RequestParam String dateTo,
|
String dateTo,
|
||||||
@RequestParam String validationStatus,
|
String validationStatus,
|
||||||
@RequestParam String includeJobsTotal) throws JSONException, ValidatorServiceException;
|
String includeJobsTotal) throws JSONException, ValidatorServiceException;
|
||||||
|
|
||||||
@RequestMapping(value = "/getJobsOfUserPerValidationStatus" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(value = "/getJobsOfUserPerValidationStatus" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
|
@ -3,18 +3,16 @@ package eu.dnetlib.repo.manager.service.controllers;
|
||||||
import eu.dnetlib.api.functionality.ValidatorService;
|
import eu.dnetlib.api.functionality.ValidatorService;
|
||||||
import eu.dnetlib.api.functionality.ValidatorServiceException;
|
import eu.dnetlib.api.functionality.ValidatorServiceException;
|
||||||
import eu.dnetlib.domain.functionality.validator.StoredJob;
|
import eu.dnetlib.domain.functionality.validator.StoredJob;
|
||||||
import eu.dnetlib.repo.manager.shared.JobsOfUser;
|
|
||||||
import eu.dnetlib.repo.manager.shared.Constants;
|
import eu.dnetlib.repo.manager.shared.Constants;
|
||||||
|
import eu.dnetlib.repo.manager.shared.JobsOfUser;
|
||||||
import gr.uoa.di.driver.util.ServiceLocator;
|
import gr.uoa.di.driver.util.ServiceLocator;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class MonitorApiImpl implements MonitorApi {
|
public class MonitorApiImpl implements MonitorApi {
|
||||||
|
@ -40,17 +38,19 @@ public class MonitorApiImpl implements MonitorApi {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JobsOfUser getJobsOfUser(@RequestParam("user") @ApiParam(value = "User email", required = true) String user,
|
public JobsOfUser getJobsOfUser(@RequestParam("user") @ApiParam(value = "User email", required = true) String user,
|
||||||
@RequestParam("jobType") @ApiParam(value = "Equals to filter job type on validation history page", required = true) String jobType,
|
@RequestParam(value = "jobType", required = false) @ApiParam(value = "Equals to filter job type on validation history page") String jobType,
|
||||||
@RequestParam("offset") @ApiParam(value = "Page number", required = true) String offset,
|
@RequestParam("offset") @ApiParam(value = "Page number", required = true) String offset,
|
||||||
@RequestParam(value = "limit", required = false, defaultValue = "10") @ApiParam(value = "Null value") String limit,
|
@RequestParam(value = "limit", required = false, defaultValue = "10") @ApiParam(value = "Null value") String limit,
|
||||||
@RequestParam(value = "dateFrom", required = false, defaultValue = "2018-02-08") @ApiParam(value = "Null value") String dateFrom,
|
@RequestParam(value = "dateFrom", required = false) @ApiParam(value = "Null value") String dateFrom,
|
||||||
@RequestParam(value = "dateTo", required = false, defaultValue = "2018-02-08") @ApiParam(value = "Null value") String dateTo,
|
@RequestParam(value = "dateTo", required = false) @ApiParam(value = "Null value") String dateTo,
|
||||||
@RequestParam("validationStatus") @ApiParam(value = "Equals to filter validation jobs", required = true) String validationStatus,
|
@RequestParam("validationStatus") @ApiParam(value = "Equals to filter validation jobs", required = true) String validationStatus,
|
||||||
@RequestParam("includeJobsTotal") @ApiParam(value = "Always true", required = true) String includeJobsTotal) throws JSONException, ValidatorServiceException {
|
@RequestParam("includeJobsTotal") @ApiParam(value = "Always true", required = true) String includeJobsTotal) throws JSONException, ValidatorServiceException {
|
||||||
|
|
||||||
LOGGER.debug("Getting jobs of user : " + user);
|
LOGGER.debug("Getting jobs of user : " + user);
|
||||||
LOGGER.debug(user + "/" + jobType + "/" + offset + "/" + dateFrom + "/" + dateTo + "/" + validationStatus + "/" + includeJobsTotal);
|
LOGGER.debug(user + "/" + jobType + "/" + offset + "/" + dateFrom + "/" + dateTo + "/" + validationStatus + "/" + includeJobsTotal);
|
||||||
JobsOfUser retJobs = new JobsOfUser();
|
JobsOfUser retJobs = new JobsOfUser();
|
||||||
|
LOGGER.debug("Size fo jobs list -> " + getValidationService().getStoredJobsNew(user, jobType, Integer.parseInt(offset),
|
||||||
|
Integer.parseInt(limit), dateFrom, dateTo, validationStatus));
|
||||||
retJobs.setJobs(getValidationService().getStoredJobsNew(user, jobType, Integer.parseInt(offset),
|
retJobs.setJobs(getValidationService().getStoredJobsNew(user, jobType, Integer.parseInt(offset),
|
||||||
Integer.parseInt(limit), dateFrom, dateTo, validationStatus));
|
Integer.parseInt(limit), dateFrom, dateTo, validationStatus));
|
||||||
if (Boolean.parseBoolean(includeJobsTotal)) {
|
if (Boolean.parseBoolean(includeJobsTotal)) {
|
||||||
|
|
Loading…
Reference in New Issue