springboot开发接口报错Optional int parameter 'userId' is present but cannot be translated into a null v...

springboot开发接口报错
Optional int parameter 'userId' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type

image.png

原来是这样的:


image.png

解决方案:


image.png

你可能感兴趣的:(springboot开发接口报错Optional int parameter 'userId' is present but cannot be translated into a null v...)