141 lines
5.9 KiB
Java
141 lines
5.9 KiB
Java
package eu.dnetlib.repo.manager.service.controllers;
|
|
|
|
import eu.dnetlib.domain.data.Repository;
|
|
import eu.dnetlib.domain.data.RepositoryInterface;
|
|
import eu.dnetlib.domain.functionality.UserProfile;
|
|
import eu.dnetlib.repo.manager.shared.*;
|
|
import io.swagger.annotations.Api;
|
|
import org.json.JSONException;
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
|
|
@RestController
|
|
@RequestMapping(value = "/repository")
|
|
@Api(description = "Repository API", tags = {"repository"})
|
|
public interface RepositoryApi {
|
|
|
|
@RequestMapping(value = "/getCountries", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
Country[] getCountries() ;
|
|
|
|
@RequestMapping(value = "/getRepositoriesByCountry/{country}/{mode}", method = RequestMethod.GET,
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
List<Repository> getRepositoriesByCountry(String country, String mode, Boolean managed) throws JSONException;
|
|
|
|
@RequestMapping(value = "/getRepositoriesOfUser/{userEmail}/{page}/{size}",method = RequestMethod.GET,
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
List<Repository> getRepositoriesOfUser(String userEmail,
|
|
String page,
|
|
String size) throws JSONException;
|
|
|
|
@RequestMapping(value = "/getRepositoryById/{id}", method = RequestMethod.GET,
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
Repository getRepositoryById(String id) throws JSONException;
|
|
|
|
|
|
@RequestMapping(value = "/getRepositoryAggregations/{id}", method = RequestMethod.GET,
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
Aggregations getRepositoryAggregations(String id) throws JSONException;
|
|
|
|
|
|
@RequestMapping(value = "/getRepositoriesByName/{name}/{page}/{size}/", method = RequestMethod.GET,
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
List<Repository> getRepositoriesByName(String name,
|
|
String page,
|
|
String size) throws JSONException;
|
|
|
|
@RequestMapping(value = "/getRepositoryInterface/{id}", method = RequestMethod.GET,
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
List<RepositoryInterface> getRepositoryInterface(String id) throws JSONException;
|
|
|
|
@RequestMapping(value = "/addRepository", method = RequestMethod.POST,
|
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
Repository addRepository(String datatype, Repository repository) throws Exception;
|
|
|
|
|
|
@RequestMapping(value = "/deleteInterface/", method = RequestMethod.DELETE)
|
|
void deleteRepositoryInterface(String id);
|
|
|
|
@RequestMapping(value = "/addInterface", method = RequestMethod.POST,
|
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
RepositoryInterface addRepositoryInterface(String datatype,
|
|
String repoId,
|
|
RepositoryInterface iFace) throws JSONException;
|
|
|
|
@RequestMapping(value = "/getDnetCountries", method = RequestMethod.GET,
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
List<String> getDnetCountries();
|
|
|
|
@RequestMapping(value = "/getTypologies", method = RequestMethod.GET,
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
List<String> getTypologies();
|
|
|
|
@RequestMapping(value = "/getTimezones", method = RequestMethod.GET,
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
List<Timezone> getTimezones();
|
|
|
|
@RequestMapping(value = "/updateRepository", method = RequestMethod.POST,
|
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
Repository updateRepository(Repository repository) throws JSONException;
|
|
|
|
@RequestMapping(value = "/getUrlsOfUserRepos/{user_email}/{page}/{size}/",method = RequestMethod.GET,
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
List<String> getUrlsOfUserRepos(String user_email,
|
|
String page,
|
|
String size) throws JSONException;
|
|
|
|
@RequestMapping(value = "/getDatasourceVocabularies/{mode}",method = RequestMethod.GET,
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
List<String> getDatasourceVocabularies(String mode);
|
|
|
|
@RequestMapping(value = "/getCompatibilityClasses/{mode}",method = RequestMethod.GET,
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
Map<String, String> getCompatibilityClasses(String mode);
|
|
|
|
@RequestMapping(value = "/getDatasourceClasses/{mode}",method = RequestMethod.GET,
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
Map<String, String> getDatasourceClasses(String mode);
|
|
|
|
|
|
String getCountryName(String countryCode);
|
|
|
|
@RequestMapping(value = "/getMetricsInfoForRepository/{repoId}",method = RequestMethod.GET,
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
MetricsInfo getMetricsInfoForRepository(String repoId) throws RepositoryServiceException;
|
|
|
|
@RequestMapping(value = "/getListLatestUpdate/{mode}",method = RequestMethod.GET,
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
Map<String, String> getListLatestUpdate(String mode) throws RepositoryServiceException, JSONException;
|
|
|
|
@RequestMapping(value = "/updateRepositoryInterface", method = RequestMethod.POST,
|
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
@ResponseBody
|
|
RepositoryInterface updateRepositoryInterface(String repositoryId,RepositoryInterface repositoryInterface) throws JSONException;
|
|
|
|
|
|
|
|
}
|