Browse Source

update:分页数据属性名改为rows

tangfudong 2 years ago
parent
commit
9c6e07a7b3

+ 1 - 1
iot-common/iot-common-core/src/main/java/cc/iotkit/common/api/Paging.java

@@ -23,7 +23,7 @@ public class Paging<T> {
 
     private long total;
 
-    private List<T> data;
+    private List<T> rows;
 
     public <VO> Paging<VO> to(Class<VO> voClass) {
         return MapstructUtils.convert(this, voClass);

+ 2 - 2
iot-common/iot-common-core/src/main/java/cc/iotkit/common/utils/MapstructUtils.java

@@ -99,10 +99,10 @@ public class MapstructUtils {
         if (ObjectUtil.isNull(source)) {
             return null;
         }
-        if (CollUtil.isEmpty(source.getData())) {
+        if (CollUtil.isEmpty(source.getRows())) {
             return new Paging<>(0, new ArrayList<>());
         }
-        return new Paging<>(source.getTotal(), CONVERTER.convert(source.getData(), desc));
+        return new Paging<>(source.getTotal(), CONVERTER.convert(source.getRows(), desc));
     }
 
 }

+ 2 - 2
iot-common/iot-common-dao/iot-data-serviceImpl-cache/src/main/java/cc/iotkit/data/service/DeviceInfoDataCache.java

@@ -65,9 +65,9 @@ public class DeviceInfoDataCache implements IDeviceInfoData, SmartInitializingSi
                 pageRequest.setPageSize(1000);
                 pageRequest.setPageNum(page);
 
-                while ((paged = deviceInfoData.findAll(pageRequest)).getData().size() > 0) {
+                while ((paged = deviceInfoData.findAll(pageRequest)).getRows().size() > 0) {
                     pageRequest.setPageNum(page++);
-                    List<DeviceInfo> devices = paged.getData();
+                    List<DeviceInfo> devices = paged.getRows();
                     for (DeviceInfo device : devices) {
                         //装载设备信息缓存
                         deviceInfoCachePut.findByDeviceId(device.getDeviceId(), device);

+ 1 - 1
iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/impl/ProtocolServiceImpl.java

@@ -205,7 +205,7 @@ public class ProtocolServiceImpl implements IProtocolService {
     @Override
     public Paging<ProtocolComponentVo> selectPageList(PageRequest<ProtocolComponentBo> query) {
         Paging<ProtocolComponentVo> components = protocolComponentData.findAll(query.to(ProtocolComponent.class)).to(ProtocolComponentVo.class);
-        components.getData().forEach(c -> c.setState(
+        components.getRows().forEach(c -> c.setState(
                 componentManager.isRunning(c.getId()) ?
                         ProtocolComponent.STATE_RUNNING : ProtocolComponent.STATE_STOPPED
         ));

+ 1 - 1
iot-module/iot-rule-engine/src/main/java/cc/iotkit/ruleengine/rule/RuleManager.java

@@ -79,7 +79,7 @@ public class RuleManager {
             pageRequest.setPageNum(idx+=1);
             pageRequest.setPageSize(100);
             Paging<RuleInfo> all = ruleInfoData.findAll(pageRequest);
-            List<RuleInfo> rules = all.getData();
+            List<RuleInfo> rules = all.getRows();
             if(CollectionUtil.isEmpty(rules)){
                 return;
             }

+ 1 - 1
iot-module/iot-rule-engine/src/main/java/cc/iotkit/ruleengine/task/TaskManager.java

@@ -59,7 +59,7 @@ public class TaskManager implements ApplicationContextAware {
             pageRequest.setPageNum(idx+=1);
             pageRequest.setPageSize(100);
             Paging<TaskInfo> all = taskInfoData.findAll(pageRequest);
-            List<TaskInfo> tasks = all.getData();
+            List<TaskInfo> tasks = all.getRows();
             // 如果记录为空,直接跳出循环
             if (CollectionUtil.isEmpty(tasks)) {
                 break;