标签:json value log sync ltm gre bin customer get
@Valid @RequestBody CustomerDto customerBean
@RequestMapping(value="/customerDataSync.do",method=RequestMethod.POST)
public BaseResultMessage customerDataSync(@Valid @RequestBody CustomerDto customerBean, BindingResult errorResult) {
logger.info("==> 客户数据同步:接收到参数:"+customerBean.toString());
BaseResultMessage rm = new BaseResultMessage();
Map<String,Object> errorMap = ValidatorUtils.fieldValidate(errorResult);
String er ="";
if(errorMap!=null) {
for(String key:errorMap.keySet()) {
er = errorMap.get(key)+",";
}
rm.setType(false);
rm.setMsg(er);
logger.error("==>"+rm.toString());
return rm;
}
rm = customerService.updateCustomerData(customerBean);
logger.info("==> 客户数据同步:返回数据:"+rm.toString());
return rm;
}
参考页:http://langmnm.iteye.com/blog/2078439
ng mvc + @Valid + @RequestBody 接收json同时校验javaBean的数据有效性
标签:json value log sync ltm gre bin customer get
原文地址:https://www.cnblogs.com/gzhbk/p/9789230.html