1
|
package eu.dnetlib.repo.manager.service.controllers;
|
2
|
|
3
|
|
4
|
import eu.dnetlib.domain.data.PiwikInfo;
|
5
|
import eu.dnetlib.domain.data.Repository;
|
6
|
import eu.dnetlib.domain.functionality.UserProfile;
|
7
|
import eu.dnetlib.repo.manager.shared.RepositoryServiceException;
|
8
|
import io.swagger.annotations.Api;
|
9
|
import org.springframework.http.MediaType;
|
10
|
import org.springframework.web.bind.annotation.*;
|
11
|
|
12
|
import java.util.List;
|
13
|
|
14
|
@RestController
|
15
|
@RequestMapping(value = "/piwik")
|
16
|
@Api(description = "Piwik API", tags = {"piwik"})
|
17
|
public interface PiWikApi {
|
18
|
|
19
|
|
20
|
@RequestMapping(value = "/getPiwikSiteForRepo/{repositoryId}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
21
|
@ResponseBody
|
22
|
PiwikInfo getPiwikSiteForRepo(String repositoryId);
|
23
|
|
24
|
@RequestMapping(value = "/savePiwikInfo" , method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
25
|
PiwikInfo savePiwikInfo( PiwikInfo piwikInfo);
|
26
|
|
27
|
@RequestMapping(value = "/getPiwikSitesForRepos" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
28
|
List<PiwikInfo> getPiwikSitesForRepos();
|
29
|
|
30
|
@RequestMapping(value = "/approvePiwikSite/{repositoryId}" , method = RequestMethod.GET)
|
31
|
@ResponseBody
|
32
|
void approvePiwikSite(String repositoryId);
|
33
|
|
34
|
@RequestMapping(value = "/getOpenaireId/{repositoryId}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
35
|
@ResponseBody
|
36
|
String getOpenaireId(String repositoryid);
|
37
|
|
38
|
|
39
|
@RequestMapping(value = "/markPiwikSiteAsValidated/{repositoryId}" , method = RequestMethod.POST,
|
40
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
41
|
@ResponseBody
|
42
|
void markPiwikSiteAsValidated(String repositoryId) throws RepositoryServiceException;
|
43
|
|
44
|
@RequestMapping(value = "/enableMetricsForRepository", method = RequestMethod.POST,
|
45
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
46
|
void enableMetricsForRepository(PiwikInfo piwikInfo) throws RepositoryServiceException;
|
47
|
}
|