springboot開發介面報錯Optional int parameter 'userId' is present but cannot be translated into a null v......

weixin_34248705發表於2018-12-20

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

4472062-a0b61a170e0015a1.png
image.png

原來是這樣的:


4472062-62b0fd94d11b7ca2.png
image.png

解決方案:


4472062-a90e615036f72912.png
image.png

相關文章