🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## **全局参数说明** 参数 | 备注 ---|--- **{SERVER_ID}** | 配置文件中的服务器ID **{CHILD_ID}** | 配置文件中的服务进程ID <br> ## **请求队列总览** 队列名称 | 备注 ---|--- queue.chatroom_**{SERVER_ID}**_**{CHILD_ID}** | 群操作 <br> ### **群相关操作** * 请求队列: queue.chatroom_{SERVER_ID}_{CHILD_ID} * 请求参数: | Param | Type | Description | Required | --- | --- | --- | --- | | map | <code>Map</code> | 队列传输参数类型 | true | [map.uin] | <code>String</code> | 微信号uin | true | [map.room] | <code>List<String></code> | 创建群时,群成员wxid列表 | [map.chatRoomType]为CREATE_CHAT_ROOM时必填 | [map.topic] | <code>String</code> | 创建群时的群名称 | [map.chatRoomType]为CREATE_CHAT_ROOM时必填 | [map.chatRoomName] | <code>String</code> | 群wxid(带@chatroom的字符串) | 群聊的唯一标识; [map.chatRoomType]除了为CREATE_CHAT_ROOM,其他场景必填 | [map.chatRoomType] | <code>String</code> |更新群操作类型:<br>CREATE_CHAT_ROOM:创建群<br>ADD_MEMBER:添加群成员<br>DEL_MEMBER:删除群成员<br>MOD_TOPIC:修改群名称<br>GET_MEMBER:获取群成员<br>GET_INVITE_INFO:获取群邀请信息<br>DEL_CHAT_ROOM:删除退出群聊<br>SET_ANNOUNCEMENT:设置群公告<br>GET_ANNOUNCEMENT:获取群公告<br>SAVE_CHATROOM:保存群聊至通讯录<br>CANCEL_CHATROOM:取消群聊至通讯录 <br>GET_QRCODE:获取群二维码| 群操作类型 | [map.content] | <code>String</code> | {<br>chatRoomType=ADD_MEMBER\|DEL_MEMBER:content为操作成员的wxid','拼接字符串;<br>chatRoomType=MOD_TOPIC:content表示修改后的群名称;<br>chatRoomType=SET_ANNOUNCEMENT:content表示群公告内容}| | [map.queueName] | <code>String</code> | 指定结果回推的队列名 | 必填项 | [map.inviteUrl] | <code>String</code> | 邀请链接 | | [map.inviteFrom] | <code>String</code> | 邀请来自哪里 | **Example-创建群** ``` Map<String,Object> map = new HashMap<>(16); List<String> room = new ArrayList<>(); room.add("wxid_....."); String resultQueueName="queue.receiveChatRoomMsg_......"; ...... map.put("uin", "xxx"); map.put("room", room); map.put("topic", "测试群"); map.put("chatRoomType", "CREATE_CHAT_ROOM"); map.put("queueName",resultQueueName) String queueName = "queue.chatroom_{SERVER_ID}_{CHILD_ID}"; jmsTemplate.send(queueName, map); ``` > 群操作成功后会向map.queueName推送一条处理结果,返回结果是jsonString类型数据,字段名字status为0,表示操作成功 **Example-添加群成员** ``` Map<String,Object> map = new HashMap<>(16); String resultQueueName="queue.receiveChatRoomMsg_......"; map.put("uin", "xxx"); map.put("chatRoomType", "ADD_MEMBER"); map.put("chatRoomName", "123456@chatroom"); map.put("content", "wxid_acax18ag2gkj22,wxid_vth9fmtpl2kn22); map.put("queueName",resultQueueName); String queueName = "queue.chatroom_{SERVER_ID}_{CHILD_ID}"; jmsTemplate.send(queueName, map); ``` > 群操作成功后会向map.queueName推送一条处理结果,返回结果是jsonString类型数据,字段名字status为0,表示操作成功 **Example-删除群成员** ``` Map<String,Object> map = new HashMap<>(16); String resultQueueName="queue.receiveChatRoomMsg_......"; map.put("uin", "xxx"); map.put("chatRoomType", "DEL_MEMBER"); map.put("chatRoomName", "123456@chatroom"); map.put("content", "wxid_acax18ag2gkj22,wxid_vth9fmtpl2kn22); map.put("queueName",resultQueueName); String queueName = "queue.chatroom_{SERVER_ID}_{CHILD_ID}"; jmsTemplate.send(queueName, map); ``` > 群操作成功后会向map.queueName推送一条处理结果,返回结果是jsonString类型数据,字段名字status为0,表示操作成功 **Example-修改群名称** ``` Map<String,Object> map = new HashMap<>(16); String resultQueueName="queue.receiveChatRoomMsg_......"; map.put("uin", "xxx"); map.put("chatRoomType", "MOD_TOPIC"); map.put("chatRoomName", "123456@chatroom"); map.put("content", "测试群聊"); map.put("queueName",resultQueueName); String queueName = "queue.chatroom_{SERVER_ID}_{CHILD_ID}"; jmsTemplate.send(queueName, map); ``` > 群操作成功后会向map.queueName推送一条处理结果,返回结果是jsonString类型数据,字段名字status为0,表示操作成功 **Example-获取群成员** ``` Map<String,Object> map = new HashMap<>(16); String resultQueueName="queue.receiveChatRoomMsg_......"; map.put("uin", "xxx"); map.put("chatRoomType", "GET_MEMBER"); map.put("chatRoomName", "123456@chatroom"); map.put("queueName",resultQueueName); String queueName = "queue.chatroom_{SERVER_ID}_{CHILD_ID}"; jmsTemplate.send(queueName, map); ``` > 群操作成功后会向map.queueName推送一条处理结果,返回结果是jsonString类型数据,字段名字status为0,表示操作成功 **Example-获取群邀请信息** ``` Map<String,Object> map = new HashMap<>(16); String resultQueueName="queue.receiveChatRoomMsg_......"; map.put("uin", "xxx"); map.put("chatRoomType", "GET_INVITE_INFO"); map.put("inviteUrl",inviteUrl);//邀请链接 map.put("inviteFrom",inviteFrom);//邀请来自哪里 map.put("queueName",resultQueueName); String queueName = "queue.chatroom_{SERVER_ID}_{CHILD_ID}"; jmsTemplate.send(queueName, map); ``` > 群操作成功后会向map.queueName推送一条处理结果,返回结果是jsonString类型数据,字段名字status为0,表示操作成功 **Example-删除退出群聊** ``` Map<String,Object> map = new HashMap<>(16); String resultQueueName="queue.receiveChatRoomMsg_......"; map.put("uin", "xxx"); map.put("chatRoomType", "DEL_CHAT_ROOM"); map.put("chatRoomName", "123456@chatroom"); map.put("queueName",resultQueueName); String queueName = "queue.chatroom_{SERVER_ID}_{CHILD_ID}"; jmsTemplate.send(queueName, map); ``` > 群操作成功后会向map.queueName推送一条处理结果,返回结果是jsonString类型数据,字段名字status为0,表示操作成功 **Example-设置群公告** ``` Map<String,Object> map = new HashMap<>(16); String resultQueueName="queue.receiveChatRoomMsg_......"; map.put("uin", "xxx"); map.put("chatRoomType", "SET_ANNOUNCEMENT"); map.put("chatRoomName", "123456@chatroom"); map.put("content", "XXXXXXXXX"); map.put("queueName",resultQueueName); String queueName = "queue.chatroom_{SERVER_ID}_{CHILD_ID}"; jmsTemplate.send(queueName, map); ``` > 群操作成功后会向map.queueName推送一条处理结果,返回结果是jsonString类型数据,字段名字status为0,表示操作成功 **Example-获取群公告** ``` Map<String,Object> map = new HashMap<>(16); String resultQueueName="queue.receiveChatRoomMsg_......"; map.put("uin", "xxx"); map.put("chatRoomType", "GET_ANNOUNCEMENT"); map.put("chatRoomName", "123456@chatroom"); map.put("queueName",resultQueueName); String queueName = "queue.chatroom_{SERVER_ID}_{CHILD_ID}"; jmsTemplate.send(queueName, map); ``` > 群操作成功后会向map.queueName推送一条处理结果,返回结果是jsonString类型数据,字段名字status为0,表示操作成功 **Example-获取群二维码** ``` Map<String,Object> map = new HashMap<>(16); String resultQueueName="queue.receiveChatRoomMsg_......"; map.put("uin", "xxx"); map.put("chatRoomType", "GET_QRCODE"); map.put("chatRoomName", "123456@chatroom"); map.put("queueName",resultQueueName); String queueName = "queue.chatroom_{SERVER_ID}_{CHILD_ID}"; jmsTemplate.send(queueName, map); ``` > 群操作成功后会向map.queueName推送一条处理结果,返回结果是jsonString类型数据,字段名字status为0,表示拉取成功,包括图片字节流 **Example-保存/取消群聊至通讯录** ``` Map<String,Object> map = new HashMap<>(16); String resultQueueName="queue.receiveChatRoomMsg_......"; map.put("uin", "xxx"); map.put("chatRoomType", "SAVE_CHATROOM|CANCEL_CHATROOM"); map.put("chatRoomName", "123456@chatroom"); map.put("queueName",resultQueueName); String queueName = "queue.chatroom_{SERVER_ID}_{CHILD_ID}"; jmsTemplate.send(queueName, map); ``` > 群操作成功后会向map.queueName推送一条处理结果,返回结果是jsonString类型数据,字段名字status为0,表示操作成功