package org.springblade.modules.application.history.wrapper;

import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.application.history.pojo.entity.ApplicationHistoryEntity;
import org.springblade.modules.application.history.pojo.vo.ApplicationHistoryVO;

import java.util.Objects;

/**
 * 应用历史 包装类,返回视图层所需的字段
 *
 * @author BladeX
 * @since 2024-10-15
 */
public class ApplicationHistoryWrapper extends BaseEntityWrapper<ApplicationHistoryEntity, ApplicationHistoryVO> {

	public static ApplicationHistoryWrapper build() {
		return new ApplicationHistoryWrapper();
	}

	@Override
	public ApplicationHistoryVO entityVO(ApplicationHistoryEntity history) {
		ApplicationHistoryVO historyVO = Objects.requireNonNull(BeanUtil.copyProperties(history, ApplicationHistoryVO.class));
		//User createUser = UserCache.getUser(history.getCreateUser());
		//User updateUser = UserCache.getUser(history.getUpdateUser());
		//historyVO.setCreateUserName(createUser.getName());
		//historyVO.setUpdateUserName(updateUser.getName());
		return historyVO;
	}

}
