package cn.sh.stc.sict.theme.config;

import cn.hutool.json.JSONUtil;
import cn.sh.stc.sict.theme.common.dto.SocketMsg;

import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;

public class ServerEncoder implements Encoder.Text<SocketMsg> {

    @Override
    public void destroy() {
        // TODO Auto-generated method stub

    }

    @Override
    public void init(EndpointConfig arg0) {
        // TODO Auto-generated method stub

    }

    @Override
    public String encode(SocketMsg msg) throws EncodeException {
        return JSONUtil.toJsonStr(msg);
    }

}
