package vip.xiaonuo.biz.modular.utils;

/**
 * @author liuqh
 * @date 2020-02-20 10:10
 * @description
 */
public class MsgUtil {

    public static final String MSGTYPE_EVENT = "event";//消息类型--事件
    public static final String MESSAGE_SUBSCIBE = "subscribe";//消息事件类型--订阅事件
    public static final String MESSAGE_UNSUBSCIBE = "unsubscribe";//消息事件类型--取消订阅事件
    public static final String MESSAGE_TEXT = "text";//消息类型--文本消息

    /**
     * 组装文本消息
     */
    public static String textMsg(String toUserName,String fromUserName,String content){
//        TextMsg text = new TextMsg();
//        text.setFromUserName(toUserName);
//        text.setToUserName(fromUserName);
//        text.setMsgType(MESSAGE_TEXT);
//        text.setCreateTime(new Date().getTime());
//        text.setContent(content);
//        return XmlUtil.textMsgToxml(text);
        return null;
    }

    /**
     * 响应订阅事件--回复文本消息
     */
    public static String subscribeForText(String toUserName,String fromUserName,String content){
        return textMsg(toUserName, fromUserName, content);
    }

    /**
     * 响应取消订阅事件
     */
    public static String unsubscribeForText(String toUserName,String fromUserName,String content){
        System.out.println("用户："+ fromUserName +"取消关注~");
        return "";
    }
}


