# ImSdk 接口文档 (version 1.1.1)

## 环境配制
### 1.引入文件

#### 1.1.script标签引入

```html
    <script type="text/javascript" src="{sdk}/zby_im_sdk.js"></script>
```

#### 1.2.npm+import引入

```javascript
    // 安装
    npm i -D zby_im_sdk

    // 引入
    import ImSdk from "zby_im_sdk";
```

#### 1.3.requirejs引入

```javascript
    require(["{sdk}/zby_im_sdk.js"], function (ImSdk) {});
```
 
### 1.4.使用
    
```javascript
    // 创建ImSdk对象
    let im = new ImSdk(options);

    // 绑定监听事件
    im.on("handlerConnected", function () {});

    // 初始化SDK
    im.initIm();
```

注：

（1）       客户端发送的authenticate事件 和客户端接收的事件unauthorized和authenticated事件与原来保持一致；

（2）       每个命名空间的join_room、leave_room、disconnect一致，只在control中列出；

（3）       所有字段必须填充，不需要该字段可以置为空；

（4）       输入、输出字段名整理为一致，所以客户端emit事件的参数名大都做了调整

（5）       带删除线的是去掉的字段

（6）       字段名全部为小写

（7）       除authenticate 事件外，emit都带Callback回调，回调的参数定义为：

    "ack_status": {
        OK: {
            code: 0,
            message: "OK"
        },

        INTERNAL_ERROR: {
            code: 401,
            message: "服务器内部错误"
        },

        PERMISSION_DENY: {
            code: 201,
            message: "用户无权限"
        },

        PARAMETER_ERROR: {
            code: 201,
            message: "参数错误"
        }

        FAILED: {
            code: 400,
            message: "请求失败"
        }
    }
 
#### 2.1 control（on/emit事件）

