package org.springblade.plugin.workflow.chat.wrapper;

import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.plugin.workflow.chat.core.cache.WfChatCache;
import org.springblade.plugin.workflow.chat.pojo.entity.WfChatAssistantEntity;
import org.springblade.plugin.workflow.chat.pojo.vo.WfChatAssistantVO;
import java.util.Objects;

/**
 * dify - 智能助理 包装类,返回视图层所需的字段
 *
 * @author ssc
 */
public class WfChatAssistantWrapper extends BaseEntityWrapper<WfChatAssistantEntity, WfChatAssistantVO>  {

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

	@Override
	public WfChatAssistantVO entityVO(WfChatAssistantEntity assistant) {
		WfChatAssistantVO chatApplicationVO = Objects.requireNonNull(BeanUtil.copyProperties(assistant, WfChatAssistantVO.class));
		chatApplicationVO.setApp(WfChatCache.getChatApp(chatApplicationVO.getAppId()));

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

		return chatApplicationVO;
	}


}
