Failed to convert value of type 'java.lang.String' to required type 'java.lang.Long';

Failed to convert value of type ‘java.lang.String’ to required type ‘java.lang.XXX’;

produces为返回方法格式

consumes 为入参格式

produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE

在 Controller 层没有参数需要省略掉 consumes 否则会报异常

 Failed to convert value of type 'java.lang.String' to required type 'java.lang.Long';

你可能感兴趣的:(Spring,boot,注解)