<table>
    <tbody>
        <tr>
            <td>事件</td>
            <td>原版事件</td>
            <td colspan="3">参数</td>
            <td>类型</td>
            <td>说明</td>
        </tr>
        <tr>
            <td rowspan="9">join_room客户端emit</td>
            <td rowspan="9">join_room事件</td>
            <td colspan="5">加入房间（大班课web相关）</td>
        </tr>
        <tr>
            <td colspan="3">userid</td>
            <td>string</td>
            <td>原user_id</td>
        </tr>
        <tr>
            <td colspan="3">username</td>
            <td>string</td>
            <td>原message</td>
        </tr>
        <tr>
            <td colspan="3">role</td>
            <td>string</td>
            <td>"1”=teacher;"2”=student;"3”=parent</td>
        </tr>
        <tr>
            <td colspan="3">avatar</td>
            <td>string</td>
            <td>头像</td>
        </tr>
        <tr>
            <td colspan="3">room</td>
            <td>string</td>
            <td>房间号</td>
        </tr>
        <tr>
            <td colspan="3">playmode</td>
            <td>string</td>
            <td>原: flag ：1=正常上课；2=回放</td>
        </tr>
        <tr>
            <td colspan="3">device</td>
            <td>int</td>
            <td>//0 - 默认；1 - PC客户端；2 - PC web；3 - 移动 web；4 - 移动 APP；</td>
        </tr>
        <tr>
            <td colspan="3">instid</td>
            <td>int</td>
            <td>0=不需要返回历史消息；1=返回最近的50</td>
        </tr>
        <tr>
            <td rowspan="2">Callback回调</td>
            <td rowspan="2"></td>
            <td colspan="3">code</td>
            <td>int</td>
            <td>错误码</td>
        </tr>
        <tr>
            <td colspan="3">message</td>
            <td>string</td>
            <td>错误消息</td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="2">leave_room客户端emit</td>
            <td rowspan="2">logout事件</td>
            <td colspan="5">离开房间（大班课web相关）</td>
        </tr>
        <tr>
            <td colspan="3">不需要参数&nbsp;</td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>Callback回调</td>
            <td></td>
            <td colspan="5">通用格式</td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="7">stream客户端emit</td>
            <td rowspan="7">(1)send_message事件，以特殊前缀的形式“stream-*”标识的消息(2)private_message事件的mtype为stream的定向消息</td>
            <td colspan="5">发送流相关的控制消息，本通道内保序（大班课web相关）此处商量一下，如果不需要，web端可不发join消息</td>
        </tr>
        <tr>
            <td colspan="3">index</td>
            <td>int</td>
            <td>递增的序号</td>
        </tr>
        <tr>
            <td colspan="3">uuid</td>
            <td>string</td>
            <td>消息唯一标识：userid_userrole_index_timestamp其中，timestamp为毫秒</td>
        </tr>
        <tr>
            <td colspan="3">mtype</td>
            <td>string</td>
            <td>消息子类型</td>
        </tr>
        <tr>
            <td colspan="3">targetid</td>
            <td>string</td>
            <td>原private_id：为””时为广播</td>
        </tr>
        <tr>
            <td colspan="3">message</td>
            <td>string</td>
            <td>以JSON串传递</td>
        </tr>
        <tr>
            <td colspan="3">save</td>
            <td>string</td>
            <td>‘0’=不保存，&gt;’ 1’=保存，按数字大小降序返回</td>
        </tr>
        <tr>
            <td rowspan="2">Callback回调</td>
            <td rowspan="2"></td>
            <td colspan="2">code</td>
            <td colspan="2">int</td>
            <td>错误码</td>
        </tr>
        <tr>
            <td colspan="2">message</td>
            <td colspan="2">string</td>
            <td>错误消息</td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="2">netstate客户端emit</td>
            <td rowspan="2">原control_message</td>
            <td colspan="5">客户端周期同步网络质量</td>
        </tr>
        <tr>
            <td colspan="2">message</td>
            <td colspan="2">string</td>
            <td>消息体json串</td>
        </tr>
        <tr>
            <td>Callback回调</td>
            <td></td>
            <td colspan="5">通用格式</td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="2">listeners客户端emit</td>
            <td rowspan="2"></td>
            <td colspan="5">获取当前在线学生列表（仅老师和监课老师身份的才可请求）</td>
        </tr>
        <tr>
            <td colspan="2">无参数</td>
            <td colspan="2"></td>
            <td></td>
        </tr>
        <tr>
            <td>Callback回调</td>
            <td></td>
            <td colspan="5">通用格式</td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="2">history_message客户端emit</td>
            <td></td>
            <td colspan="5">请求stream事件的历史消息（大班课web相关）开始上课、结束上课的历史消息</td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2">无参数</td>
            <td colspan="2"></td>
            <td></td>
        </tr>
        <tr>
            <td rowspan="3">Callback回调</td>
            <td></td>
            <td colspan="2">code</td>
            <td colspan="2">int</td>
            <td>0=ok</td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2">data</td>
            <td colspan="2">对象</td>
            <td>数据</td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2">data. history_list</td>
            <td colspan="2">数组</td>
            <td>消息数组，每个消息的消息体和on(‘stream’)相同</td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="2">cache_message客户端emit</td>
            <td></td>
            <td colspan="5">在掉线重连后，请求服务器端缓存的stream消息，请求后，服务器端开始向发起请求的客户端发送其离线期间的缓存消息，发送完成后，此事件收到回调</td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2">uuid</td>
            <td colspan="2">string</td>
            <td>离线前，收到的最后一条消息的uuid</td>
        </tr>
        <tr>
            <td>Callback回调</td>
            <td></td>
            <td colspan="5">通用格式</td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="7">join_room客户端 on</td>
            <td rowspan="7">原message事件mtype为joined_message</td>
            <td colspan="5">接收其他人进入教室的通知</td>
        </tr>
        <tr>
            <td colspan="3">unixtime</td>
            <td>string</td>
            <td>原unixTime且改为字符串了哈</td>
        </tr>
        <tr>
            <td colspan="3">userid</td>
            <td>string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">username</td>
            <td>string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">role</td>
            <td>string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">avatar</td>
            <td>string</td>
            <td>头像</td>
        </tr>
        <tr>
            <td colspan="3">onlinecounts</td>
            <td>int</td>
            <td>原membersnum：当前在线人数</td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="6">leave_room客户端 on</td>
            <td rowspan="6">原message事件mtype为logout_message</td>
            <td colspan="5">其他人离开教室的通知</td>
        </tr>
        <tr>
            <td colspan="3">unixtime</td>
            <td>string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">userid</td>
            <td>string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">username</td>
            <td>string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">role</td>
            <td>string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">onlinecounts</td>
            <td>int</td>
            <td>原membersnum：当前在线人数</td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="9">stream客户端 on</td>
            <td rowspan="8">原message事件的mtype 为message中，加特殊前缀“stream-*”的部分</td>
            <td colspan="5">接收流控制消息（大班课web相关）关心mtype =class的消息，开始上课和结束上课消息体格式改为json串了，参见程序</td>
        </tr>
        <tr>
            <td colspan="3">unixtime</td>
            <td>string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">index</td>
            <td>int</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">uuid</td>
            <td>string</td>
            <td>消息唯一id</td>
        </tr>
        <tr>
            <td colspan="3">mtype</td>
            <td>string</td>
            <td>为class时，代表是开始上课/结束上课消息为stream时，是其他流控制消息</td>
        </tr>
        <tr>
            <td colspan="3">userid</td>
            <td>string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">role</td>
            <td>string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">message</td>
            <td>string</td>
            <td></td>
        </tr>
        <tr>
            <td></td>
            <td colspan="3">cache</td>
            <td>int</td>
            <td>有cache，且cache字段为1代表此条消息为服务器缓存消息。客户端断线重连后，会向服务器端请求缓存消息，服务器会回放该消息。</td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="2">netstate客户端 on</td>
            <td rowspan="2">原control_message</td>
            <td colspan="5">接收别的客户端的网络状态</td>
        </tr>
        <tr>
            <td colspan="3">message</td>
            <td>string</td>
            <td>消息体</td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="2">award客户端 on</td>
            <td rowspan="2"></td>
            <td colspan="5">收到奖励</td>
        </tr>
        <tr>
            <td colspan="3">待定</td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="2">force_exit客户端 on</td>
            <td rowspan="2"></td>
            <td colspan="5">同一账号，再次进入房间，前面进入房间的收到此事件</td>
        </tr>
        <tr>
            <td colspan="3">无参数</td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="2">room_expired客户端 on</td>
            <td rowspan="2"></td>
            <td colspan="5">课程自动下课后，服务器发送此事件</td>
        </tr>
        <tr>
            <td colspan="3">无参数</td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="5">supervisor客户端on</td>
            <td rowspan="5">原事件supervisor_state</td>
            <td colspan="5">接收服务器推送的监课状态：当前只有求助后的处理结果</td>
        </tr>
        <tr>
            <td colspan="3">mtype</td>
            <td>string</td>
            <td>help_state=求助结果</td>
        </tr>
        <tr>
            <td colspan="3">message</td>
            <td>string</td>
            <td>不同mtype对应不同的json串</td>
        </tr>
        <tr>
            <td colspan="3">unixtime</td>
            <td>string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="5"><strong>备注：</strong>mtype为help_state时（求助）message为json串，包含以下字段：userid (string)lessonid
                (string)supervisorStatus (int)supervisorResolve (int)</td>
        </tr>
        <tr>
            <td rowspan="5">listeners客户端on</td>
            <td rowspan="5"></td>
            <td colspan="5">请求在线列表后，服务器端返回在线列表</td>
        </tr>
        <tr>
            <td>返回数组，以下为数组中单个对象的参数</td>
            <td colspan="3">[]</td>
            <td><strong>&nbsp;</strong></td>
        </tr>
        <tr>
            <td>userid</td>
            <td colspan="3">string</td>
            <td><strong>&nbsp;</strong></td>
        </tr>
        <tr>
            <td>username</td>
            <td colspan="3">string</td>
            <td><strong>&nbsp;</strong></td>
        </tr>
        <tr>
            <td>avatar</td>
            <td colspan="3">string</td>
            <td><strong>&nbsp;</strong></td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="6">offline</td>
            <td rowspan="6">原message事件的mtype 为disconnect_message</td>
            <td colspan="5">其他用户掉线的提示，主动离开房间、网络断开都会发送此消息（大班课web相关）</td>
        </tr>
        <tr>
            <td colspan="3">unixtime</td>
            <td>string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">userid</td>
            <td>string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">username</td>
            <td>string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">role</td>
            <td>string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">onlinecounts</td>
            <td>int</td>
            <td>原membersNum 当前在线人数</td>
        </tr>
    </tbody>
