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 eu.dnetlib.repo.manager.shared.Aggregations;
|
6
|
import eu.dnetlib.repo.manager.shared.Country;
|
7
|
import eu.dnetlib.repo.manager.shared.Timezone;
|
8
|
import io.swagger.annotations.Api;
|
9
|
import org.json.JSONException;
|
10
|
import org.springframework.http.MediaType;
|
11
|
import org.springframework.web.bind.annotation.RequestMapping;
|
12
|
import org.springframework.web.bind.annotation.RequestMethod;
|
13
|
import org.springframework.web.bind.annotation.ResponseBody;
|
14
|
import org.springframework.web.bind.annotation.RestController;
|
15
|
|
16
|
import java.util.List;
|
17
|
import java.util.Map;
|
18
|
|
19
|
|
20
|
@RestController
|
21
|
@RequestMapping(value = "/repository")
|
22
|
@Api(description = "Repository API", tags = {"repository"})
|
23
|
public interface RepositoryApi {
|
24
|
|
25
|
@RequestMapping(value = "/testAggregations", method = RequestMethod.GET,
|
26
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
27
|
@ResponseBody
|
28
|
List<String> testAggregations() throws JSONException;
|
29
|
|
30
|
@RequestMapping(value = "/getCountries", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
31
|
@ResponseBody
|
32
|
Country[] getCountries() ;
|
33
|
|
34
|
@RequestMapping(value = "/getRepositoriesByCountry/{country}/{mode}", method = RequestMethod.GET,
|
35
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
36
|
@ResponseBody
|
37
|
List<Repository> getRepositoriesByCountry(String country,String mode) throws JSONException;
|
38
|
|
39
|
@RequestMapping(value = "/getRepositoriesOfUser/{userEmail}/{page}/{size}",method = RequestMethod.GET,
|
40
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
41
|
@ResponseBody
|
42
|
List<Repository> getRepositoriesOfUser(String userEmail,
|
43
|
String page,
|
44
|
String size) throws JSONException;
|
45
|
|
46
|
@RequestMapping(value = "/getRepositoryById/{id}", method = RequestMethod.GET,
|
47
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
48
|
@ResponseBody
|
49
|
Repository getRepositoryById(String id) throws JSONException;
|
50
|
|
51
|
|
52
|
@RequestMapping(value = "/getRepositoryAggregations/{id}", method = RequestMethod.GET,
|
53
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
54
|
@ResponseBody
|
55
|
Aggregations getRepositoryAggregations(String id) throws JSONException;
|
56
|
|
57
|
|
58
|
@RequestMapping(value = "/getRepositoriesByName/{name}/{page}/{size}/", method = RequestMethod.GET,
|
59
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
60
|
@ResponseBody
|
61
|
List<Repository> getRepositoriesByName(String name,
|
62
|
String page,
|
63
|
String size) throws JSONException;
|
64
|
|
65
|
@RequestMapping(value = "/getRepositoryInterface/{id}", method = RequestMethod.GET,
|
66
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
67
|
@ResponseBody
|
68
|
List<RepositoryInterface> getRepositoryInterface(String id) throws JSONException;
|
69
|
|
70
|
@RequestMapping(value = "/addRepository", method = RequestMethod.POST,
|
71
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
72
|
@ResponseBody
|
73
|
void addRepository( String params) throws Exception;
|
74
|
|
75
|
@RequestMapping(value = "/deleteInterface", method = RequestMethod.DELETE)
|
76
|
@ResponseBody
|
77
|
void deleteRepositoryInterface(String id);
|
78
|
|
79
|
@RequestMapping(value = "/addInterface", method = RequestMethod.POST,
|
80
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
81
|
@ResponseBody
|
82
|
RepositoryInterface addRepositoryInterface(String params) throws JSONException;
|
83
|
|
84
|
@RequestMapping(value = "/getDnetCountries", method = RequestMethod.GET,
|
85
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
86
|
@ResponseBody
|
87
|
List<String> getDnetCountries();
|
88
|
|
89
|
@RequestMapping(value = "/getTypologies", method = RequestMethod.GET,
|
90
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
91
|
@ResponseBody
|
92
|
List<String> getTypologies();
|
93
|
|
94
|
@RequestMapping(value = "/getTimezones", method = RequestMethod.GET,
|
95
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
96
|
@ResponseBody
|
97
|
List<Timezone> getTimezones();
|
98
|
|
99
|
@RequestMapping(value = "/updateManagedStatus", method = RequestMethod.POST,
|
100
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
101
|
@ResponseBody
|
102
|
String updateManagedStatus(String id, String managed);
|
103
|
|
104
|
@RequestMapping(value = "/updateEnglishName", method = RequestMethod.POST,
|
105
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
106
|
@ResponseBody
|
107
|
String updateEnglishName(String id, String englishName);
|
108
|
|
109
|
@RequestMapping(value = "/updateLatitude", method = RequestMethod.POST,
|
110
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
111
|
@ResponseBody
|
112
|
String updateLatitude(String id, String latitude);
|
113
|
|
114
|
@RequestMapping(value = "/updateLongitude", method = RequestMethod.POST,
|
115
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
116
|
@ResponseBody
|
117
|
String updateLongitude(String id, String longitude);
|
118
|
|
119
|
@RequestMapping(value = "/updateOfficialName", method = RequestMethod.POST,
|
120
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
121
|
@ResponseBody
|
122
|
String updateOfficialName(String id, String officialName);
|
123
|
|
124
|
@RequestMapping(value = "/updateTimezone", method = RequestMethod.POST,
|
125
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
126
|
@ResponseBody
|
127
|
String updateTimezone(String id, String timezone);
|
128
|
|
129
|
@RequestMapping(value = "/updateTypology", method = RequestMethod.POST,
|
130
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
131
|
@ResponseBody
|
132
|
String updateTypology(String id, String typology);
|
133
|
|
134
|
@RequestMapping(value = "/updateLogoUrl", method = RequestMethod.POST,
|
135
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
136
|
@ResponseBody
|
137
|
String updateLogoUrl(String id, String logoUrl);
|
138
|
|
139
|
@RequestMapping(value = "/updatePlatform", method = RequestMethod.POST,
|
140
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
141
|
@ResponseBody
|
142
|
String updatePlatform(String id, String platform);
|
143
|
|
144
|
|
145
|
@RequestMapping(value = "/getUrlsOfUserRepos/{user_email}/{page}/{size}/",method = RequestMethod.GET,
|
146
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
147
|
@ResponseBody
|
148
|
List<String> getUrlsOfUserRepos(String user_email,
|
149
|
String page,
|
150
|
String size) throws JSONException;
|
151
|
|
152
|
@RequestMapping(value = "/getDatasourceVocabularies/{mode}",method = RequestMethod.GET,
|
153
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
154
|
@ResponseBody
|
155
|
List<String> getDatasourceVocabularies(String mode);
|
156
|
|
157
|
@RequestMapping(value = "/getCompatibilityClasses/{mode}",method = RequestMethod.GET,
|
158
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
159
|
@ResponseBody
|
160
|
Map<String, String> getCompatibilityClasses(String mode);
|
161
|
|
162
|
@RequestMapping(value = "/getDatasourceClasses/{mode}",method = RequestMethod.GET,
|
163
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
164
|
@ResponseBody
|
165
|
Map<String, String> getDatasourceClasses(String mode);
|
166
|
|
167
|
|
168
|
String getCountryName(String countryCode);
|
169
|
}
|