1
|
package eu.dnetlib.repo.manager.service.controllers;
|
2
|
|
3
|
import eu.dnetlib.api.functionality.ValidatorServiceException;
|
4
|
import eu.dnetlib.domain.functionality.validator.JobForValidation;
|
5
|
import eu.dnetlib.domain.functionality.validator.RuleSet;
|
6
|
import eu.dnetlib.domain.functionality.validator.StoredJob;
|
7
|
import eu.dnetlib.repo.manager.shared.ValidationServiceException;
|
8
|
import io.swagger.annotations.Api;
|
9
|
import org.json.JSONException;
|
10
|
import org.springframework.http.MediaType;
|
11
|
import org.springframework.web.bind.annotation.*;
|
12
|
|
13
|
import java.util.List;
|
14
|
|
15
|
|
16
|
@RestController
|
17
|
@RequestMapping(value = "/validator")
|
18
|
@Api(description = "Validator API", tags = {"validator"})
|
19
|
public interface ValidatorApi {
|
20
|
|
21
|
@RequestMapping(value = "/submitJobForValidation",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE )
|
22
|
@ResponseBody
|
23
|
void submitJobForValidation(@RequestBody JobForValidation jobForValidation);
|
24
|
|
25
|
@RequestMapping(value = "/reSubmitJobForValidation/",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE )
|
26
|
@ResponseBody
|
27
|
void reSubmitJobForValidation(@RequestBody String jobId) throws JSONException;
|
28
|
|
29
|
@RequestMapping(value = "/getRuleSets/{mode}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
30
|
@ResponseBody
|
31
|
List<RuleSet> getRuleSets(String mode);
|
32
|
|
33
|
@RequestMapping(value = "/getSetsOfRepository" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
34
|
@ResponseBody
|
35
|
List<String> getSetsOfRepository(@RequestBody String url);
|
36
|
|
37
|
@RequestMapping(value = "/identifyRepository/{url}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
38
|
@ResponseBody
|
39
|
boolean identifyRepo(String url);
|
40
|
|
41
|
@RequestMapping(value = "/getRuleSet/{acronym}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
42
|
@ResponseBody
|
43
|
RuleSet getRuleSet(String acronym);
|
44
|
|
45
|
@RequestMapping(value = "/getStoredJobsNew" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
46
|
@ResponseBody
|
47
|
List<StoredJob> getStoredJobsNew(String user, String jobType, Integer offset, Integer limit, String dateFrom,
|
48
|
String dateTo, String validationStatus) throws ValidatorServiceException;
|
49
|
|
50
|
|
51
|
@RequestMapping(value = "/getStoredJobsTotalNumberNew" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
52
|
@ResponseBody
|
53
|
int getStoredJobsTotalNumberNew(String user, String jobType, String validationStatus) throws ValidatorServiceException;
|
54
|
|
55
|
}
|