This commit is contained in:
77
2024-03-25 20:52:18 +08:00
parent 8a89c53258
commit b8085e0416
16 changed files with 210 additions and 77 deletions

View File

@@ -0,0 +1,26 @@
package com.ruoyi.xq.util;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;
import java.util.List;
@Data
public class PageConvert {
public static <T,R> Page<T> convertEmpty(Page<R> page){
Page<T> result = new Page<>();
result.setTotal(page.getTotal());
result.setCurrent(page.getCurrent());
result.setSize(page.getSize());
return result;
}
public static <T,R> Page<T> convert(Page<R> page, List<T> record){
Page<T> result = new Page<>();
result.setTotal(page.getTotal());
result.setRecords(record);
result.setCurrent(page.getCurrent());
result.setSize(page.getSize());
return result;
}
}