refactor: 通知公告重构完成
This commit is contained in:
@@ -4,7 +4,8 @@ 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 com.youlai.boot.system.model.vo.NoticeDetailVO;
|
||||
import com.youlai.boot.system.model.vo.NoticePageVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.Mappings;
|
||||
@@ -18,22 +19,20 @@ import org.mapstruct.Mappings;
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface NoticeConverter{
|
||||
|
||||
|
||||
@Mappings({
|
||||
@Mapping(target = "tarIds", expression = "java(com.youlai.boot.common.util.CommonUtil.strToList(entity.getTarIds()))")
|
||||
@Mapping(target = "targetUserIds", expression = "java(cn.hutool.core.util.StrUtil.split(entity.getTargetUserIds(),\",\"))")
|
||||
})
|
||||
NoticeForm toForm(Notice entity);
|
||||
|
||||
@Mappings({
|
||||
@Mapping(target = "tarIds", expression = "java(com.youlai.boot.common.util.CommonUtil.listToStr(formData.getTarIds()))")
|
||||
@Mapping(target = "targetUserIds", expression = "java(cn.hutool.core.collection.CollUtil.join(formData.getTargetUserIds(),\",\"))")
|
||||
})
|
||||
Notice toEntity(NoticeForm formData);
|
||||
|
||||
NoticeVO toVO(Notice notice);
|
||||
NoticePageVO toPageVo(NoticeBO bo);
|
||||
|
||||
Page<NoticeVO> toPageVo(Page<NoticeBO> noticePage);
|
||||
|
||||
@Mappings({
|
||||
})
|
||||
NoticeVO toPageVo(NoticeBO bo);
|
||||
Page<NoticePageVO> toPageVo(Page<NoticeBO> noticePage);
|
||||
|
||||
NoticeDetailVO toDetailVO(NoticeBO noticeBO);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.mapstruct.Mappings;
|
||||
public interface UserConverter {
|
||||
|
||||
@Mappings({
|
||||
@Mapping(target = "genderLabel", expression = "java(com.youlai.boot.common.base.IBaseEnum.getLabelByValue(bo.getGender(), com.youlai.boot.common.enums.GenderEnum.class))")
|
||||
@Mapping(target = "genderLabel", expression = "java(com.youlai.boot.common.base.IBaseEnum.getLabelByValue(bo.getGender(), com.youlai.boot.system.enums.GenderEnum.class))")
|
||||
})
|
||||
UserPageVO toPageVo(UserBO bo);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user