Project

General

Profile

1
package eu.dnetlib.repo.manager.controllers;
2

    
3
import eu.dnetlib.repo.manager.service.StatsServiceImpl;
4
import io.swagger.annotations.Api;
5
import org.springframework.beans.factory.annotation.Autowired;
6
import org.springframework.http.MediaType;
7
import org.springframework.web.bind.annotation.RequestMapping;
8
import org.springframework.web.bind.annotation.RequestMethod;
9
import org.springframework.web.bind.annotation.ResponseBody;
10
import org.springframework.web.bind.annotation.RestController;
11

    
12
import java.util.Map;
13

    
14
@RestController
15
@RequestMapping(value = "/stats")
16
@Api(description = "Stats API",  tags = {"statistics"})
17
public class StatsController {
18

    
19
    @Autowired
20
    private StatsServiceImpl statsService;
21

    
22
    @RequestMapping(value = "/getStatistics" , method = RequestMethod.GET,
23
            produces = MediaType.APPLICATION_JSON_VALUE)
24
    @ResponseBody
25
    public Map getStatistics(){
26
       return statsService.getStatistics();
27
    }
28
}
(8-8/12)