Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPage#convert新增整体列表转换功能, PageDTO新增Param参数 #6179

Closed
xiaoliuxuesheng opened this issue May 18, 2024 · 0 comments
Closed

Comments

@xiaoliuxuesheng
Copy link

  1. IPage#convert新增整体列表转换功能, 添加类似这个功能的转换方法, 支持page.getRecords()集合的整体转换方法
  public static <R, S> IPage<R> convert(IPage<S> page, Function<List<S>, List<R>> mapper) {
      IPage<R> pageVo = Page.of(page.getCurrent(), page.getSize(), page.getTotal());
      List<R> list = mapper.apply(page.getRecords());
      pageVo.setRecords(list);
      return pageVo;
  }
  1. PageDTO新增Param参数, PageDTO个人理解, 主要作用是用来作为分页查询时候做接口的数据传输, 请求参数位置定义在records属性语义不合理, 新增param属性存储请求对象
@Setter
@Getter
public class PageDTO<T> extends com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO<T> {
  private T param;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants