package com.wdkl.ncs.android.middleware.tcp.channel;

import com.wdkl.ncs.android.middleware.tcp.dto.TcpModel;
import com.wdkl.ncs.android.middleware.tcp.enums.TcpAction;
import com.wdkl.ncs.android.middleware.tcp.enums.TcpType;

public class ImUtil {
    public static TcpModel imMsg(Integer fromId, String msg){
        TcpModel tcpModel = new TcpModel();
        tcpModel.setType(TcpType.IM);
        tcpModel.setAction(TcpAction.IMAction.MSG);
        tcpModel.setFromId(fromId);
        tcpModel.setData(msg);
        return tcpModel;
    }

    public static TcpModel imRead(Integer fromId, Integer toId, Integer msg){
        TcpModel tcpModel = new TcpModel();
        tcpModel.setType(TcpType.IM);
        tcpModel.setAction(TcpAction.IMAction.MSG_READ);
        tcpModel.setFromId(fromId);
        tcpModel.setToId(toId);
        tcpModel.setData(msg);
        return tcpModel;
    }
}
