I have Model called Loan:
public class Loan {
private int loan_id;
private String clientName;
private String clientSurname;
private Double amount;
private int days;
//getters and setters
}
And Controller
@RestController
public class MyController {
@Autowired
MyService myService;
@RequestMapping(value = "/makeAction",method = RequestMethod.POST)
public String makeLoan(){
return myService.makeAction(...);
}
}
The question is: how to bypass multiple variables via adressbar like:
localhost:8080/makeAction?loanId=1#clientName=Stive#clientSurname=Wassabi
and so on.
UPD: Another attempt failed:
@RequestMapping(value="/makeLoan",method = RequestMethod.GET)
public String makeLoan(@PathVariable("loan_id")int loan_id,
@PathVariable("name") String clientName,
@PathVariable("surname") String clientSurname,
@PathVariable("amount") double amount,
@PathVariable("days") int days ) throws Exception {
return myService.makeLoan(loan_id,clientName,clientSurname,amount,days);
P.S tried @PathVariables - failed to use