update 替换BeanCopyUtil用法使用mapstruct
parent
5777e8c5ad
commit
49a8e2fd8f
@ -0,0 +1,25 @@
|
|||||||
|
package org.dromara.common.log.domain.convert;
|
||||||
|
|
||||||
|
import org.dromara.common.log.event.OperLogEvent;
|
||||||
|
import org.dromara.system.api.domain.bo.RemoteOperLogBo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.Mapping;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志转换器
|
||||||
|
* @author zhujie
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface OperLogEventConvert {
|
||||||
|
|
||||||
|
OperLogEventConvert INSTANCE = Mappers.getMapper(OperLogEventConvert.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OperLogEventToRemoteOperLogBo
|
||||||
|
* @param operLogEvent 待转换对象
|
||||||
|
* @return 转换后对象
|
||||||
|
*/
|
||||||
|
@Mapping(target = "params", ignore = true)
|
||||||
|
RemoteOperLogBo convert(OperLogEvent operLogEvent);
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package org.dromara.system.domain.convert;
|
||||||
|
|
||||||
|
import org.dromara.system.api.domain.vo.RemoteDictDataVo;
|
||||||
|
import org.dromara.system.domain.vo.SysDictDataVo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典数据转换器
|
||||||
|
* @author zhujie
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SysDictDataVoConvert {
|
||||||
|
|
||||||
|
SysDictDataVoConvert INSTANCE = Mappers.getMapper(SysDictDataVoConvert.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SysDictDataVoToRemoteDictDataVo
|
||||||
|
* @param sysDictDataVo 待转换对象
|
||||||
|
* @return 转换后对象
|
||||||
|
*/
|
||||||
|
RemoteDictDataVo convert(SysDictDataVo sysDictDataVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SysDictDataVoListToRemoteDictDataVoList
|
||||||
|
* @param sysDictDataVos 待转换对象
|
||||||
|
* @return 转换后对象
|
||||||
|
*/
|
||||||
|
List<RemoteDictDataVo> convertList(List<SysDictDataVo> sysDictDataVos);
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package org.dromara.system.domain.convert;
|
||||||
|
|
||||||
|
import org.dromara.system.api.domain.bo.RemoteLogininforBo;
|
||||||
|
import org.dromara.system.domain.bo.SysLogininforBo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录日志转换器
|
||||||
|
* @author zhujie
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SysLogininforBoConvert {
|
||||||
|
|
||||||
|
SysLogininforBoConvert INSTANCE = Mappers.getMapper(SysLogininforBoConvert.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RemoteLogininforBoToSysLogininforBo
|
||||||
|
* @param remoteLogininforBo 待转换对象
|
||||||
|
* @return 转换后对象
|
||||||
|
*/
|
||||||
|
SysLogininforBo convert(RemoteLogininforBo remoteLogininforBo);
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
package org.dromara.system.domain.convert;
|
||||||
|
|
||||||
|
import org.dromara.system.api.domain.bo.RemoteOperLogBo;
|
||||||
|
import org.dromara.system.domain.bo.SysOperLogBo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.Mapping;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志转换器
|
||||||
|
* @author zhujie
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SysOperLogBoConvert {
|
||||||
|
|
||||||
|
SysOperLogBoConvert INSTANCE = Mappers.getMapper(SysOperLogBoConvert.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RemoteOperLogBoToSysOperLogBo
|
||||||
|
* @param remoteOperLogBo 待转换对象
|
||||||
|
* @return 转换后对象
|
||||||
|
*/
|
||||||
|
@Mapping(target = "businessTypes", ignore = true)
|
||||||
|
SysOperLogBo convert(RemoteOperLogBo remoteOperLogBo);
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package org.dromara.system.domain.convert;
|
||||||
|
|
||||||
|
import org.dromara.system.api.domain.vo.RemoteTenantVo;
|
||||||
|
import org.dromara.system.domain.vo.SysTenantVo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户转换器
|
||||||
|
* @author zhujie
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SysTenantVoConvert {
|
||||||
|
|
||||||
|
SysTenantVoConvert INSTANCE = Mappers.getMapper(SysTenantVoConvert.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SysTenantVoToRemoteTenantVo
|
||||||
|
* @param sysTenantVo 待转换对象
|
||||||
|
* @return 转换后对象
|
||||||
|
*/
|
||||||
|
RemoteTenantVo convert(SysTenantVo sysTenantVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SysTenantVoListToRemoteTenantVoList
|
||||||
|
* @param sysTenantVos 待转换对象
|
||||||
|
* @return 转换后对象
|
||||||
|
*/
|
||||||
|
List<RemoteTenantVo> convertList(List<SysTenantVo> sysTenantVos);
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package org.dromara.system.domain.convert;
|
||||||
|
|
||||||
|
import org.dromara.system.api.domain.bo.RemoteUserBo;
|
||||||
|
import org.dromara.system.domain.bo.SysUserBo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.Mapping;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户信息转换器
|
||||||
|
* @author zhujie
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SysUserBoConvert {
|
||||||
|
|
||||||
|
SysUserBoConvert INSTANCE = Mappers.getMapper(SysUserBoConvert.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RemoteUserBoToSysUserBo
|
||||||
|
* @param remoteUserBo 待转换对象
|
||||||
|
* @return 转换后对象
|
||||||
|
*/
|
||||||
|
@Mapping(target = "roleIds", ignore = true)
|
||||||
|
@Mapping(target = "postIds", ignore = true)
|
||||||
|
SysUserBo convert(RemoteUserBo remoteUserBo);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue