package ink.wgink.module.instantmessage.websocket.enums;

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: AppSocketTypeEnum
 * @Description: App Socket 类型
 * @Author: wanggeng
 * @Date: 2021/1/13 11:20 下午
 * @Version: 1.0
 */
public enum MessageTypeEnum {

    REGISTER(1000, "注册消息，body 为 RegisterBody 的 JSON 字符串"),
    LOGOUT(1001, "注销"),

    MESSAGE(2001, "文本消息"),
    MESSAGE_HREF(2002, "链接消息"),
    MESSAGE_IMAGE(2003, "图片消息"),
    MESSAGE_FILE(2004, "文件消息"),
    MESSAGE_AUDIO(2005, "音频消息"),
    MESSAGE_VIDEO(2006, "视频消息"),

    MESSAGE_GROUP(2101, "群发文本消息"),
    MESSAGE_GROUP_HREF(2102, "群发链接消息"),
    MESSAGE_GROUP_IMAGE(2103, "群发图片消息"),
    MESSAGE_GROUP_FILE(2104, "群发文件消息"),
    MESSAGE_GROUP_AUDIO(2105, "群发音频消息"),
    MESSAGE_GROUP_VIDEO(2106, "群发视频消息"),

    MESSAGE_SYSTEM(2201, "系统消息"),
    MESSAGE_SYSTEM_GROUP(2202, "系统群发消息"),
    MESSAGE_SYSTEM_TARGET(2203, "系统目标消息"),

    NOTICE(3001, "通知"),
    NOTICE_GROUP_MESSAGE(3002, "群通知"),
    NOTICE_TARGET_MESSAGE(3003, "目标通知，用于APP打开特定页面"),
    UPDATE_SERVICE_HANDLE_STATUS(3004, "更新业务的处理状态"),

    SEARCH_ONLINE_USER(4001, "查询全部在线用户，body 为查询用户的 userId"),
    SEARCH_ONLINE_USER_FRIEND(4002, "查询朋友在线用户，body 为查询用户的 userId"),
    SEARCH_COUNT_NEED_TO_DEALT_WITH(4003, "查询全部待办总数"),

    WEBRTC_CALL(5001, "webrtc呼叫"),
    WEBRTC_ANSWER(5002, "webrtc接听"),
    WEBRTC_REFUSE(5003, "webrtc拒绝"),
    WEBRTC_JOIN(5004, "webrtc加入"),

    // 消息状态
    STATUS_SEND(9001, "消息发送状态，body 为 MessageSendStatusBody 的 JSON 字符串"),
    STATUS_SEND_ONLINE(9002, "发送在线状态，body 为 在线用户的ID JSONArray 字符串"),
    STATUS_SEND_OFFLINE(9003, "发送离线状态，body 为 离线用户的ID JSONArray 字符串"),
    STATUS_RECEIVE(9101, "消息接受状态，body 自定义的交互内容");


    private int value;
    private String summary;

    MessageTypeEnum(int value, String summary) {
        this.value = value;
        this.summary = summary;
    }

    public int getValue() {
        return value;
    }

    public String getSummary() {
        return summary == null ? "" : summary.trim();
    }
}
