@At
@Ok("json:{ignoreNull:false}") // 忽略空属性的json输出
@RequiresAuthentication
@AdaptBy(type = JsonAdaptor.class)
public Object applyTags(@Param("..") ApplyStoreTagVo vo) {
System.out.println(Json.toJson(vo));
try {
return Result.success("system.success");
} catch (Exception e) {
e.printStackTrace();
return Result.error("system.error");
}
}
vo对象如下:
public class ApplyStoreTagVo implements Serializable {
private static final long serialVersionUID = 817965134513205921L;
private String storeIds;// 店铺列表IDs
private List<TagVo> tags;
public String getStoreIds() {
return storeIds;
}
public void setStoreIds(String storeIds) {
this.storeIds = storeIds;
}
public List<TagVo> getTags() {
return tags;
}
public void setTags(List<TagVo> tags) {
this.tags = tags;
}
}
前端传递如下:
$.post("${base}/crm/store/applyTags", data, function (data) {
if (data.code == 0) {
$('#dataTable').bootstrapTable('refresh');
Toast.success(data.msg);
} else {
Toast.error(data.msg);
}
btn.button("reset");
dialog.modal("hide");
}, "json");
后台接收数据为空