linpeilie / mapstruct-plus

MapStruct Plus is an enhancement to the MapStruct framework. It can automatically generate the transformation operation between two classes through an annotation, omitting the operation of defining the interface of MapStruct, makes Java type conversion easy and elegant.
https://mapstruct.plus/
Apache License 2.0
225 stars 17 forks source link

这种Page的复杂类型怎么转换 #91

Open yongoe1024 opened 5 days ago

yongoe1024 commented 5 days ago

Page page = sysConfigService.selectByPage(); Page vo = converter.convert(page, SysConfigVo.class);

Page的类型如下 public class Page{ protected List records; protected long total; protected long size; }

linpeilie commented 5 days ago

Page 声明构造对象,传入这三个参数,其中 list 调用转换逻辑转换成需要的对象即可