2025年3月14日17:04:01
parent
2c6b5ae150
commit
6546b9c285
|
|
@ -26,6 +26,7 @@ public class QuestionDataLoad implements DataLoad {
|
|||
String userListData = HttpUtils.GET(API_URL + "/question/list",params);
|
||||
JSONObject jsonObject = JSON.parseObject(userListData);
|
||||
JSONArray data = jsonObject.getJSONArray("data");
|
||||
Integer total = jsonObject.getInteger("total");
|
||||
|
||||
List<Map<String, SimpleStringProperty>> questionMapList = new ArrayList<>();
|
||||
for (Object datum : data) {
|
||||
|
|
@ -37,6 +38,6 @@ public class QuestionDataLoad implements DataLoad {
|
|||
userMap.put("权限路径", new SimpleStringProperty(permission.getString("url")));
|
||||
questionMapList.add(userMap);
|
||||
}
|
||||
return new ApiUtils.DataView(Arrays.asList("序号", "权限名称", "描述", "权限路径"), questionMapList).setDataLoad(this);
|
||||
return new ApiUtils.DataView(Arrays.asList("序号", "权限名称", "描述", "权限路径"), questionMapList).setDataLoad(this).setPageNum(pageNum).setPageSize(pageSize).setTotal(total);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ public class RoleDataLoad implements DataLoad {
|
|||
String userListData = HttpUtils.GET(API_URL + "/role/list",params);
|
||||
JSONObject jsonObject = JSON.parseObject(userListData);
|
||||
JSONArray data = jsonObject.getJSONArray("data");
|
||||
Integer total = jsonObject.getInteger("total");
|
||||
List<Map<String, SimpleStringProperty>> roleMapList = new ArrayList<>();
|
||||
for (Object datum : data) {
|
||||
JSONObject role = (JSONObject) datum;
|
||||
|
|
@ -37,6 +38,6 @@ public class RoleDataLoad implements DataLoad {
|
|||
roleMap.put("角色类型", new SimpleStringProperty(role.getString("type_name")));
|
||||
roleMapList.add(roleMap);
|
||||
}
|
||||
return new ApiUtils.DataView(Arrays.asList("序号", "角色名称", "描述", "角色类型"), roleMapList).setDataLoad(this);
|
||||
return new ApiUtils.DataView(Arrays.asList("序号", "角色名称", "描述", "角色类型"), roleMapList).setDataLoad(this).setPageNum(pageNum).setPageSize(pageSize).setTotal(total);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ public class UserDataLoad implements DataLoad {
|
|||
String userListData = HttpUtils.GET(ApiUtils.API_URL + "/user/list",params);
|
||||
JSONObject jsonObject = JSON.parseObject(userListData);
|
||||
JSONArray data = jsonObject.getJSONArray("data");
|
||||
int total = jsonObject.getIntValue("total");
|
||||
List<Map<String, SimpleStringProperty>> userMapList = new ArrayList<>();
|
||||
for (Object datum : data) {
|
||||
JSONObject user = (JSONObject) datum;
|
||||
|
|
@ -36,7 +37,7 @@ public class UserDataLoad implements DataLoad {
|
|||
userMapList.add(userMap);
|
||||
}
|
||||
|
||||
ApiUtils.DataView dataView = new ApiUtils.DataView(Arrays.asList("序号", "用户名", "电子邮箱", "手机号码"), userMapList);
|
||||
ApiUtils.DataView dataView = new ApiUtils.DataView(Arrays.asList("序号", "用户名", "电子邮箱", "手机号码"), userMapList).setDataLoad(this).setPageNum(pageNum).setPageSize(pageSize).setTotal(total);
|
||||
dataView.setDataLoad(this);
|
||||
return dataView;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue