package org.springblade.modules.externalLog.wrapper;

import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.externalLog.entity.ExternalLogEntity;
import org.springblade.modules.externalLog.vo.ExternalLogVO;

import java.util.Objects;

/**
 * 对外日志 包装类,返回视图层所需的字段
 *
 * @author BladeX
 * @since 2024-01-10
 */
public class ExternalLogWrapper extends BaseEntityWrapper<ExternalLogEntity, ExternalLogVO> {

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

	@Override
	public ExternalLogVO entityVO(ExternalLogEntity extemalLog) {
		ExternalLogVO extemalLogVO = Objects.requireNonNull(BeanUtil.copy(extemalLog, ExternalLogVO.class));

		//User createUser = UserCache.getUser(extemalLog.getCreateUser());
		//User updateUser = UserCache.getUser(extemalLog.getUpdateUser());
		//extemalLogVO.setCreateUserName(createUser.getName());
		//extemalLogVO.setUpdateUserName(updateUser.getName());

		return extemalLogVO;
	}

}