</table>

#### 2.2 chat（on/emit事件）
 
<table>
    <tbody>
        <tr>
            <td>命名空间版事件</td>
            <td>原版事件</td>
            <td>参数</td>
            <td>类型</td>
            <td>说明</td>
        </tr>
        <tr>
            <td rowspan="6">message客户端emit</td>
            <td rowspan="6">send_message</td>
            <td colspan="3">发送普通聊天消息，包括：文本、图片（大班课web相关）</td>
        </tr>
        <tr>
            <td>index</td>
            <td>int</td>
            <td></td>
        </tr>
        <tr>
            <td>mtype</td>
            <td>string</td>
            <td>消息子类型：message = 文本消息picture = 图片</td>
        </tr>
        <tr>
            <td>targetid</td>
            <td>string</td>
            <td>指定接收者id，暂时不需要填充本字段</td>
        </tr>
        <tr>
            <td>message</td>
            <td>string</td>
            <td>以JSON串传递</td>
        </tr>
        <tr>
            <td>save</td>
            <td>string</td>
            <td>‘0’=不保存，’1’=保存</td>
        </tr>
        <tr>
            <td>Callback回调</td>
            <td></td>
            <td colspan="3">通用格式</td>
        </tr>
        <tr>
            <td colspan="5"></td>
        </tr>
        <tr>
            <td rowspan="3">notice客户端emit</td>
            <td rowspan="3">notice</td>
            <td colspan="3">老师端发送公告</td>
        </tr>
        <tr>
            <td>index</td>
            <td>int</td>
            <td>原来没有参数，现在改为这些参数</td>
        </tr>
        <tr>
            <td>message</td>
            <td>string</td>
            <td>之前发送的内容改为这个</td>
        </tr>
        <tr>
            <td>Callback回调</td>
            <td></td>
            <td colspan="3">通用格式</td>
        </tr>
        <tr>
            <td colspan="5"></td>
        </tr>
        <tr>
            <td rowspan="2">get_notice客户端emit</td>
            <td rowspan="2"></td>
            <td colspan="3">进入教室后，请求服务器端保存的公告</td>
        </tr>
        <tr>
            <td>无参数</td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>Callback回调</td>
            <td></td>
            <td>data.notice</td>
            <td>string</td>
            <td>公告内容</td>
        </tr>
        <tr>
            <td colspan="5"></td>
        </tr>
        <tr>
            <td rowspan="2">history_message客户端 emit</td>
            <td rowspan="2">history_message</td>
            <td colspan="3">向服务器端请求获取历史消息</td>
        </tr>
        <tr>
            <td>msgid</td>
            <td>string</td>
            <td>原last_id :上次请求的最后一条的id，为空时，代表请求最近的50条消息</td>
        </tr>
        <tr>
            <td rowspan="5">Callback回调</td>
            <td rowspan="5"></td>
            <td>code</td>
            <td>int</td>
            <td>0=ok</td>
        </tr>
        <tr>
            <td>data</td>
            <td>对象</td>
            <td></td>
        </tr>
        <tr>
            <td>data. history_list</td>
            <td>历史消息的数组</td>
            <td>数组的单个元素和on(‘message’)返回的相同，除多一个参数_id，标识消息位置，emit请求时，将上次收到的最早一条消息的_id赋给last_id</td>
        </tr>
        <tr>
            <td>nextpage</td>
            <td>bool</td>
            <td>是否有下一页</td>
        </tr>
        <tr>
            <td>msgid</td>
            <td>string</td>
            <td>请求下一页时用的_id</td>
        </tr>
    </tbody>
