PageUtil.java 455 B

12345678910111213141516171819
  1. package com.poyee.utils;
  2. import cn.hutool.core.bean.BeanUtil;
  3. import com.github.pagehelper.PageInfo;
  4. import java.util.List;
  5. /**
  6. * @author huang_run
  7. * @date 2026/3/23 10:08
  8. */
  9. public class PageUtil {
  10. public static <T, R> PageInfo<R> convertPage(PageInfo<T> source, List<R> list) {
  11. PageInfo<R> target = new PageInfo<>();
  12. BeanUtil.copyProperties(source, target, "list");
  13. target.setList(list);
  14. return target;
  15. }
  16. }