1
|
package eu.dnetlib.repo.manager.service.controllers;
|
2
|
|
3
|
import eu.dnetlib.domain.data.Repository;
|
4
|
import eu.dnetlib.domain.data.RepositoryInterface;
|
5
|
import org.json.JSONException;
|
6
|
import org.springframework.http.MediaType;
|
7
|
import org.springframework.web.bind.annotation.RequestMapping;
|
8
|
import org.springframework.web.bind.annotation.RequestMethod;
|
9
|
import org.springframework.web.bind.annotation.RestController;
|
10
|
import java.util.List;
|
11
|
|
12
|
@RestController
|
13
|
@RequestMapping(value = "/repository")
|
14
|
public interface RepositoryApi {
|
15
|
|
16
|
@RequestMapping(value = "/getCountries", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
17
|
String getCountries() ;
|
18
|
|
19
|
@RequestMapping(value = "/getRepositoriesByCountry/{country}/{page}/{size}/", method = RequestMethod.GET,
|
20
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
21
|
List<Repository> getRepositoriesByCountry(String country,
|
22
|
String page,
|
23
|
String size) throws JSONException;
|
24
|
|
25
|
@RequestMapping(value = "/getRepositoriesOfUser/{userEmail}/{page}/{size}")
|
26
|
List<Repository> getRepositoriesOfUser( String userEmail,
|
27
|
String page,
|
28
|
String size) throws JSONException;
|
29
|
|
30
|
@RequestMapping(value = "/getRepositoryById/{id}", method = RequestMethod.GET,
|
31
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
32
|
Repository getRepositoryById(String id) throws JSONException;
|
33
|
|
34
|
@RequestMapping(value = "/getRepositoriesByName/{name}/{page}/{size}/", method = RequestMethod.GET,
|
35
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
36
|
List<Repository> getRepositoriesByName(String name,
|
37
|
String page,
|
38
|
String size) throws JSONException;
|
39
|
|
40
|
@RequestMapping(value = "/getRepositoryInterface/{id}", method = RequestMethod.GET,
|
41
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
42
|
RepositoryInterface getRepositoyInterface(String id) throws JSONException;
|
43
|
|
44
|
@RequestMapping(value = "/addRepository", method = RequestMethod.POST,
|
45
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
46
|
String addRepository(Repository repository) throws JSONException;
|
47
|
|
48
|
@RequestMapping(value = "/addInterface", method = RequestMethod.POST,
|
49
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
50
|
String addRepositoryInterface(RepositoryInterface repositoryInterface) throws JSONException;
|
51
|
|
52
|
@RequestMapping(value = "/getDnetCountries", method = RequestMethod.GET,
|
53
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
54
|
List<String> getDnetCountries();
|
55
|
|
56
|
@RequestMapping(value = "/getTypologies", method = RequestMethod.GET,
|
57
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
58
|
List<String> getTypologies();
|
59
|
|
60
|
@RequestMapping(value = "/getTimezones", method = RequestMethod.GET,
|
61
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
62
|
List<String> getTimezones();
|
63
|
|
64
|
@RequestMapping(value = "/updateManagedStatus", method = RequestMethod.POST,
|
65
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
66
|
String updateManagedStatus(String id,String managed);
|
67
|
|
68
|
@RequestMapping(value = "/updateEnglishName", method = RequestMethod.POST,
|
69
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
70
|
String updateEnglishName(String id,String englishName);
|
71
|
|
72
|
@RequestMapping(value = "/updateLatitude", method = RequestMethod.POST,
|
73
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
74
|
String updateLatitude(String id,String latitude);
|
75
|
|
76
|
@RequestMapping(value = "/updateLongitude", method = RequestMethod.POST,
|
77
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
78
|
String updateLongitude(String id,String longitude);
|
79
|
|
80
|
@RequestMapping(value = "/updateOfficialName", method = RequestMethod.POST,
|
81
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
82
|
String updateOfficialName(String id,String officialName);
|
83
|
|
84
|
@RequestMapping(value = "/getUrlsOfUserRepos",method = RequestMethod.GET,
|
85
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
86
|
String getUrlsOfUserRepos(String user_email);
|
87
|
|
88
|
}
|