1
|
package eu.dnetlib.statsapi.controllers;
|
2
|
|
3
|
import eu.dnetlib.statsapi.domain.Result;
|
4
|
import eu.dnetlib.statsapi.repositories.FunderRepository;
|
5
|
|
6
|
import org.apache.log4j.Logger;
|
7
|
import org.springframework.beans.factory.annotation.Autowired;
|
8
|
import org.springframework.web.bind.annotation.PathVariable;
|
9
|
import org.springframework.web.bind.annotation.RequestMapping;
|
10
|
import org.springframework.web.bind.annotation.RestController;
|
11
|
|
12
|
@RestController
|
13
|
public class FunderController {
|
14
|
|
15
|
@Autowired
|
16
|
private FunderRepository funderRepository;
|
17
|
|
18
|
private final Logger log = Logger.getLogger(this.getClass());
|
19
|
|
20
|
@RequestMapping(value = "/funders/{funder}")
|
21
|
public Result getFunder(@PathVariable(value = "funder") String funder) {
|
22
|
log.info("request for funder: " + funder);
|
23
|
return funderRepository.getFunder(funder);
|
24
|
}
|
25
|
}
|