2019-01-03 13:19:45 +01:00
|
|
|
package eu.dnetlib.repo.manager.controllers;
|
2018-09-03 13:47:22 +02:00
|
|
|
|
2019-02-04 13:47:04 +01:00
|
|
|
import eu.dnetlib.repo.manager.service.StatsServiceImpl;
|
2018-09-03 13:47:22 +02:00
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import org.json.JSONException;
|
2019-01-03 13:19:45 +01:00
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
2018-09-03 13:47:22 +02:00
|
|
|
import org.springframework.http.MediaType;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
@RequestMapping(value = "/stats")
|
|
|
|
@Api(description = "Stats API", tags = {"statistics"})
|
2019-01-03 13:19:45 +01:00
|
|
|
public class StatsController {
|
2018-09-03 13:47:22 +02:00
|
|
|
|
2019-01-03 13:19:45 +01:00
|
|
|
@Autowired
|
2019-02-04 13:47:04 +01:00
|
|
|
StatsServiceImpl statsService;
|
2018-09-03 13:47:22 +02:00
|
|
|
|
|
|
|
@RequestMapping(value = "/getStatistics" , method = RequestMethod.GET,
|
|
|
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
@ResponseBody
|
2019-02-16 01:01:58 +01:00
|
|
|
public Map getStatistics() throws JSONException {
|
2019-02-04 13:47:04 +01:00
|
|
|
return statsService.getStatistics();
|
2019-01-03 13:19:45 +01:00
|
|
|
}
|
2018-09-03 13:47:22 +02:00
|
|
|
}
|