入口函数:
@At
@POST
@Ok("json")
public WdsReturns xzyd(@Param("..") XzydParam params) {
System.out.println("params:" + Json.toJson(params));
System.out.println("goods" + Json.toJson(params.getGoods()));
return wdsBizYyzxYdglService.xzyd(params);
}
请求测试:
Map<String, Object> params = new HashMap<String, Object>();
XzydParam param = new XzydParam();
List goods = new ArrayList();
LgtGoodsInfo good = new LgtGoodsInfo();
good.setGoodsPk(100L);
good.setPm("苹果");
goods.add(good);
param.setGoods(goods);
// params.put("params", Json.toJson(param, JsonFormat.tidy()));
params.put("params", param);
String result = Http.post(url, params, 1000);
输出结果:
params:{
"kdlx": 0,
"sfwd": 0,
"ddcs": 0,
"ysxl": 0,
"zdwd": 0,
"fhfClientPk": 0,
"shfClientPk": 0,
"jsfs": 0,
"dshk": 0.0,
"dsyf": 0.0,
"fk": 0.0,
"yf": 0,
"hkk": 0.0,
"xf": 0.0,
"tf": 0.0,
"hdf": 0.0,
"yj": 0.0,
"hj": 0.0,
"ysfs": 0,
"jhfs": 0,
"ywy": 0,
"dtzfh": 0,
"sentToFhf": 0,
"sentToShf": 0
}
goods:null
问题:为什么goods集合不能自动适配呢?