06-ZPRPLI0/demo/05-06_2/src/main/java/edu/amu/pl/demo/risk/web/RiskController.java

22 lines
655 B
Java

package edu.amu.pl.demo.risk.web;
import edu.amu.pl.demo.risk.dto.RiskFactorDTO;
import edu.amu.pl.demo.risk.service.RiskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
@RestController("/risk")
public class RiskController {
@Autowired
private RiskService service;
@GetMapping("/risk/{clientId}")
public RiskFactorDTO getRiskForClient(@PathVariable Long clientId) {
return service.calculateRiskFactor(clientId);
}
}