Revision 49763
Added by Panagiotis Kanakakis over 6 years ago
RepositoryApi.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import eu.dnetlib.domain.data.Repository; |
4 | 4 |
import eu.dnetlib.domain.data.RepositoryInterface; |
5 |
import eu.dnetlib.repo.manager.service.shared.Country;
|
|
5 |
import eu.dnetlib.repo.manager.shared.*;
|
|
6 | 6 |
import org.json.JSONException; |
7 | 7 |
import org.springframework.http.MediaType; |
8 | 8 |
import org.springframework.web.bind.annotation.RequestMapping; |
... | ... | |
10 | 10 |
import org.springframework.web.bind.annotation.ResponseBody; |
11 | 11 |
import org.springframework.web.bind.annotation.RestController; |
12 | 12 |
import java.util.List; |
13 |
import java.util.Map; |
|
14 | 13 |
import java.util.Set; |
15 | 14 |
|
16 | 15 |
@RestController |
17 | 16 |
@RequestMapping(value = "/repository") |
18 | 17 |
public interface RepositoryApi { |
19 | 18 |
|
19 |
|
|
20 |
@RequestMapping(value = "/testAggregations", method = RequestMethod.GET, |
|
21 |
produces = MediaType.APPLICATION_JSON_VALUE) |
|
22 |
@ResponseBody |
|
23 |
Aggregations testAggregations() throws JSONException; |
|
24 |
|
|
20 | 25 |
@RequestMapping(value = "/getCountries", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) |
21 | 26 |
@ResponseBody |
22 | 27 |
Country[] getCountries() ; |
... | ... | |
28 | 33 |
|
29 | 34 |
@RequestMapping(value = "/getRepositoriesOfUser/{userEmail}/{page}/{size}") |
30 | 35 |
@ResponseBody |
31 |
List<Repository> getRepositoriesOfUser( String userEmail,
|
|
32 |
String page, |
|
33 |
String size) throws JSONException; |
|
36 |
List<Repository> getRepositoriesOfUser(String userEmail, |
|
37 |
String page,
|
|
38 |
String size) throws JSONException;
|
|
34 | 39 |
|
35 | 40 |
@RequestMapping(value = "/getRepositoryById/{id}", method = RequestMethod.GET, |
36 | 41 |
produces = MediaType.APPLICATION_JSON_VALUE) |
37 | 42 |
@ResponseBody |
38 | 43 |
Repository getRepositoryById(String id) throws JSONException; |
39 | 44 |
|
45 |
|
|
46 |
@RequestMapping(value = "/getRepositoryAggregations/{id}", method = RequestMethod.GET, |
|
47 |
produces = MediaType.APPLICATION_JSON_VALUE) |
|
48 |
@ResponseBody |
|
49 |
Aggregations getRepositoryAggregations(String id) throws JSONException; |
|
50 |
|
|
51 |
|
|
40 | 52 |
@RequestMapping(value = "/getRepositoriesByName/{name}/{page}/{size}/", method = RequestMethod.GET, |
41 | 53 |
produces = MediaType.APPLICATION_JSON_VALUE) |
42 | 54 |
@ResponseBody |
43 | 55 |
List<Repository> getRepositoriesByName(String name, |
44 |
String page, |
|
45 |
String size) throws JSONException; |
|
56 |
String page,
|
|
57 |
String size) throws JSONException;
|
|
46 | 58 |
|
47 | 59 |
@RequestMapping(value = "/getRepositoryInterface/{id}", method = RequestMethod.GET, |
48 | 60 |
produces = MediaType.APPLICATION_JSON_VALUE) |
... | ... | |
72 | 84 |
@RequestMapping(value = "/getTimezones", method = RequestMethod.GET, |
73 | 85 |
produces = MediaType.APPLICATION_JSON_VALUE) |
74 | 86 |
@ResponseBody |
75 |
List<String> getTimezones();
|
|
87 |
List<Timezone> getTimezones();
|
|
76 | 88 |
|
77 | 89 |
@RequestMapping(value = "/updateManagedStatus", method = RequestMethod.POST, |
78 | 90 |
produces = MediaType.APPLICATION_JSON_VALUE) |
79 | 91 |
@ResponseBody |
80 |
String updateManagedStatus(String id,String managed); |
|
92 |
String updateManagedStatus(String id, String managed);
|
|
81 | 93 |
|
82 | 94 |
@RequestMapping(value = "/updateEnglishName", method = RequestMethod.POST, |
83 | 95 |
produces = MediaType.APPLICATION_JSON_VALUE) |
84 | 96 |
@ResponseBody |
85 |
String updateEnglishName(String id,String englishName); |
|
97 |
String updateEnglishName(String id, String englishName);
|
|
86 | 98 |
|
87 | 99 |
@RequestMapping(value = "/updateLatitude", method = RequestMethod.POST, |
88 | 100 |
produces = MediaType.APPLICATION_JSON_VALUE) |
89 | 101 |
@ResponseBody |
90 |
String updateLatitude(String id,String latitude); |
|
102 |
String updateLatitude(String id, String latitude);
|
|
91 | 103 |
|
92 | 104 |
@RequestMapping(value = "/updateLongitude", method = RequestMethod.POST, |
93 | 105 |
produces = MediaType.APPLICATION_JSON_VALUE) |
94 | 106 |
@ResponseBody |
95 |
String updateLongitude(String id,String longitude); |
|
107 |
String updateLongitude(String id, String longitude);
|
|
96 | 108 |
|
97 | 109 |
@RequestMapping(value = "/updateOfficialName", method = RequestMethod.POST, |
98 | 110 |
produces = MediaType.APPLICATION_JSON_VALUE) |
99 | 111 |
@ResponseBody |
100 |
String updateOfficialName(String id,String officialName); |
|
112 |
String updateOfficialName(String id, String officialName);
|
|
101 | 113 |
|
102 |
@RequestMapping(value = "/getUrlsOfUserRepos/{user_email}",method = RequestMethod.GET,
|
|
114 |
@RequestMapping(value = "/getUrlsOfUserRepos/{email}/{page}/{size}/",method = RequestMethod.GET,
|
|
103 | 115 |
produces = MediaType.APPLICATION_JSON_VALUE) |
104 | 116 |
@ResponseBody |
105 |
String getUrlsOfUserRepos(String user_email); |
|
117 |
List<String> getUrlsOfUserRepos(String user_email, |
|
118 |
String page, |
|
119 |
String size) throws JSONException; |
|
106 | 120 |
|
107 | 121 |
@RequestMapping(value = "/getDatasourceVocabularies/{mode}",method = RequestMethod.GET, |
108 | 122 |
produces = MediaType.APPLICATION_JSON_VALUE) |
... | ... | |
113 | 127 |
|
114 | 128 |
|
115 | 129 |
|
130 |
|
|
131 |
|
|
116 | 132 |
} |
Also available in: Unified diff
1. Make getTimezones return List<Timezone> instead of List<String>
2. Add new classes on shared folder for aggregations.
3. Implemented methods: getUsersBaseUrls , getRepositoryAggregations
4. Implement methods on Converter class.
5. Change location of source folder.