</table>
 
<table>
    <tbody>
        <tr>
            <td rowspan="4">unspeak客户端 emit</td>
            <td rowspan="4">unspeak</td>
            <td colspan="5">禁言/解除禁言，只有老师和监课老师身份可以操作</td>
        </tr>
        <tr>
            <td>index</td>
            <td colspan="2">int</td>
            <td colspan="2">客户端使用</td>
        </tr>
        <tr>
            <td>message</td>
            <td colspan="2">string</td>
            <td colspan="2">禁言状态：enable-禁言；disable-取消禁言</td>
        </tr>
        <tr>
            <td>targetid</td>
            <td colspan="2">string</td>
            <td colspan="2">被禁言用户IDtargetid为0是对全体用户操作</td>
        </tr>
        <tr>
            <td>Callback回调</td>
            <td></td>
            <td colspan="5">通用格式</td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="2">unspeak_list客户端 emit</td>
            <td rowspan="2"><strong>&nbsp;</strong></td>
            <td colspan="5">获取禁言列表老师和监课老师返回全部禁言列表，其他只返回该用户列表</td>
        </tr>
        <tr>
            <td>无参数，但需要传空对象（{}）</td>
            <td colspan="2"><strong>&nbsp;</strong></td>
            <td colspan="2"><strong>&nbsp;</strong></td>
        </tr>
        <tr>
            <td>Callback回调</td>
            <td><strong>&nbsp;</strong></td>
            <td>data.message</td>
            <td colspan="2">数组</td>
            <td colspan="2">如果全体被禁言，数组中只返回0，否则为被禁言用户的ID数组</td>
        </tr>
        <tr>
            <td colspan="7"><strong>&nbsp;</strong></td>
        </tr>
        <tr>
            <td rowspan="2">notice客户端on</td>
            <td rowspan="2"></td>
            <td colspan="5">客户端接收公告（大班课web相关）</td>
        </tr>
        <tr>
            <td>字符串</td>
            <td colspan="2"></td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="4">unspeak客户端on</td>
            <td rowspan="4"></td>
            <td colspan="5">客户端被禁言（大班课web相关）</td>
        </tr>
        <tr>
            <td>status</td>
            <td colspan="2">int</td>
            <td colspan="2">1=有效</td>
        </tr>
        <tr>
            <td>targetid</td>
            <td colspan="2">string</td>
            <td colspan="2">被禁言者idtargetid为all是对全体用户操作</td>
        </tr>
        <tr>
            <td>message</td>
            <td colspan="2">string</td>
            <td colspan="2">disable=取消禁言enable=禁言</td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="5">unspeak_list客户端on</td>
            <td rowspan="5">unspeak_list</td>
            <td colspan="5">请求禁言列表后，服务器端返回禁言列表</td>
        </tr>
        <tr>
            <td colspan="2">unixtime</td>
            <td colspan="2">string</td>
            <td>时间戳</td>
        </tr>
        <tr>
            <td colspan="2">message</td>
            <td colspan="2">数组</td>
            <td>禁言列表</td>
        </tr>
        <tr>
            <td colspan="2">message[0]. targetid</td>
            <td colspan="2">string</td>
            <td>如果全体被禁言，数组中只返回0，否则为被禁言用户的ID数组</td>
        </tr>
        <tr>
            <td colspan="2">message[0]. message</td>
            <td colspan="2">string</td>
            <td>disable=取消禁言enable=禁言</td>
        </tr>
        <tr>
            <td colspan="7"></td>
        </tr>
        <tr>
            <td rowspan="9">message客户端on</td>
            <td rowspan="9">原message事件mtype为message和picture</td>
            <td colspan="5">接收聊天消息，包括文本和图片（大班课web相关）</td>
        </tr>
        <tr>
            <td colspan="2">unixtime</td>
            <td colspan="2">string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="2">index</td>
            <td colspan="2">int</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="2">mtype</td>
            <td colspan="2">string</td>
            <td>包括message、picture</td>
        </tr>
        <tr>
            <td colspan="2">userid</td>
            <td colspan="2">string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="2">username</td>
            <td colspan="2">string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="2">role</td>
            <td colspan="2">string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="2">message</td>
            <td colspan="2">string</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="2">avatar</td>
            <td colspan="2">string</td>
            <td>头像</td>
        </tr>
    </tbody>
