我需要创建一个rest方法来通过postman中的id获取客户端,我什至创建了该方法,但是它没有通过spring boot通过id返回任何信息。
ClientControle.java:
@GetMapping(value = "/clientes/{id}")
public Cliente listCliente(@PathVariable("id") long id){
return clienteService.getById(id);
客户服务:
public interface ClienteService {
Cliente getById(long id);
List<Cliente> getAll();
Cliente save(Cliente cliente);
}
但我有以下错误: