@PostMapping(value = "/addGirl")
public Result<Girl> girlAdd(@Valid Girl girl, BindingResult bindingResult) {
Result result = new Result();
if(bindingResult.hasErrors()) {
result.setCode("1");
result.setMsg(bindingResult.getFieldError().getDefaultMessage());
//result.setData(null);
} else {
girl.setCupSize(girl.getCupSize());
girl.setAge(girl.getAge());
result.setCode("0");
result.setMsg("添加成功");
result.setData(girlRepository.save(girl));
}
return result;
已经解决了。是因为之前在HttpAspect类中的doAfterRunning方法中做了一个类型强转