refactor: 项目代码重构,优化管理系统代码细节
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
package com.youlai.system.converter;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.youlai.system.pojo.entity.SysDictItem;
|
||||
import com.youlai.system.pojo.form.DictItemForm;
|
||||
import com.youlai.system.pojo.vo.DictItemPageVO;
|
||||
import com.youlai.system.pojo.entity.SysDict;
|
||||
import com.youlai.system.pojo.form.DictForm;
|
||||
import com.youlai.system.pojo.vo.DictPageVO;
|
||||
import org.mapstruct.InheritInverseConfiguration;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@@ -14,12 +14,12 @@ import org.mapstruct.Mapper;
|
||||
* @date 2022/6/8
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface DictItemConverter {
|
||||
public interface DictConverter {
|
||||
|
||||
Page<DictItemPageVO> entity2Page(Page<SysDictItem> page);
|
||||
Page<DictPageVO> entity2Page(Page<SysDict> page);
|
||||
|
||||
DictItemForm entity2Form(SysDictItem entity);
|
||||
DictForm entity2Form(SysDict entity);
|
||||
|
||||
@InheritInverseConfiguration(name="entity2Form")
|
||||
SysDictItem form2Entity(DictItemForm entity);
|
||||
SysDict form2Entity(DictForm entity);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.youlai.system.converter;
|
||||
|
||||
import com.youlai.system.pojo.entity.SysMenu;
|
||||
import com.youlai.system.pojo.form.MenuForm;
|
||||
import com.youlai.system.pojo.vo.MenuVO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@@ -13,6 +14,11 @@ import org.mapstruct.Mapper;
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface MenuConverter {
|
||||
|
||||
MenuVO entity2VO(SysMenu entity);
|
||||
MenuVO entity2Vo(SysMenu entity);
|
||||
|
||||
|
||||
MenuForm entity2Form(SysMenu entity);
|
||||
|
||||
SysMenu form2Entity(MenuForm menuForm);
|
||||
|
||||
}
|
||||
@@ -26,10 +26,12 @@ public interface RoleConverter {
|
||||
@Mapping(target = "value", source = "id"),
|
||||
@Mapping(target = "label", source = "name")
|
||||
})
|
||||
Option role2Option(SysRole role);
|
||||
Option entity2Option(SysRole role);
|
||||
|
||||
|
||||
List<Option> roles2Options(List<SysRole> roles);
|
||||
List<Option> entities2Options(List<SysRole> roles);
|
||||
|
||||
SysRole form2Entity(RoleForm roleForm);
|
||||
|
||||
RoleForm entity2Form(SysRole entity);
|
||||
}
|
||||
Reference in New Issue
Block a user