zhouhao преди 7 години
родител
ревизия
d85cf4a39d
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/PagerResult.java

+ 6 - 0
hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/PagerResult.java

@@ -22,11 +22,17 @@ package org.hswebframework.web.commons.entity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.util.Collections;
 import java.util.List;
 
 @ApiModel(description = "分页结果")
 public class PagerResult<E> implements Entity {
     private static final long serialVersionUID = -6171751136953308027L;
+
+    public static <E> PagerResult<E> empty(){
+        return new PagerResult<>(0, Collections.emptyList());
+    }
+
     private int total;
 
     private List<E> data;