我希望让 Spring 使用正确的端点,而不是为我的 Spring Boot Rest Controller 构建 case 语句。我什至不确定这是否可能,但我希望宇宙能拯救我。
@PostMapping("/endpoint")
public String one(Greeting greet) {
return "Greeting Posted";
}
@PostMapping("/endpoint")
public String two(Address addr) {
return "Address Posted";
}
电流误差
Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'RController' method
public java.lang.String com.example.controller.RController.two(com.example.model.Address)
to {[/endpoint],methods=[POST]}: There is already 'RController' bean method
public java.lang.String com.example.controller.RController.one(com.example.model.Greeting) mapped.
慕工程0101907
相关分类