Project

General

Profile

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.*;
6
import io.swagger.annotations.Api;
7
import org.json.JSONException;
8
import org.springframework.http.MediaType;
9
import org.springframework.web.bind.annotation.*;
10

    
11
import java.util.List;
12
import java.util.Map;
13

    
14

    
15
@RestController
16
@RequestMapping(value = "/repository")
17
public interface RepositoryApi {
18

    
19

    
20
    @RequestMapping(value = "/testAggregations", method = RequestMethod.GET,
21
            produces = MediaType.APPLICATION_JSON_VALUE)
22
    @ResponseBody
23
    List<String> testAggregations() throws JSONException;
24

    
25
    @RequestMapping(value = "/getCountries", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
26
    @ResponseBody
27
    Country[] getCountries() ;
28

    
29
    @RequestMapping(value = "/getRepositoriesByCountry/{country}/{mode}", method = RequestMethod.GET,
30
            produces = MediaType.APPLICATION_JSON_VALUE)
31
    @ResponseBody
32
    List<Repository> getRepositoriesByCountry(String country,String mode) throws JSONException;
33

    
34
    @RequestMapping(value = "/getRepositoriesOfUser/{userEmail}/{page}/{size}")
35
    @ResponseBody
36
    List<Repository> getRepositoriesOfUser(String userEmail,
37
                                           String page,
38
                                           String size) throws JSONException;
39

    
40
    @RequestMapping(value = "/getRepositoryById/{id}", method = RequestMethod.GET,
41
            produces = MediaType.APPLICATION_JSON_VALUE)
42
    @ResponseBody
43
    Repository getRepositoryById(String id) throws JSONException;
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

    
52
    @RequestMapping(value = "/getRepositoriesByName/{name}/{page}/{size}/", method = RequestMethod.GET,
53
            produces = MediaType.APPLICATION_JSON_VALUE)
54
    @ResponseBody
55
    List<Repository> getRepositoriesByName(String name,
56
                                           String page,
57
                                           String size) throws JSONException;
58

    
59
    @RequestMapping(value = "/getRepositoryInterface/{id}", method = RequestMethod.GET,
60
            produces = MediaType.APPLICATION_JSON_VALUE)
61
    @ResponseBody
62
    RepositoryInterface getRepositoyInterface(String id) throws JSONException;
63

    
64
    @RequestMapping(value = "/addRepository", method = RequestMethod.POST,
65
            consumes = MediaType.APPLICATION_JSON_VALUE)
66
    @ResponseBody
67
    void addRepository(@RequestBody String params) throws Exception;
68

    
69
    @RequestMapping(value = "/deleteInterface", method = RequestMethod.DELETE)
70
    @ResponseBody
71
    void deleteRepositoryInterface(String id);
72

    
73
    @RequestMapping(value = "/addInterface", method = RequestMethod.POST,
74
            consumes = MediaType.APPLICATION_JSON_VALUE)
75
    @ResponseBody
76
    RepositoryInterface addRepositoryInterface(Repository repository,RepositoryInterface repositoryInterface) throws JSONException;
77

    
78
    @RequestMapping(value = "/getDnetCountries", method = RequestMethod.GET,
79
            produces = MediaType.APPLICATION_JSON_VALUE)
80
    @ResponseBody
81
    List<String> getDnetCountries();
82

    
83
    @RequestMapping(value = "/getTypologies", method = RequestMethod.GET,
84
            produces = MediaType.APPLICATION_JSON_VALUE)
85
    @ResponseBody
86
    List<String> getTypologies();
87

    
88
    @RequestMapping(value = "/getTimezones", method = RequestMethod.GET,
89
            produces = MediaType.APPLICATION_JSON_VALUE)
90
    @ResponseBody
91
    List<Timezone> getTimezones();
92

    
93
    @RequestMapping(value = "/updateManagedStatus", method = RequestMethod.POST,
94
            produces = MediaType.APPLICATION_JSON_VALUE)
95
    @ResponseBody
96
    String updateManagedStatus(String id, String managed);
97

    
98
    @RequestMapping(value = "/updateEnglishName", method = RequestMethod.POST,
99
            produces = MediaType.APPLICATION_JSON_VALUE)
100
    @ResponseBody
101
    String updateEnglishName(String id, String englishName);
102

    
103
    @RequestMapping(value = "/updateLatitude", method = RequestMethod.POST,
104
            produces = MediaType.APPLICATION_JSON_VALUE)
105
    @ResponseBody
106
    String updateLatitude(String id, String latitude);
107

    
108
    @RequestMapping(value = "/updateLongitude", method = RequestMethod.POST,
109
            produces = MediaType.APPLICATION_JSON_VALUE)
110
    @ResponseBody
111
    String updateLongitude(String id, String longitude);
112

    
113
    @RequestMapping(value = "/updateOfficialName", method = RequestMethod.POST,
114
            produces = MediaType.APPLICATION_JSON_VALUE)
115
    @ResponseBody
116
    String updateOfficialName(String id, String officialName);
117

    
118
    @RequestMapping(value = "/updateTimezone", method = RequestMethod.POST,
119
            produces = MediaType.APPLICATION_JSON_VALUE)
120
    @ResponseBody
121
    String updateTimezone(String id, String timezone);
122

    
123
    @RequestMapping(value = "/updateTypology", method = RequestMethod.POST,
124
            produces = MediaType.APPLICATION_JSON_VALUE)
125
    @ResponseBody
126
    String updateTypology(String id, String typology);
127

    
128
    @RequestMapping(value = "/updateLogoUrl", method = RequestMethod.POST,
129
            produces = MediaType.APPLICATION_JSON_VALUE)
130
    @ResponseBody
131
    String updateLogoUrl(String id, String logoUrl);
132

    
133

    
134
    @RequestMapping(value = "/getUrlsOfUserRepos/{user_email}/{page}/{size}/",method = RequestMethod.GET,
135
            produces = MediaType.APPLICATION_JSON_VALUE)
136
    @ResponseBody
137
    List<String> getUrlsOfUserRepos(String user_email,
138
                                    String page,
139
                                    String size) throws JSONException;
140

    
141
    @RequestMapping(value = "/getDatasourceVocabularies/{mode}",method = RequestMethod.GET,
142
            produces = MediaType.APPLICATION_JSON_VALUE)
143
    @ResponseBody
144
    List<String> getDatasourceVocabularies(String mode);
145

    
146
    @RequestMapping(value = "/getCompatibilityClasses/{mode}",method = RequestMethod.GET,
147
            produces = MediaType.APPLICATION_JSON_VALUE)
148
    @ResponseBody
149
    Map<String, String> getCompatibilityClasses(String mode);
150

    
151
    @RequestMapping(value = "/getDatasourceClasses/{mode}",method = RequestMethod.GET,
152
            produces = MediaType.APPLICATION_JSON_VALUE)
153
    @ResponseBody
154
    Map<String, String> getDatasourceClasses(String mode);
155

    
156

    
157
    String getCountryName(String countryCode);
158
}
(7-7/10)