37 lines
819 B
Java
37 lines
819 B
Java
|
|
package com.senmesh.common.util;
|
||
|
|
|
||
|
|
import com.senmesh.common.dto.BaseDTO;
|
||
|
|
import com.senmesh.common.entity.BaseEntity;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 基础dto工具类
|
||
|
|
* @author sr on 2019-12-07
|
||
|
|
*/
|
||
|
|
public class BaseDtoUtils {
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 创建回写dto数据
|
||
|
|
* @param entity
|
||
|
|
* @param dto
|
||
|
|
* @author sr on 2019-12-07
|
||
|
|
*/
|
||
|
|
public static void createCopy(BaseEntity entity, BaseDTO dto) {
|
||
|
|
dto.setId(entity.getId());
|
||
|
|
dto.setDeleted(entity.getDeleted());
|
||
|
|
dto.setCreateTime(entity.getCreateTime());
|
||
|
|
dto.setCreateBy(entity.getCreateBy());
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 修改回写dto数据
|
||
|
|
* @param entity
|
||
|
|
* @param dto
|
||
|
|
* @author sr on 2019-12-07
|
||
|
|
*/
|
||
|
|
public static void updateCopy(BaseEntity entity, BaseDTO dto) {
|
||
|
|
dto.setUpdateTime(entity.getUpdateTime());
|
||
|
|
dto.setUpdateBy(entity.getUpdateBy());
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|