Browse Source

增加返回结果默认的值:分页信息,条数

lvxianyun 3 years ago
parent
commit
b182bb55fd
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/main/java/com/persagy/proxy/adm/request/AdmResponse.java

+ 2 - 1
src/main/java/com/persagy/proxy/adm/request/AdmResponse.java

@@ -1,5 +1,6 @@
 package com.persagy.proxy.adm.request;
 
+import cn.hutool.core.collection.CollUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.persagy.proxy.adm.utils.AdmEntityTransferUtil;
 import com.persagy.proxy.common.entity.DmpResult;
@@ -42,7 +43,7 @@ public class AdmResponse {
     }
 
     public static AdmResponse success(List<?> content) {
-        return new AdmResponse(SUCCESS, null, content.size()*1L, 1, 500, content);
+        return new AdmResponse(SUCCESS, null, CollUtil.isEmpty(content) ? 0L :content.size()*1L, 1, 500, content);
     }
 
     /**