postman请求后端服务,用RequestBody 接收,但参数缺失
问题代码
@RequestMapping(value = "/addUser",method = RequestMethod.POST,produces = "application/json;charset=UTF-8")
public JsonResp addUser(@RequestBody User user){
int add = userService.addUser(user);
return restByInt(add,"添加用户");
}
user实体
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("user")
public class User extends absEntity<User> implements Serializable{
private static final long serialVersionUID=1L;
//用户登录账号
@TableId(type = IdType.INPUT)
private String uAccount;
//用户密码(登录密码)
private String uPassword;
//用户身份(0学生,1老师,2辅导员)
private String uStatus;
//用户邮箱(登录账号2)
private String uMail;
//用户联系电话
private String uPhone;
}
运行结果及报错内容
debug 时发现 user的属性 未接收到值