package org.springblade.manager.wrapper;

import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.manager.entity.WbsTreePrivate;
import org.springblade.manager.vo.WbsTreePrivateVO;
import java.util.Objects;

/**
 * 包装类,返回视图层所需的字段
 *
 * @author liuyc
 * @since 2022-05-24
 */
public class WbsTreePrivateWrapper extends BaseEntityWrapper<WbsTreePrivate, WbsTreePrivateVO> {
    public static WbsTreePrivateWrapper build() {
        return new WbsTreePrivateWrapper();
    }

    @Override
    public WbsTreePrivateVO entityVO(WbsTreePrivate wbsTree) {
        WbsTreePrivateVO wbsTreePrivateVO = Objects.requireNonNull(BeanUtil.copy(wbsTree, WbsTreePrivateVO.class));

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

        return wbsTreePrivateVO;
    }
}
