spring boot 中json数据处理

spring boot获取json数据,使用@RequestBody JSONObject jsonParma注解,获取数据用jsonParma.getString方法

String类型转int使用Integer.parseInt(String)函数

 

for current thread - cannot reliably process 'remove' call加上@Transactional即可,

打了这个注解的类或者方法表示该类里面的所有方法或者这个方法的事务由spring处理,来保证事务的原子性,不知道这样说你能不能理解,即是方法里面对数据库操作,如果失败则spring负责回滚操作,成功提交操作

Unknown return value type: java.lang.Integer

有一种可能是没有写@responseBody注解,写上注解立马问题解决了,

 

猜你喜欢

转载自blog.csdn.net/qq_36734094/article/details/81136774