package com.iplatform.chat.util.ws; import com.iplatform.chat.Constants; import com.iplatform.chat.util.ChatUtils; import com.iplatform.model.vo.ChatVo; import com.walker.tcp.websocket.JsonResponse; import java.util.Map; public class ChatResponse extends JsonResponse { private ChatVo chatVo; public void setChatVo(ChatVo chatVo){ this.chatVo = chatVo; } public ChatResponse(){} @Override protected void translateProperties(Map result) { if(chatVo == null){ throw new IllegalArgumentException("chatVo is required!"); } result.put("data", ChatUtils.acquireChatViewVo(this.chatVo)); } @Override public String getProtocolNum() { return Constants.PROTOCOL_CHAT; } }