package com.qianwen.smartman.modules.notify.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.Mappings;
|
import org.mapstruct.factory.Mappers;
|
import com.qianwen.smartman.modules.notify.dto.Notification;
|
import com.qianwen.smartman.modules.notify.entity.NotificationEntity;
|
|
@Mapper(builder = @Builder(disableBuilder = true))
|
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/convert/NotificationConvert.class */
|
public interface NotificationConvert {
|
public static final NotificationConvert INSTANCE = (NotificationConvert) Mappers.getMapper(NotificationConvert.class);
|
|
@Mappings({})
|
NotificationEntity convertToEntity(Notification sources);
|
|
@Mappings({})
|
Notification convertToDto(NotificationEntity sources);
|
|
@Mappings({})
|
List<Notification> convertToDTOList(List<NotificationEntity> sources);
|
|
@Mappings({})
|
default IPage<Notification> convertToPage(IPage<NotificationEntity> doiPage) {
|
List<NotificationEntity> records = doiPage.getRecords();
|
List<Notification> boRecords = convertToDTOList(records);
|
Page page = new Page(doiPage.getCurrent(), doiPage.getSize(), doiPage.getTotal());
|
page.setRecords(boRecords);
|
return page;
|
}
|
}
|