|
@@ -27,6 +27,7 @@ public class AdmResponse {
|
|
|
private String message;
|
|
|
/** 符合条件的总记录数 */
|
|
|
private Long total;
|
|
|
+ private Long count;
|
|
|
/** 页码 */
|
|
|
private Integer pageNumber;
|
|
|
/** 每页条数 */
|
|
@@ -35,15 +36,15 @@ public class AdmResponse {
|
|
|
private List<?> content;
|
|
|
|
|
|
public static AdmResponse success() {
|
|
|
- return new AdmResponse(SUCCESS, " ", 0L, 1, 500, null);
|
|
|
+ return new AdmResponse(SUCCESS, "", 0L,null, 1, 500, null);
|
|
|
}
|
|
|
|
|
|
public static AdmResponse failure(String message) {
|
|
|
- return new AdmResponse(FAILURE, message, null, null, null, null);
|
|
|
+ return new AdmResponse(FAILURE, message, null, null, null, null, null);
|
|
|
}
|
|
|
|
|
|
public static AdmResponse success(List<?> content) {
|
|
|
- return new AdmResponse(SUCCESS, " ", CollUtil.isEmpty(content) ? 0L :content.size()*1L, 1, 500, content);
|
|
|
+ return new AdmResponse(SUCCESS, "", CollUtil.isEmpty(content) ? 0L :content.size()*1L,null, 1, 500, content);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -63,6 +64,10 @@ public class AdmResponse {
|
|
|
Long total = dmpResult.getCount() == null ? null : dmpResult.getCount().longValue();
|
|
|
Integer pageNo = admRequest == null ? null : admRequest.getPageNumber();
|
|
|
Integer pageSize = admRequest == null ? null : admRequest.getPageSize();
|
|
|
- return new AdmResponse(SUCCESS, null, total, pageNo, pageSize, admVOs);
|
|
|
+ if(admRequest.isOnlyCount()){
|
|
|
+ return new AdmResponse(SUCCESS, null, null,total, pageNo, pageSize, admVOs);
|
|
|
+ }else {
|
|
|
+ return new AdmResponse(SUCCESS, null, total,null, pageNo, pageSize, admVOs);
|
|
|
+ }
|
|
|
}
|
|
|
}
|