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.json.JSONException;
6
import org.springframework.beans.factory.annotation.Autowired;
7
import org.springframework.http.MediaType;
8
import org.springframework.web.bind.annotation.RequestMapping;
9
import org.springframework.web.bind.annotation.RequestMethod;
10
import org.springframework.web.bind.annotation.ResponseBody;
11
import org.springframework.web.bind.annotation.RestController;
12

    
13
import java.util.Map;
14

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

    
20
    @Autowired
21
    private StatsServiceImpl statsService;
22

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