Commit 9795a4c5 by WeiCong

1.对返回list字段,增加__data后缀配置规则,这样返回的list数据是集合,而不加则返回map(包含data属性和pagenation属性)

parent 6d498c6d
...@@ -231,6 +231,11 @@ public abstract class AbstractCommonController { ...@@ -231,6 +231,11 @@ public abstract class AbstractCommonController {
} }
private void doHandleReturnDataForModuleList(Alias alias, String aliasKey, Map<String, Object> dataMap, IModuleList moduleList, List<Map> lst, NoUiRequest noUiRequest) { private void doHandleReturnDataForModuleList(Alias alias, String aliasKey, Map<String, Object> dataMap, IModuleList moduleList, List<Map> lst, NoUiRequest noUiRequest) {
if(aliasKey.endsWith("__data")){
//直接返回结果集
dataMap.put(aliasKey, lst);
}else{
//对该list封装一层,data属性表示实际结果集;pagination属性(分页请求下才有)表示分页信息
Map<String, Object> item = new HashMap<>(); Map<String, Object> item = new HashMap<>();
//查询数据 //查询数据
item.put(Constants.DATA, lst); item.put(Constants.DATA, lst);
...@@ -254,6 +259,8 @@ public abstract class AbstractCommonController { ...@@ -254,6 +259,8 @@ public abstract class AbstractCommonController {
} }
} }
}
private Map<String, Object> handleReturnData(String eventType, NoUiContext context, NoUiRequest noUiRequest, Alias alias) { private Map<String, Object> handleReturnData(String eventType, NoUiContext context, NoUiRequest noUiRequest, Alias alias) {
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
// 初始化事件 // 初始化事件
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment