shikeyin
2024-01-11 65da8373531677b1c37a98f53eaa30c892f35e5a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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<String, Object> 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;
    }
}