/**
 * BladeX Commercial License Agreement
 * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
 * <p>
 * Author: Chill Zhuang (bladejava@qq.com)
 */
package org.springblade.transport.wrapper;

import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.system.cache.UserCache;
import org.springblade.transport.pojo.entity.EtcRecord;
import org.springblade.transport.pojo.vo.EtcRecordVO;

import java.util.Objects;

/**
 * ETC记录包装类
 *
 * @author Chill
 */
public class EtcRecordWrapper extends BaseEntityWrapper<EtcRecord, EtcRecordVO> {

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

	@Override
	public EtcRecordVO entityVO(EtcRecord etcRecord) {
		EtcRecordVO etcRecordVO = Objects.requireNonNull(BeanUtil.copyProperties(etcRecord, EtcRecordVO.class));
		etcRecordVO.setUpdateUserName(UserCache.getUserRealName(etcRecord.getUpdateUser()));
		return etcRecordVO;
	}

}
