package com.iplatform.chat.support; import com.iplatform.chat.ChatEngine; import com.iplatform.chat.ChatService; import com.iplatform.chat.ChatSession; import com.iplatform.chat.ChatSessionCache; import com.iplatform.chat.service.ChatDialogServiceImpl; import com.iplatform.chat.util.ChatUtils; import com.iplatform.model.po.ChatDialog; import com.iplatform.model.vo.ChatVo; import com.walker.infrastructure.utils.DateUtils; @Deprecated public class SimpleChatEngine extends ChatEngine { @Override protected boolean saveChatData(ChatVo chatVo) { this.chatService.execInsertChat(chatVo); return true; } @Override protected ChatSession createChatDialog(long chatDialogId, ChatVo chatVo) { ChatDialog chatDialog = new ChatDialog(); chatDialog.setId(chatDialogId); chatDialog.setCreateTime(DateUtils.getDateTimeNumber()); chatDialog.setCustomerService(chatVo.getCustomerService()); chatDialog.setUserId(chatVo.getMe()); chatDialog.setBizId(chatVo.getBizId()); chatDialog.setEndTime(0l); this.chatDialogService.insert(chatDialog); ChatSession session = ChatUtils.acquireChatSession(chatDialog); this.chatSessionCache.save(session); return session; } @Override protected ChatSession acquireChatDialog(long chatDialogId) { return this.chatSessionCache.get(chatDialogId); } public void setChatSessionCache(ChatSessionCache chatSessionCache) { this.chatSessionCache = chatSessionCache; } public void setChatDialogService(ChatDialogServiceImpl chatDialogService) { this.chatDialogService = chatDialogService; } public void setChatService(ChatService chatService) { this.chatService = chatService; } private ChatService chatService; private ChatDialogServiceImpl chatDialogService; private ChatSessionCache chatSessionCache; }