wip: 通知公告开发临时提交
通知公告开发临时提交
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
package com.youlai.boot.system.converter;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.youlai.boot.system.model.bo.NoticeBO;
|
||||
import com.youlai.boot.system.model.entity.Notice;
|
||||
import com.youlai.boot.system.model.form.NoticeForm;
|
||||
import com.youlai.boot.system.model.vo.NoticeVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.Mappings;
|
||||
|
||||
/**
|
||||
* 通知公告对象转换器
|
||||
@@ -14,9 +18,23 @@ import org.mapstruct.Mapper;
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface NoticeConverter{
|
||||
|
||||
@Mappings({
|
||||
@Mapping(target = "tarIds", expression = "java(com.youlai.boot.common.util.CommonUtil.strToList(entity.getTarIds()))")
|
||||
})
|
||||
NoticeForm toForm(Notice entity);
|
||||
|
||||
@Mappings({
|
||||
@Mapping(target = "tarIds", expression = "java(com.youlai.boot.common.util.CommonUtil.listToStr(formData.getTarIds()))")
|
||||
})
|
||||
Notice toEntity(NoticeForm formData);
|
||||
|
||||
NoticeVO toVO(Notice notice);
|
||||
|
||||
Page<NoticeVO> toPageVo(Page<NoticeBO> noticePage);
|
||||
|
||||
@Mappings({
|
||||
@Mapping(target = "noticeTypeLabel", expression = "java(com.youlai.boot.common.base.IBaseEnum.getLabelByValue(bo.getNoticeType(), com.youlai.boot.common.enums.NoticeTypeEnum.class))")
|
||||
})
|
||||
NoticeVO toPageVo(NoticeBO bo);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user