检验错误没有返回
来源:6-11 买家订单-api_B
战神40
2020-03-15
"message": "could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement",
public static OrderDTO conver(OrderForm orderForm){
Gson gson=new Gson();
OrderDTO orderDTO=new OrderDTO();
orderDTO.setBuyerName(orderForm.getName());
orderDTO.setBuyerPhone(orderForm.getPhone());
// orderDTO.setBuyerAddress(orderForm.getAddress());
orderDTO.setBuyerOpenid(orderForm.getOpenid());
List orderDetailList=new ArrayList<>();
try {
orderDetailList= gson.fromJson(orderForm.getItems(),new TypeToken<List>(){}.getType());
}catch (Exception e){
log.error("[对象转换]错误,string={}",
orderForm.getItems());
throw new SellException(ResultEnum.PARAM_ERROR);
}
orderDTO.setOrderDetailList(orderDetailList);
return orderDTO;
}
注销 orderDTO.setBuyerAddress(orderForm.getAddress()); 这段。
@NotEmpty(message = “地址必填”)
private String address;
没有返回message的显示
写回答
1回答
-
廖师兄
2020-03-15
【没有返回message的显示】
现状是什么样,控制台报什么错,浏览器的界面显示什么?
032020-03-18
相似问题