package com.qianwen.smartman.modules.system.convert; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import java.util.List; import org.mapstruct.Builder; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.Mappings; import org.mapstruct.factory.Mappers; import com.qianwen.smartman.modules.system.entity.Gallery; import com.qianwen.smartman.modules.system.vo.GalleryTreeVO; import com.qianwen.smartman.modules.system.vo.GalleryVO; @Mapper(builder = @Builder(disableBuilder = true)) public interface GalleryConvert { public static final GalleryConvert INSTANCE = (GalleryConvert) Mappers.getMapper(GalleryConvert.class); @Mappings({}) GalleryVO convert(Gallery gallery); @Mappings({@Mapping(source = "id", target = "id")}) Gallery convert(GalleryVO galleryVO); @Mappings({}) List convert(List list); @Mappings({}) List convertTree(List list); @Mappings({}) default IPage convert(IPage page) { Page page2 = new Page(page.getCurrent(), page.getSize(), page.getTotal()); page2.setRecords(convert(page.getRecords())); return page2; } }