1 |
54525
|
panagiotis
|
package eu.dnetlib.repo.manager.controllers;
|
2 |
52829
|
myrto.kouk
|
|
3 |
54690
|
panagiotis
|
import eu.dnetlib.repo.manager.service.SushiliteServiceImpl;
|
4 |
52911
|
myrto.kouk
|
import eu.dnetlib.usagestats.sushilite.domain.ReportResponseWrapper;
|
5 |
54525
|
panagiotis
|
import io.swagger.annotations.Api;
|
6 |
52829
|
myrto.kouk
|
import org.springframework.beans.factory.annotation.Autowired;
|
7 |
54525
|
panagiotis
|
import org.springframework.http.MediaType;
|
8 |
52829
|
myrto.kouk
|
import org.springframework.security.access.prepost.PreAuthorize;
|
9 |
54525
|
panagiotis
|
import org.springframework.web.bind.annotation.*;
|
10 |
52829
|
myrto.kouk
|
|
11 |
54525
|
panagiotis
|
@RestController
|
12 |
|
|
@RequestMapping(value = "/sushilite")
|
13 |
|
|
@Api(description = "Sushi-Lite API", tags = {"sushilite"})
|
14 |
|
|
public class SushiliteController {
|
15 |
52829
|
myrto.kouk
|
|
16 |
|
|
|
17 |
|
|
@Autowired
|
18 |
56661
|
ioannis.di
|
private SushiliteServiceImpl sushiliteService;
|
19 |
52829
|
myrto.kouk
|
|
20 |
54525
|
panagiotis
|
@RequestMapping(value = "/getReportResults/{page}/{pageSize}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
21 |
|
|
@ResponseBody
|
22 |
61371
|
spyroukon
|
@PreAuthorize("hasAuthority('REGISTERED_USER')")
|
23 |
52911
|
myrto.kouk
|
public ReportResponseWrapper getReportResults(@PathVariable("page") String page,
|
24 |
|
|
@PathVariable("pageSize") String pageSize,
|
25 |
|
|
@RequestParam(value = "Report") String Report,
|
26 |
52829
|
myrto.kouk
|
@RequestParam(value = "Release",defaultValue="4") String Release,
|
27 |
52911
|
myrto.kouk
|
@RequestParam(value = "RequestorID",required=false,defaultValue="anonymous") String RequestorID,
|
28 |
|
|
@RequestParam(value = "BeginDate",required=false,defaultValue="") String BeginDate,
|
29 |
|
|
@RequestParam(value = "EndDate",required=false,defaultValue="") String EndDate,
|
30 |
52829
|
myrto.kouk
|
@RequestParam(value = "RepositoryIdentifier") String RepositoryIdentifier,
|
31 |
52911
|
myrto.kouk
|
@RequestParam(value = "ItemIdentifier",required=false,defaultValue="") String ItemIdentifier,
|
32 |
|
|
@RequestParam(value = "ItemDataType",required=false,defaultValue="") String ItemDataType,
|
33 |
52829
|
myrto.kouk
|
@RequestParam(value = "Granularity") String Granularity,
|
34 |
52911
|
myrto.kouk
|
@RequestParam(value = "Pretty",required=false,defaultValue="") String Pretty) {
|
35 |
52829
|
myrto.kouk
|
|
36 |
54690
|
panagiotis
|
return sushiliteService.getReportResults(page, pageSize, Report, Release, RequestorID, BeginDate, EndDate, RepositoryIdentifier, ItemIdentifier, ItemDataType, Granularity, Pretty);
|
37 |
52829
|
myrto.kouk
|
}
|
38 |
52911
|
myrto.kouk
|
|
39 |
52829
|
myrto.kouk
|
}
|