springcloud bug合集(未完待续)
- Required request body is missing: public com.atguigu.springcloud.entities.CommonResult com.atguigu.springcloud.contorller.PaymentController.create(com.atguigu.springcloud.entities.Payment
解决方案:将@RequestBody注解注释掉,
// @RequestBody主要用来接收前端网页传递给后端的json字符串中的数据的(请求体中的数据的)
//这里还没有网页,所以需要把 create(@RequestBody Payment payment)中的@RequestBody去掉,
// 不然会报错Required request body is missing: public com.atguigu.springcloud.entities.CommonResult com.atguigu.springcloud.contorller.PaymentController.create(com.atguigu.springcloud.entities.Payment
// CommonResult类的一条记录类似于:200,返回成功,数据 ---> code,message,data
@PostMapping(value = "/payment/create")
public CommonResult create(Payment payment) {
int result = paymentService.create(payment);
log.info("*****插入操作返回结果:" + result);
if (result > 0) {
return new CommonResult(200, "插入数据库成功", result);
} else {
return new CommonResult(444, "插入数据库失败", null);
}
}
-
热部署中第4步快捷键是:Ctrl+shift+Alt+?
-
安装rabbitmq可视化插件时,erlang和rabbitmq安装路径不要有空格,切记!!!!
不然会提示目录名称无效,困扰我一个多小时的bug。原来要erlang和rabbitmq安装路径都不能有空格