</table>

#### 2.3 interact（on/emit事件）

<table>
    <tbody>
        <tr>
            <td>命名空间版事件</td>
            <td colspan="2">原版事件</td>
            <td colspan="2">参数</td>
            <td colspan="2">类型</td>
            <td colspan="2">说明</td>
        </tr>
        <tr>
            <td rowspan="6">online_doc客户端emit</td>
            <td colspan="2" rowspan="6">原message事件mtype为message</td>
            <td colspan="2">原版中通过在普通消息中国加特殊前缀的方式传递此消息</td>
            <td colspan="2"></td>
            <td colspan="2">发送多文档互动消息此处为新增，与strem参数一致</td>
        </tr>
        <tr>
            <td colspan="2">index</td>
            <td colspan="2">int</td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td colspan="2">mtype</td>
            <td colspan="2">string</td>
            <td colspan="2">消息子类型</td>
        </tr>
        <tr>
            <td colspan="2">targetid</td>
            <td colspan="2">string</td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td colspan="2">message</td>
            <td colspan="2">string</td>
            <td colspan="2">以JSON串传递</td>
        </tr>
        <tr>
            <td colspan="2"><strong>save</strong></td>
            <td colspan="2">string</td>
            <td colspan="2">‘0’=不保存，’1’=保存 暂时不支持</td>
        </tr>
        <tr>
            <td colspan="2" rowspan="3">online_doc_ack客户端 on</td>
            <td colspan="2" rowspan="3">online_doc</td>
            <td colspan="2">Code</td>
            <td colspan="2">int</td>
            <td>错误码</td>
        </tr>
        <tr>
            <td colspan="2">Message</td>
            <td colspan="2">string</td>
            <td>错误消息</td>
        </tr>
        <tr>
            <td colspan="2">Index</td>
            <td colspan="2">Int</td>
            <td>命令编号</td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"></td>
            <td colspan="2"><strong>&nbsp;</strong></td>
            <td colspan="2"></td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td colspan="9"></td>
        </tr>
        <tr>
            <td rowspan="8">online_doc客户端on</td>
            <td colspan="2" rowspan="8">原message事件mtype为message</td>
            <td colspan="2"></td>
            <td colspan="2"></td>
            <td colspan="2">接收多文档互动消息此处为新增</td>
        </tr>
        <tr>
            <td colspan="2">unixtime</td>
            <td colspan="2">string</td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td colspan="2">index</td>
            <td colspan="2">int</td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td colspan="2">mtype</td>
            <td colspan="2">string</td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td colspan="2">userid</td>
            <td colspan="2">string</td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td colspan="2">role</td>
            <td colspan="2">string</td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td colspan="2">message</td>
            <td colspan="2">string</td>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td colspan="2"><strong>history</strong></td>
            <td colspan="2">int</td>
            <td colspan="2">是否为历史消息，暂不支持</td>
        </tr>
    </tbody>
</table>