Project

General

Profile

1
package eu.dnetlib.repo.manager.service.controllers;
2

    
3
import eu.dnetlib.domain.functionality.validator.JobForValidation;
4
import eu.dnetlib.domain.functionality.validator.RuleSet;
5
import io.swagger.annotations.Api;
6
import org.json.JSONException;
7
import org.springframework.http.MediaType;
8
import org.springframework.web.bind.annotation.*;
9

    
10
import java.util.List;
11

    
12

    
13
@RestController
14
@RequestMapping(value = "/validator")
15
@Api(description = "Validator API",  tags = {"validator"})
16
public interface ValidatorApi {
17

    
18
    @RequestMapping(value = "/submitJobForValidation",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE )
19
    @ResponseBody
20
    void submitJobForValidation(@RequestBody JobForValidation jobForValidation);
21

    
22
    @RequestMapping(value = "/reSubmitJobForValidation/",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE )
23
    @ResponseBody
24
    void reSubmitJobForValidation(@RequestBody String jobId) throws JSONException;
25

    
26
    @RequestMapping(value = "/getRuleSets/{mode}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
27
    @ResponseBody
28
    List<RuleSet> getRuleSets(String mode);
29

    
30
    @RequestMapping(value = "/getSetsOfRepository" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
31
    @ResponseBody
32
    List<String> getSetsOfRepository(@RequestBody String url);
33

    
34
    @RequestMapping(value = "/identifyRepository/{url}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
35
    @ResponseBody
36
    boolean identifyRepo(String url);
37

    
38
    @RequestMapping(value = "/getRuleSet/{acronym}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
39
    @ResponseBody
40
    RuleSet getRuleSet(String acronym);
41

    
42
}
(9-9/10)