diff --git a/cmd/open_im_api/docs/docs.go b/cmd/open_im_api/docs/docs.go new file mode 100644 index 000000000..183ab0bf4 --- /dev/null +++ b/cmd/open_im_api/docs/docs.go @@ -0,0 +1,8528 @@ +// Package docs GENERATED BY SWAG; DO NOT EDIT +// This file was generated by swaggo/swag +package docs + +import "github.com/swaggo/swag" + +const docTemplate = `{ + "schemes": {{ marshal .Schemes }}, + "swagger": "2.0", + "info": { + "description": "{{escape .Description}}", + "title": "{{.Title}}", + "contact": {}, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version": "{{.Version}}" + }, + "host": "{{.Host}}", + "basePath": "{{.BasePath}}", + "paths": { + "/auth/force_logout": { + "post": { + "description": "对应的平台强制登出", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "鉴权认证" + ], + "summary": "强制登出", + "operationId": "ForceLogout", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "platform为平台ID \u003cbr\u003e fromUserID为要执行强制登出的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.ForceLogoutReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.ForceLogoutResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/auth/parse_token": { + "post": { + "description": "解析当前用户token(token在请求头中传入)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "鉴权认证" + ], + "summary": "解析当前用户token", + "operationId": "ParseToken", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "secret为openIM密钥, 详细见服务端config.yaml secret字段\u003cbr\u003eplatform为平台ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.ParseTokenReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.ParseTokenResp" + }, + { + "type": "object", + "properties": { + "Data": { + "$ref": "#/definitions/base_info.ExpireTime" + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/auth/user_register": { + "post": { + "description": "用户注册", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "鉴权认证" + ], + "summary": "用户注册", + "operationId": "UserRegister", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "secret为openIM密钥, 详细见服务端config.yaml secret字段 \u003cbr\u003e platform为平台ID \u003cbr\u003e ex为拓展字段 \u003cbr\u003e gender为性别, 0为女, 1为男", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.UserRegisterReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.UserRegisterResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/auth/user_token": { + "post": { + "description": "获取用户的token", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "鉴权认证" + ], + "summary": "用户登录", + "operationId": "UserToken", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "secret为openIM密钥, 详细见服务端config.yaml secret字段 \u003cbr\u003e platform为平台ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.UserTokenReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.UserTokenResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/add_black": { + "post": { + "description": "添加黑名单", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "添加黑名单", + "operationId": "AddBlack", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为设置的用户 \u003cbr\u003e toUserID为被设置的用户", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.AddBlacklistReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.AddBlacklistResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/add_friend": { + "post": { + "description": "添加好友", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "添加好友", + "operationId": "AddFriend", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "reqMsg为申请信息 \u003cbr\u003e fromUserID为申请用户 \u003cbr\u003e toUserID为被添加用户", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.AddFriendReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.AddFriendResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/add_friend_response": { + "post": { + "description": "同意/拒绝好友请求", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "同意/拒绝好友请求", + "operationId": "AddFriendResponse", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID同意/拒绝的用户ID\u003cbr\u003etoUserID为申请用户D\u003cbr\u003ehandleMsg为处理信息\u003cbr\u003eflag为具体操作, 1为同意, 2为拒绝", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.AddFriendResponseReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.AddFriendResponseResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/delete_friend": { + "post": { + "description": "删除好友", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "删除好友", + "operationId": "DeleteFriend", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为操作用户\u003cbr\u003etoUserID为被删除用户", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteFriendReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteFriendResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/get_black_list": { + "post": { + "description": "获取黑名单列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "获取黑名单列表", + "operationId": "GetBlacklist", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID要获取黑名单的用户", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetBlackListReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetBlackListResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.PublicUserInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + } + } + } + }, + "/friend/get_friend_apply_list": { + "post": { + "description": "删除好友", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "获取好友申请列表", + "operationId": "GetFriendApplyList", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为要获取申请列表的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetFriendApplyListReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetFriendApplyListResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.FriendRequest" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + } + } + } + }, + "/friend/get_friend_list": { + "post": { + "description": "获取用户的好友列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "获取用户的好友列表", + "operationId": "GetFriendList", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为要获取好友列表的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetFriendListReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetFriendListResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.FriendInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/get_self_friend_apply_list": { + "post": { + "description": "获取自己的好友申请列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "获取自己的好友申请列表", + "operationId": "GetSelfFriendApplyList", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为自己的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetSelfApplyListReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetSelfApplyListResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.FriendRequest" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/import_friend": { + "post": { + "description": "批量加好友", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "批量加好友", + "operationId": "ImportFriend", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID批量加好友的用户ID\u003cbr\u003e friendUserIDList为", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.ImportFriendReq" + } + } + ], + "responses": { + "0": { + "description": "data列表中对象的result-1为添加该用户失败\u003cbr\u003e0为成功", + "schema": { + "$ref": "#/definitions/base_info.ImportFriendResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/is_friend": { + "post": { + "description": "检查用户之间是否为好友", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "检查用户之间是否为好友", + "operationId": "IsFriend", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为请求用户\u003cbr\u003e toUserID为要检查的用户", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.IsFriendReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.IsFriendResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/remove_black": { + "post": { + "description": "把用户移除黑名单", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "把用户移除黑名单", + "operationId": "RemoveBlack", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID要获取黑名单的用户", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.RemoveBlackListReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.RemoveBlackListResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/set_friend_remark": { + "post": { + "description": "设置好友备注", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "设置好友备注", + "operationId": "SetFriendRemark", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为设置的用户\u003cbr\u003e toUserID为被设置的用户\u003cbr\u003e remark为好友备注", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SetFriendRemarkReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SetFriendRemarkResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/cancel_mute_group": { + "post": { + "description": "取消禁言群组", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "取消禁言群组", + "operationId": "CancelMuteGroup", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为群组ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CancelMuteGroupReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CancelMuteGroupResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/cancel_mute_group_member": { + "post": { + "description": "取消禁言群成员", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "取消禁言群成员", + "operationId": "CancelMuteGroupMember", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为群组ID \u003cbr\u003e userID为要取消禁言的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CancelMuteGroupMemberReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CancelMuteGroupMemberResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/create_group": { + "post": { + "description": "创建群组", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "创建群组", + "operationId": "CreateGroup", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupType这里填0代表普通群 \u003cbr\u003egroupName为群名称\u003cbr\u003e introduction为群介绍\u003cbr\u003e notification为群公共\u003cbr\u003eownerUserID为群主ID \u003cbr\u003e ex为群扩展字段 \u003cbr\u003e memberList中对象roleLevel为群员角色,1为普通用户 2为群主 3为管理员", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CreateGroupReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.CreateGroupResp" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/server_api_params.GroupInfo" + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/dismiss_group": { + "post": { + "description": "解散群组", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "解散群组", + "operationId": "DismissGroup", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为要解散的群组ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DismissGroupReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DismissGroupResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/get_group_all_member_list": { + "post": { + "description": "获取全部群成员列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "获取全部群成员列表", + "operationId": "GetGroupAllMemberList", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "GroupID为要获取群成员的群ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetGroupAllMemberReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetGroupAllMemberResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.GroupMemberFullInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/get_group_members_info": { + "post": { + "description": "获取群成员信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "获取群成员信息", + "operationId": "GetGroupMembersInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为要获取的群ID \u003cbr\u003e memberList为要获取群成员的群ID列表", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetGroupMembersInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetGroupMembersInfoResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.GroupMemberFullInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/get_groups_info": { + "post": { + "description": "通过群ID列表获取群信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "通过群ID列表获取群信息", + "operationId": "GetGroupsInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupIDList为群ID列表", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetGroupInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetGroupInfoResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/get_joined_group_list": { + "post": { + "description": "获取用户加入群列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "获取用户加入群列表", + "operationId": "GetJoinedGroupList", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为要获取的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetJoinedGroupListReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetJoinedGroupListResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.GroupInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/get_recv_group_applicationList": { + "post": { + "description": "获取用户收到的加群信息列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "获取用户收到的加群信息列表", + "operationId": "GetRecvGroupApplicationList", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为要获取的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetGroupApplicationListReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetGroupApplicationListResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.GroupRequest" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/get_user_req_group_applicationList": { + "post": { + "description": "获取用户加群申请列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "获取用户加群申请列表", + "operationId": "GetUserReqGroupApplicationList", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "userID为要获取的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserReqGroupApplicationListReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetGroupApplicationListResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.GroupRequest" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/group_application_response": { + "post": { + "description": "处理加群消息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "处理加群消息", + "operationId": "ApplicationGroupResponse", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为要处理的群ID \u003cbr\u003e fromUserID为要处理的用户ID \u003cbr\u003e handleMsg为处理结果信息 \u003cbr\u003e handleResult为处理结果 1为同意加群 2为拒绝加群", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.ApplicationGroupResponseReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.ApplicationGroupResponseResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/invite_user_to_group": { + "post": { + "description": "将用户拉入群组", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "将用户拉入群组", + "operationId": "InviteUserToGroup", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为要拉进的群组ID \u003cbr\u003e invitedUserIDList为要获取群成员的群ID列表 \u003cbr\u003e reason为原因", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.InviteUserToGroupReq" + } + } + ], + "responses": { + "0": { + "description": "result为结果码, -1为失败, 0为成功", + "schema": { + "$ref": "#/definitions/base_info.InviteUserToGroupResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/join_group": { + "post": { + "description": "加入群聊", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "加入群聊", + "operationId": "JoinGroup", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "reqMessage为申请进群信息\u003cbr\u003egroupID为申请的群ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.JoinGroupReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.JoinGroupResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/kick_group": { + "post": { + "description": "把用户踢出群组", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "把用户踢出群组", + "operationId": "KickGroupMember", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "GroupID为要操作的群ID \u003cbr\u003e kickedUserIDList为要踢出的群用户ID \u003cbr\u003e reason为原因", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.KickGroupMemberReq" + } + } + ], + "responses": { + "0": { + "description": "result为结果码, -1为失败, 0为成功", + "schema": { + "$ref": "#/definitions/base_info.KickGroupMemberResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/mute_group": { + "post": { + "description": "禁言群组", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "禁言群组", + "operationId": "MuteGroup", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为群组ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.MuteGroupReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.MuteGroupResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.MuteGroupResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.MuteGroupResp" + } + } + } + } + }, + "/group/mute_group_member": { + "post": { + "description": "禁言群成员", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "禁言群成员", + "operationId": "MuteGroupMember", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为群组ID \u003cbr\u003e userID为要禁言的用户ID \u003cbr\u003e mutedSeconds为禁言秒数", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.MuteGroupMemberReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DismissGroupResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/quit_group": { + "post": { + "description": "当前用户退出群聊", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "当前用户退出群聊", + "operationId": "QuitGroup", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为要退出的群ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.QuitGroupReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.QuitGroupResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/set_group_info": { + "post": { + "description": "设置群信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "设置群信息", + "operationId": "SetGroupInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为要修改的群ID\u003cbr\u003egroupName为新的群名称\u003cbr\u003enotification为群介绍 \u003cbr\u003e introduction为群公告 \u003cbr\u003e needVerification为加群验证 0为申请需要同意 邀请直接进 1为所有人进群需要验证,除了群主管理员邀请进群 2为直接进群", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SetGroupInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SetGroupInfoResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/set_group_member_info": { + "post": { + "description": "修改群成员信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "修改群成员信息", + "operationId": "SetGroupMemberInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "除了operationID, userID, groupID其他参数可选\u003cbr\u003eex为拓展字段\u003cbr\u003efaceURL为群头像\u003cbr\u003enickName为群昵称\u003cbr\u003eroleLevel为群员角色,1为普通用户 2为群主 3为管理员", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SetGroupMemberInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SetGroupMemberInfoResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/transfer_group": { + "post": { + "description": "转让群主", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "转让群主", + "operationId": "TransferGroupOwner", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "GroupID为要操作的群ID \u003cbr\u003e oldOwnerUserID为老群主ID \u003cbr\u003e newOwnerUserID为新群主ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.TransferGroupOwnerReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.TransferGroupOwnerResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/msg/batch_send_msg": { + "post": { + "description": "管理员批量发送群聊单聊消息 消息格式详细见\u003ca href=\"https://doc.rentsoft.cn/#/server_doc/admin?id=%e6%b6%88%e6%81%af%e7%b1%bb%e5%9e%8b%e6%a0%bc%e5%bc%8f%e6%8f%8f%e8%bf%b0\"\u003e消息格式\u003c/href\u003e", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "消息相关" + ], + "summary": "管理员批量发送群聊单聊消息", + "operationId": "ManagementBatchSendMsg", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "该请求和消息结构体一样 \u003cbr\u003e recvIDList为接受消息的用户ID列表", + "name": "管理员批量发送单聊消息", + "in": "body", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.ManagementBatchSendMsgReq" + }, + { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/Open_IM_internal_api_manage.TextElem" + } + } + } + ] + } + }, + { + "description": "该请求和消息结构体一样 \u003cbr\u003e recvIDList为接受消息的用户ID列表", + "name": "管理员批量发送OA通知", + "in": "body", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.ManagementSendMsgReq" + }, + { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/Open_IM_internal_api_manage.OANotificationElem" + } + } + } + ] + } + } + ], + "responses": { + "0": { + "description": "serverMsgID为服务器消息ID \u003cbr\u003e clientMsgID为客户端消息ID \u003cbr\u003e sendTime为发送消息时间", + "schema": { + "$ref": "#/definitions/base_info.ManagementBatchSendMsgReq" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.ManagementBatchSendMsgReq" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.ManagementBatchSendMsgReq" + } + } + } + } + }, + "/msg/clear_msg": { + "post": { + "description": "清空用户消息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "消息相关" + ], + "summary": "清空用户消息", + "operationId": "ClearMsg", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "userID为要清空的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CleanUpMsgReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CleanUpMsgResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/msg/del_msg": { + "post": { + "description": "根据seq列表删除消息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "消息相关" + ], + "summary": "根据seq列表删除消息", + "operationId": "DelMsg", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "userID为要删除的用户ID \u003cbr\u003e seqList为seq列表", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DelMsgReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DelMsgResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/msg/get_all_conversations": { + "post": { + "description": "获取用户所有会话", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "会话相关" + ], + "summary": "获取用户所有会话", + "operationId": "GetAllConversations", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "ownerUserID为要获取的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetAllConversationsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetAllConversationsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/msg/get_conversation": { + "post": { + "description": "根据会话ID获取会话", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "会话相关" + ], + "summary": "根据会话ID获取会话", + "operationId": "GetConversation", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "ownerUserID为要获取的用户ID\u003cbr\u003econversationID为要获取的会话ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetConversationReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetConversationResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/msg/get_conversations": { + "post": { + "description": "根据会话ID列表获取会话", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "会话相关" + ], + "summary": "根据会话ID列表获取会话", + "operationId": "GetConversations", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "ownerUserID为要获取的用户ID\u003cbr\u003econversationIDs为要获取的会话ID列表", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetConversationsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetConversationsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/msg/manage_send_msg": { + "post": { + "description": "管理员发送/撤回消息 消息格式详细见\u003ca href=\"https://doc.rentsoft.cn/#/server_doc/admin?id=%e6%b6%88%e6%81%af%e7%b1%bb%e5%9e%8b%e6%a0%bc%e5%bc%8f%e6%8f%8f%e8%bf%b0\"\u003e消息格式\u003c/href\u003e", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "消息相关" + ], + "summary": "管理员发送/撤回消息", + "operationId": "ManagementSendMsg", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "该请求和消息结构体一样", + "name": "管理员发送文字消息", + "in": "body", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.ManagementSendMsgReq" + }, + { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/Open_IM_internal_api_manage.TextElem" + } + } + } + ] + } + }, + { + "description": "该请求和消息结构体一样", + "name": "管理员发送OA通知消息", + "in": "body", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.ManagementSendMsgReq" + }, + { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/Open_IM_internal_api_manage.OANotificationElem" + } + } + } + ] + } + }, + { + "description": "该请求和消息结构体一样", + "name": "管理员撤回单聊消息", + "in": "body", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.ManagementSendMsgReq" + }, + { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/Open_IM_internal_api_manage.RevokeElem" + } + } + } + ] + } + } + ], + "responses": { + "0": { + "description": "serverMsgID为服务器消息ID \u003cbr\u003e clientMsgID为客户端消息ID \u003cbr\u003e sendTime为发送消息时间", + "schema": { + "$ref": "#/definitions/base_info.ManagementSendMsgResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.ManagementSendMsgResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.ManagementSendMsgResp" + } + } + } + } + }, + "/office/comment_one_work_moment": { + "post": { + "description": "评论一条工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "评论一条工作圈", + "operationId": "CommentOneWorkMoment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CommentOneWorkMomentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CommentOneWorkMomentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/create_one_work_moment": { + "post": { + "description": "用户创建一条工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "创建一条工作圈", + "operationId": "CreateOneWorkMoment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求 atUserList likeUserList permissionGroupList permissionUserList 字段中userName可以不填", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CreateOneWorkMomentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CreateOneWorkMomentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/create_tag": { + "post": { + "description": "创建标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "创建标签", + "operationId": "CreateTag", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CreateTagReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CreateTagResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/delete_comment": { + "post": { + "description": "删除一条评论", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "删除一条评论", + "operationId": "DeleteComment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteCommentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteCommentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/delete_one_work_moment": { + "post": { + "description": "根据用户工作圈ID删除一条工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "删除一条工作圈", + "operationId": "DeleteOneWorkMoment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteOneWorkMomentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteOneWorkMomentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/delete_tag": { + "post": { + "description": "根据标签ID创建标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "删除标签", + "operationId": "DeleteTag", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteTagReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteTagResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/get_send_tag_log": { + "post": { + "description": "分页获取发送历史记录", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "获取发送历史记录", + "operationId": "GetTagSendLogs", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetTagSendLogsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetTagSendLogsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/get_user_friend_work_moments": { + "post": { + "description": "查询用户工作圈页面", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "查询自己大工作圈页面", + "operationId": "GetUserFriendWorkMoments", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserFriendWorkMomentsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUserFriendWorkMomentsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/get_user_tag_by_id": { + "post": { + "description": "通过标签id获取该用户的标签信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "获取该用户的标签信息", + "operationId": "GetUserTagByID", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserTagByIDReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUserTagByIDResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/get_user_tags": { + "post": { + "description": "用户获取自己的所有的标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "获取用户标签信息", + "operationId": "GetUserTags", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserTagsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUserTagsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/get_user_work_moments": { + "post": { + "description": "查询用户工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "查询用户工作圈", + "operationId": "GetUserWorkMoments", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserWorkMomentsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUserWorkMomentsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/get_work_moment_by_id": { + "post": { + "description": "通过ID获取工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "通过ID获取工作圈", + "operationId": "GetWorkMomentByID", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetWorkMomentByIDReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetWorkMomentByIDResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/like_one_work_moment": { + "post": { + "description": "工作圈ID点赞一条工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "点赞一条工作圈", + "operationId": "LikeOneWorkMoment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.LikeOneWorkMomentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.LikeOneWorkMomentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/send_msg_to_tag": { + "post": { + "description": "对标签用户发送消息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "发送标签消息", + "operationId": "SendMsg2Tag", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SendMsg2TagReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SendMsg2TagResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/set_tag": { + "post": { + "description": "根据标签ID修改标签用户列表, 名称", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "修改标签", + "operationId": "SetTag", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SetTagReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SetTagResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/create_department": { + "post": { + "description": "创建部门", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "创建部门", + "operationId": "CreateDepartment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CreateDepartmentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.CreateDepartmentResp" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/server_api_params.Department" + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/create_department_member": { + "post": { + "description": "创建部门用户", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "创建部门用户", + "operationId": "CreateDepartmentMember", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CreateDepartmentMemberReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CreateDepartmentMemberResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/create_organization_user": { + "post": { + "description": "组织架构导入用户", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "组织架构导入用户", + "operationId": "CreateOrganizationUser", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CreateOrganizationUserReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CreateOrganizationUserResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/delete_department": { + "post": { + "description": "删除部门", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "删除部门", + "operationId": "DeleteDepartment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteDepartmentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteDepartmentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/delete_organization_user": { + "post": { + "description": "删除组织架构中某个用户", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "删除组织架构中某个用户", + "operationId": "DeleteOrganizationUser", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteOrganizationUserReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteOrganizationUserResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/delete_user_in_department": { + "post": { + "description": "删除部门中某个用户", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "删除部门中某个用户", + "operationId": "DeleteUserInDepartment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteUserInDepartmentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteUserInDepartmentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/get_department_member": { + "post": { + "description": "获取部门中所有成员", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "获取部门中所有成员", + "operationId": "GetDepartmentMember", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetDepartmentMemberReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetDepartmentMemberResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.UserDepartmentMember" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/get_sub_department": { + "post": { + "description": "获取子部门列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "获取子部门列表", + "operationId": "GetSubDepartment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetSubDepartmentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetSubDepartmentResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.Department" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/get_user_in_department": { + "post": { + "description": "获取部门中的所有用户", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "获取部门中的所有用户", + "operationId": "GetUserInDepartment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserInDepartmentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetUserInDepartmentResp" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/server_api_params.UserInDepartment" + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/update_department": { + "post": { + "description": "更新部门信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "更新部门信息", + "operationId": "UpdateDepartment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.UpdateDepartmentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.UpdateDepartmentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/update_organization_user": { + "post": { + "description": "更新组织架构中的用户", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "更新组织架构中的用户", + "operationId": "UpdateOrganizationUser", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.UpdateOrganizationUserReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.UpdateOrganizationUserResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/update_user_in_department": { + "post": { + "description": "更新部门中某个用户", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "更新部门中某个用户", + "operationId": "UpdateUserInDepartment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.UpdateUserInDepartmentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.UpdateUserInDepartmentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/third/minio_upload": { + "post": { + "description": "minio上传文件(web api), 请注意本api请求为form并非json", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "第三方服务相关" + ], + "summary": "minio上传文件(web api)", + "operationId": "MinioUploadFile", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "type": "file", + "description": "要上传的文件文件", + "name": "file", + "in": "formData", + "required": true + }, + { + "type": "integer", + "description": "文件类型", + "name": "fileType", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "操作唯一ID", + "name": "operationID", + "in": "formData", + "required": true + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.MinioUploadFileResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/user/account_check": { + "post": { + "description": "传入UserIDList检查列表账户注册状态,并且返回结果", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "检查列表账户注册状态,并且返回结果", + "operationId": "AccountCheck", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.AccountCheckReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.AccountCheckResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/user/get_all_users_uid": { + "post": { + "description": "获取所有用户uid列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "获取所有用户uid列表", + "operationId": "GetAllUsersUid", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetAllUsersUidReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetAllUsersUidResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/user/get_self_user_info": { + "post": { + "description": "传入ID获取自己的信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "获取自己的信息", + "operationId": "GetSelfUserInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetSelfUserInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetSelfUserInfoResp" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/server_api_params.UserInfo" + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/user/get_users_info": { + "post": { + "description": "根据用户列表批量获取用户信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "获取用户信息", + "operationId": "GetUsersInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUsersInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetUsersInfoResp" + }, + { + "type": "object", + "properties": { + "Data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.PublicUserInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/user/get_users_online_status": { + "post": { + "description": "获取用户在线状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "获取用户在线状态", + "operationId": "GetUsersOnlineStatus", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUsersOnlineStatusReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUsersOnlineStatusResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/user/set_global_msg_recv_opt": { + "post": { + "description": "设置全局免打扰", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "设置全局免打扰", + "operationId": "SetGlobalRecvMessageOpt", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "globalRecvMsgOpt为全局免打扰设置0为关闭 1为开启", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SetGlobalRecvMessageOptReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SetGlobalRecvMessageOptResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/user/update_user_info": { + "post": { + "description": "修改用户信息 userID faceURL等", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "修改用户信息", + "operationId": "UpdateUserInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.UpdateSelfUserInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.UpdateUserInfoResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + } + }, + "definitions": { + "Open_IM_internal_api_manage.FileElem": { + "type": "object", + "properties": { + "fileName": { + "type": "string" + }, + "filePath": { + "type": "string" + }, + "fileSize": { + "type": "integer" + }, + "sourceURL": { + "type": "string" + }, + "uuid": { + "type": "string" + } + } + }, + "Open_IM_internal_api_manage.OANotificationElem": { + "type": "object", + "required": [ + "notificationFaceURL", + "notificationName", + "notificationType", + "text" + ], + "properties": { + "ex": { + "type": "string" + }, + "fileElem": { + "$ref": "#/definitions/Open_IM_internal_api_manage.FileElem" + }, + "mixType": { + "type": "integer" + }, + "notificationFaceURL": { + "type": "string" + }, + "notificationName": { + "type": "string" + }, + "notificationType": { + "type": "integer" + }, + "pictureElem": { + "$ref": "#/definitions/Open_IM_internal_api_manage.PictureElem" + }, + "soundElem": { + "$ref": "#/definitions/Open_IM_internal_api_manage.SoundElem" + }, + "text": { + "type": "string" + }, + "url": { + "type": "string" + }, + "videoElem": { + "$ref": "#/definitions/Open_IM_internal_api_manage.VideoElem" + } + } + }, + "Open_IM_internal_api_manage.PictureBaseInfo": { + "type": "object", + "properties": { + "height": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "uuid": { + "type": "string" + }, + "width": { + "type": "integer" + } + } + }, + "Open_IM_internal_api_manage.PictureElem": { + "type": "object", + "properties": { + "bigPicture": { + "$ref": "#/definitions/Open_IM_internal_api_manage.PictureBaseInfo" + }, + "snapshotPicture": { + "$ref": "#/definitions/Open_IM_internal_api_manage.PictureBaseInfo" + }, + "sourcePath": { + "type": "string" + }, + "sourcePicture": { + "$ref": "#/definitions/Open_IM_internal_api_manage.PictureBaseInfo" + } + } + }, + "Open_IM_internal_api_manage.RevokeElem": { + "type": "object", + "required": [ + "revokeMsgClientID" + ], + "properties": { + "revokeMsgClientID": { + "type": "string" + } + } + }, + "Open_IM_internal_api_manage.SoundElem": { + "type": "object", + "properties": { + "dataSize": { + "type": "integer" + }, + "duration": { + "type": "integer" + }, + "soundPath": { + "type": "string" + }, + "sourceURL": { + "type": "string" + }, + "uuid": { + "type": "string" + } + } + }, + "Open_IM_internal_api_manage.TextElem": { + "type": "object", + "required": [ + "text" + ], + "properties": { + "text": { + "type": "string" + } + } + }, + "Open_IM_internal_api_manage.VideoElem": { + "type": "object", + "properties": { + "duration": { + "type": "integer" + }, + "snapshotHeight": { + "type": "integer" + }, + "snapshotPath": { + "type": "string" + }, + "snapshotSize": { + "type": "integer" + }, + "snapshotURL": { + "type": "string" + }, + "snapshotUUID": { + "type": "string" + }, + "snapshotWidth": { + "type": "integer" + }, + "videoPath": { + "type": "string" + }, + "videoSize": { + "type": "integer" + }, + "videoType": { + "type": "string" + }, + "videoURL": { + "type": "string" + }, + "videoUUID": { + "type": "string" + } + } + }, + "base_info.AccountCheckReq": { + "type": "object", + "required": [ + "checkUserIDList", + "operationID" + ], + "properties": { + "checkUserIDList": { + "type": "array", + "maxItems": 100, + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.AccountCheckResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/user.AccountCheckResp_SingleUserStatus" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.AddBlacklistReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID", + "toUserID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "toUserID": { + "type": "string" + } + } + }, + "base_info.AddBlacklistResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.AddFriendReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID", + "toUserID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "reqMsg": { + "type": "string" + }, + "toUserID": { + "type": "string" + } + } + }, + "base_info.AddFriendResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.AddFriendResponseReq": { + "type": "object", + "required": [ + "flag", + "fromUserID", + "operationID", + "toUserID" + ], + "properties": { + "flag": { + "type": "integer", + "enum": [ + -1, + 0, + 1 + ] + }, + "fromUserID": { + "type": "string" + }, + "handleMsg": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "toUserID": { + "type": "string" + } + } + }, + "base_info.AddFriendResponseResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.ApplicationGroupResponseReq": { + "type": "object", + "required": [ + "fromUserID", + "groupID", + "handleResult", + "operationID" + ], + "properties": { + "fromUserID": { + "description": "application from FromUserID", + "type": "string" + }, + "groupID": { + "type": "string" + }, + "handleResult": { + "type": "integer", + "enum": [ + -1, + 1 + ] + }, + "handledMsg": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.ApplicationGroupResponseResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CancelMuteGroupMemberReq": { + "type": "object", + "required": [ + "groupID", + "operationID", + "userID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.CancelMuteGroupMemberResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CancelMuteGroupReq": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.CancelMuteGroupResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CleanUpMsgReq": { + "type": "object", + "required": [ + "operationID", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.CleanUpMsgResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.Comment": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "contentID": { + "type": "string" + }, + "createTime": { + "type": "integer" + }, + "replyUserID": { + "type": "string" + }, + "replyUserName": { + "type": "string" + }, + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "base_info.CommentOneWorkMomentReq": { + "type": "object", + "required": [ + "content", + "operationID", + "workMomentID" + ], + "properties": { + "content": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "replyUserID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.CommentOneWorkMomentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.Conversation": { + "type": "object", + "required": [ + "conversationID", + "conversationType", + "ownerUserID" + ], + "properties": { + "attachedInfo": { + "type": "string" + }, + "conversationID": { + "type": "string" + }, + "conversationType": { + "type": "integer" + }, + "draftTextTime": { + "type": "integer" + }, + "ex": { + "type": "string" + }, + "groupAtType": { + "type": "integer" + }, + "groupID": { + "type": "string" + }, + "isNotInGroup": { + "type": "boolean" + }, + "isPinned": { + "type": "boolean" + }, + "isPrivateChat": { + "type": "boolean" + }, + "ownerUserID": { + "type": "string" + }, + "recvMsgOpt": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ] + }, + "unreadCount": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.CreateDepartmentMemberReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "departmentID": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "leader": { + "type": "integer" + }, + "operationID": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "position": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.CreateDepartmentMemberResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CreateDepartmentReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "createTime": { + "type": "integer" + }, + "departmentID": { + "type": "string" + }, + "departmentType": { + "type": "integer" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "memberNum": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "parentID": { + "type": "string" + }, + "subDepartmentNum": { + "type": "integer" + } + } + }, + "base_info.CreateDepartmentResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CreateGroupReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "groupID": { + "type": "string" + }, + "groupName": { + "type": "string" + }, + "groupType": { + "type": "integer" + }, + "introduction": { + "type": "string" + }, + "memberList": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.GroupAddMemberInfo" + } + }, + "notification": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "ownerUserID": { + "type": "string" + } + } + }, + "base_info.CreateGroupResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CreateOneWorkMomentReq": { + "type": "object", + "properties": { + "operationID": { + "type": "string" + }, + "workMoment": { + "$ref": "#/definitions/office.WorkMoment" + } + } + }, + "base_info.CreateOneWorkMomentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CreateOrganizationUserReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "birth": { + "type": "integer" + }, + "createTime": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "englishName": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "mobile": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "telephone": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.CreateOrganizationUserResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CreateTagReq": { + "type": "object", + "required": [ + "operationID", + "tagName", + "userIDList" + ], + "properties": { + "operationID": { + "type": "string" + }, + "tagName": { + "description": "tag名称", + "type": "string" + }, + "userIDList": { + "description": "用户ID列表", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "base_info.CreateTagResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DelMsgReq": { + "type": "object", + "required": [ + "operationID", + "seqList", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "seqList": { + "type": "array", + "items": { + "type": "integer" + } + }, + "userID": { + "type": "string" + } + } + }, + "base_info.DelMsgResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteCommentReq": { + "type": "object", + "required": [ + "contentID", + "operationID", + "workMomentID" + ], + "properties": { + "contentID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.DeleteCommentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteDepartmentReq": { + "type": "object", + "required": [ + "departmentID", + "operationID" + ], + "properties": { + "departmentID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.DeleteDepartmentResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteFriendReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID", + "toUserID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "toUserID": { + "type": "string" + } + } + }, + "base_info.DeleteFriendResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteOneWorkMomentReq": { + "type": "object", + "required": [ + "operationID", + "workMomentID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.DeleteOneWorkMomentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteOrganizationUserReq": { + "type": "object", + "required": [ + "operationID", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.DeleteOrganizationUserResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteTagReq": { + "type": "object", + "required": [ + "operationID", + "tagID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "tagID": { + "type": "string" + } + } + }, + "base_info.DeleteTagResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteUserInDepartmentReq": { + "type": "object", + "required": [ + "departmentID", + "operationID", + "userID" + ], + "properties": { + "departmentID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.DeleteUserInDepartmentResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DismissGroupReq": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.DismissGroupResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.ExpireTime": { + "type": "object", + "properties": { + "expireTimeSeconds": { + "type": "integer" + } + } + }, + "base_info.ForceLogoutReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID", + "platform" + ], + "properties": { + "fromUserID": { + "type": "string", + "maxLength": 64, + "minLength": 1 + }, + "operationID": { + "type": "string" + }, + "platform": { + "type": "integer", + "maximum": 8, + "minimum": 1 + } + } + }, + "base_info.ForceLogoutResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetAllConversationsReq": { + "type": "object", + "required": [ + "operationID", + "ownerUserID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "ownerUserID": { + "type": "string" + } + } + }, + "base_info.GetAllConversationsResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.Conversation" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetAllUsersUidReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "base_info.GetAllUsersUidResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "string" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetBlackListReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetBlackListResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetConversationReq": { + "type": "object", + "required": [ + "conversationID", + "operationID", + "ownerUserID" + ], + "properties": { + "conversationID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "ownerUserID": { + "type": "string" + } + } + }, + "base_info.GetConversationResp": { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/base_info.Conversation" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetConversationsReq": { + "type": "object", + "required": [ + "conversationIDs", + "operationID", + "ownerUserID" + ], + "properties": { + "conversationIDs": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + }, + "ownerUserID": { + "type": "string" + } + } + }, + "base_info.GetConversationsResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.Conversation" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetDepartmentMemberReq": { + "type": "object", + "required": [ + "departmentID", + "operationID" + ], + "properties": { + "departmentID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetDepartmentMemberResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetFriendApplyListReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetFriendApplyListResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetFriendListReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetFriendListResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetGroupAllMemberReq": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetGroupAllMemberResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetGroupApplicationListReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID" + ], + "properties": { + "fromUserID": { + "description": "作为管理员或群主收到的 进群申请", + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetGroupApplicationListResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetGroupInfoReq": { + "type": "object", + "required": [ + "groupIDList", + "operationID" + ], + "properties": { + "groupIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetGroupInfoResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetGroupMembersInfoReq": { + "type": "object", + "required": [ + "groupID", + "memberList", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "memberList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetGroupMembersInfoResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetJoinedGroupListReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetJoinedGroupListResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetSelfApplyListReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetSelfApplyListResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetSelfUserInfoReq": { + "type": "object", + "required": [ + "operationID", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.GetSelfUserInfoResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetSubDepartmentReq": { + "type": "object", + "required": [ + "departmentID", + "operationID" + ], + "properties": { + "departmentID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetSubDepartmentResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetTagSendLogsReq": { + "type": "object", + "required": [ + "operationID", + "pageNumber", + "showNumber" + ], + "properties": { + "operationID": { + "type": "string" + }, + "pageNumber": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + } + } + }, + "base_info.GetTagSendLogsResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "logs": { + "type": "array", + "items": { + "$ref": "#/definitions/office.TagSendLog" + } + }, + "showNumber": { + "type": "integer" + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserFriendWorkMomentsReq": { + "type": "object", + "required": [ + "operationID", + "pageNumber", + "showNumber" + ], + "properties": { + "operationID": { + "type": "string" + }, + "pageNumber": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + } + } + }, + "base_info.GetUserFriendWorkMomentsResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + }, + "workMoments": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMoment" + } + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserInDepartmentReq": { + "type": "object", + "required": [ + "operationID", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.GetUserInDepartmentResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserReqGroupApplicationListReq": { + "type": "object", + "required": [ + "operationID", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.GetUserTagByIDReq": { + "type": "object", + "required": [ + "operationID", + "tagID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "tagID": { + "type": "string" + } + } + }, + "base_info.GetUserTagByIDResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "tag": { + "$ref": "#/definitions/office.Tag" + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserTagsReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "base_info.GetUserTagsResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/office.Tag" + } + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserWorkMomentsReq": { + "type": "object", + "required": [ + "operationID", + "pageNumber", + "showNumber" + ], + "properties": { + "operationID": { + "type": "string" + }, + "pageNumber": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.GetUserWorkMomentsResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + }, + "workMoments": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMoment" + } + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUsersInfoReq": { + "type": "object", + "required": [ + "operationID", + "userIDList" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userIDList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "base_info.GetUsersInfoResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUsersOnlineStatusReq": { + "type": "object", + "required": [ + "operationID", + "userIDList" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userIDList": { + "type": "array", + "maxItems": 200, + "items": { + "type": "string" + } + } + } + }, + "base_info.GetUsersOnlineStatusResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/pbRelay.GetUsersOnlineStatusResp_SuccessResult" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetWorkMomentByIDReq": { + "type": "object", + "required": [ + "operationID", + "workMomentID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.GetWorkMomentByIDResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "workMoment": { + "$ref": "#/definitions/base_info.WorkMoment" + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GroupAddMemberInfo": { + "type": "object", + "required": [ + "roleLevel", + "userID" + ], + "properties": { + "roleLevel": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.ImportFriendReq": { + "type": "object", + "required": [ + "friendUserIDList", + "fromUserID", + "operationID" + ], + "properties": { + "friendUserIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.ImportFriendResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.UserIDResult" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.InviteUserToGroupReq": { + "type": "object", + "required": [ + "groupID", + "invitedUserIDList", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "invitedUserIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + }, + "reason": { + "type": "string" + } + } + }, + "base_info.InviteUserToGroupResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.UserIDResult" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.IsFriendReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID", + "toUserID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "toUserID": { + "type": "string" + } + } + }, + "base_info.IsFriendResp": { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/base_info.Response" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.JoinGroupReq": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "reqMessage": { + "type": "string" + } + } + }, + "base_info.JoinGroupResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.KickGroupMemberReq": { + "type": "object", + "required": [ + "groupID", + "kickedUserIDList", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "kickedUserIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + }, + "reason": { + "type": "string" + } + } + }, + "base_info.KickGroupMemberResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.UserIDResult" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.LikeOneWorkMomentReq": { + "type": "object", + "required": [ + "operationID", + "workMomentID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.LikeOneWorkMomentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.ManagementBatchSendMsgReq": { + "type": "object", + "required": [ + "contentType", + "operationID", + "sendID", + "sessionType" + ], + "properties": { + "contentType": { + "type": "integer" + }, + "groupID": { + "type": "string" + }, + "isOnlineOnly": { + "type": "boolean" + }, + "offlinePushInfo": { + "$ref": "#/definitions/server_api_params.OfflinePushInfo" + }, + "operationID": { + "type": "string" + }, + "recvIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "sendID": { + "type": "string" + }, + "senderFaceURL": { + "type": "string" + }, + "senderNickname": { + "type": "string" + }, + "senderPlatformID": { + "type": "integer" + }, + "sessionType": { + "type": "integer" + } + } + }, + "base_info.ManagementSendMsgReq": { + "type": "object", + "required": [ + "contentType", + "operationID", + "sendID", + "sessionType" + ], + "properties": { + "contentType": { + "type": "integer" + }, + "groupID": { + "type": "string" + }, + "isOnlineOnly": { + "type": "boolean" + }, + "offlinePushInfo": { + "$ref": "#/definitions/server_api_params.OfflinePushInfo" + }, + "operationID": { + "type": "string" + }, + "recvID": { + "type": "string" + }, + "sendID": { + "type": "string" + }, + "senderFaceURL": { + "type": "string" + }, + "senderNickname": { + "type": "string" + }, + "senderPlatformID": { + "type": "integer" + }, + "sessionType": { + "type": "integer" + } + } + }, + "base_info.ManagementSendMsgResp": { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/server_api_params.UserSendMsgResp" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.MinioUploadFileResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "URL": { + "type": "string" + }, + "newName": { + "type": "string" + }, + "snapshotName": { + "type": "string" + }, + "snapshotURL": { + "type": "string" + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.MuteGroupMemberReq": { + "type": "object", + "required": [ + "groupID", + "mutedSeconds", + "operationID", + "userID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "mutedSeconds": { + "type": "integer" + }, + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.MuteGroupReq": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.MuteGroupResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.ParseTokenReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "base_info.ParseTokenResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.QuitGroupReq": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.QuitGroupResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.RemoveBlackListReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID", + "toUserID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "toUserID": { + "type": "string" + } + } + }, + "base_info.RemoveBlackListResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.Response": { + "type": "object", + "properties": { + "isFriend": { + "type": "boolean" + } + } + }, + "base_info.SendMsg2TagReq": { + "type": "object", + "required": [ + "content", + "operationID", + "senderPlatformID" + ], + "properties": { + "content": { + "type": "string" + }, + "groupList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + }, + "senderPlatformID": { + "type": "integer" + }, + "tagList": { + "type": "array", + "items": { + "type": "string" + } + }, + "userList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "base_info.SendMsg2TagResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.SetFriendRemarkReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID", + "remark", + "toUserID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "toUserID": { + "type": "string" + } + } + }, + "base_info.SetFriendRemarkResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.SetGlobalRecvMessageOptReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "globalRecvMsgOpt": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ] + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.SetGlobalRecvMessageOptResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.SetGroupInfoReq": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "groupID": { + "type": "string" + }, + "groupName": { + "type": "string" + }, + "introduction": { + "type": "string" + }, + "needVerification": { + "type": "integer" + }, + "notification": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.SetGroupInfoResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.SetGroupMemberInfoReq": { + "type": "object", + "required": [ + "groupID", + "operationID", + "userID" + ], + "properties": { + "ex": { + "type": "string" + }, + "groupID": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "roleLevel": { + "type": "integer", + "maximum": 3, + "minimum": 1 + }, + "userGroupFaceUrl": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.SetGroupMemberInfoResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.SetTagReq": { + "type": "object", + "required": [ + "operationID", + "tagID" + ], + "properties": { + "increaseUserIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "newName": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "reduceUserIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "tagID": { + "type": "string" + } + } + }, + "base_info.SetTagResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.Swagger400Resp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer", + "example": 400 + }, + "errMsg": { + "type": "string", + "example": "err msg" + } + } + }, + "base_info.Swagger500Resp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer", + "example": 500 + }, + "errMsg": { + "type": "string", + "example": "err msg" + } + } + }, + "base_info.TransferGroupOwnerReq": { + "type": "object", + "required": [ + "groupID", + "newOwnerUserID", + "oldOwnerUserID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "newOwnerUserID": { + "type": "string" + }, + "oldOwnerUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.TransferGroupOwnerResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.UpdateDepartmentReq": { + "type": "object", + "required": [ + "departmentID", + "operationID" + ], + "properties": { + "createTime": { + "type": "integer" + }, + "departmentID": { + "type": "string" + }, + "departmentType": { + "type": "integer" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "memberNum": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "parentID": { + "type": "string" + }, + "subDepartmentNum": { + "type": "integer" + } + } + }, + "base_info.UpdateDepartmentResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.UpdateOrganizationUserReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "birth": { + "type": "integer" + }, + "createTime": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "englishName": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "mobile": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "telephone": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.UpdateOrganizationUserResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.UpdateSelfUserInfoReq": { + "type": "object", + "required": [ + "operationID", + "userID" + ], + "properties": { + "birth": { + "type": "integer" + }, + "email": { + "type": "string", + "maxLength": 64 + }, + "ex": { + "type": "string", + "maxLength": 1024 + }, + "faceURL": { + "type": "string", + "maxLength": 1024 + }, + "gender": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ] + }, + "nickname": { + "type": "string", + "maxLength": 64, + "minLength": 1 + }, + "operationID": { + "type": "string" + }, + "phoneNumber": { + "type": "string", + "maxLength": 32 + }, + "userID": { + "type": "string", + "maxLength": 64, + "minLength": 1 + } + } + }, + "base_info.UpdateUserInDepartmentReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "departmentID": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "leader": { + "type": "integer" + }, + "operationID": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "position": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.UpdateUserInDepartmentResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.UpdateUserInfoResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.UserIDResult": { + "type": "object", + "properties": { + "result": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.UserRegisterReq": { + "type": "object", + "required": [ + "operationID", + "platform", + "secret", + "userID" + ], + "properties": { + "birth": { + "type": "integer" + }, + "email": { + "type": "string", + "maxLength": 64 + }, + "ex": { + "type": "string", + "maxLength": 1024 + }, + "faceURL": { + "type": "string", + "maxLength": 1024 + }, + "gender": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ] + }, + "nickname": { + "type": "string", + "maxLength": 64, + "minLength": 1 + }, + "operationID": { + "type": "string" + }, + "phoneNumber": { + "type": "string", + "maxLength": 32 + }, + "platform": { + "type": "integer", + "maximum": 7, + "minimum": 1 + }, + "secret": { + "type": "string", + "maxLength": 32 + }, + "userID": { + "type": "string", + "maxLength": 64, + "minLength": 1 + } + } + }, + "base_info.UserRegisterResp": { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/base_info.UserTokenInfo" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.UserTokenInfo": { + "type": "object", + "properties": { + "expiredTime": { + "type": "integer" + }, + "token": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.UserTokenReq": { + "type": "object", + "required": [ + "operationID", + "platform", + "secret", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "platform": { + "type": "integer", + "maximum": 8, + "minimum": 1 + }, + "secret": { + "type": "string", + "maxLength": 32 + }, + "userID": { + "type": "string", + "maxLength": 64, + "minLength": 1 + } + } + }, + "base_info.UserTokenResp": { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/base_info.UserTokenInfo" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.WorkMoment": { + "type": "object", + "properties": { + "atUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMomentUser" + } + }, + "comments": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.Comment" + } + }, + "content": { + "type": "string" + }, + "createTime": { + "type": "integer" + }, + "faceURL": { + "type": "string" + }, + "likeUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMomentUser" + } + }, + "permission": { + "type": "integer" + }, + "permissionUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMomentUser" + } + }, + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.WorkMomentUser": { + "type": "object", + "properties": { + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "internal_api_manage.FileElem": { + "type": "object", + "properties": { + "fileName": { + "type": "string" + }, + "filePath": { + "type": "string" + }, + "fileSize": { + "type": "integer" + }, + "sourceURL": { + "type": "string" + }, + "uuid": { + "type": "string" + } + } + }, + "internal_api_manage.OANotificationElem": { + "type": "object", + "required": [ + "notificationFaceURL", + "notificationName", + "notificationType", + "text" + ], + "properties": { + "ex": { + "type": "string" + }, + "fileElem": { + "$ref": "#/definitions/internal_api_manage.FileElem" + }, + "mixType": { + "type": "integer" + }, + "notificationFaceURL": { + "type": "string" + }, + "notificationName": { + "type": "string" + }, + "notificationType": { + "type": "integer" + }, + "pictureElem": { + "$ref": "#/definitions/internal_api_manage.PictureElem" + }, + "soundElem": { + "$ref": "#/definitions/internal_api_manage.SoundElem" + }, + "text": { + "type": "string" + }, + "url": { + "type": "string" + }, + "videoElem": { + "$ref": "#/definitions/internal_api_manage.VideoElem" + } + } + }, + "internal_api_manage.PictureBaseInfo": { + "type": "object", + "properties": { + "height": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "uuid": { + "type": "string" + }, + "width": { + "type": "integer" + } + } + }, + "internal_api_manage.PictureElem": { + "type": "object", + "properties": { + "bigPicture": { + "$ref": "#/definitions/internal_api_manage.PictureBaseInfo" + }, + "snapshotPicture": { + "$ref": "#/definitions/internal_api_manage.PictureBaseInfo" + }, + "sourcePath": { + "type": "string" + }, + "sourcePicture": { + "$ref": "#/definitions/internal_api_manage.PictureBaseInfo" + } + } + }, + "internal_api_manage.RevokeElem": { + "type": "object", + "required": [ + "revokeMsgClientID" + ], + "properties": { + "revokeMsgClientID": { + "type": "string" + } + } + }, + "internal_api_manage.SoundElem": { + "type": "object", + "properties": { + "dataSize": { + "type": "integer" + }, + "duration": { + "type": "integer" + }, + "soundPath": { + "type": "string" + }, + "sourceURL": { + "type": "string" + }, + "uuid": { + "type": "string" + } + } + }, + "internal_api_manage.TextElem": { + "type": "object", + "required": [ + "text" + ], + "properties": { + "text": { + "type": "string" + } + } + }, + "internal_api_manage.VideoElem": { + "type": "object", + "properties": { + "duration": { + "type": "integer" + }, + "snapshotHeight": { + "type": "integer" + }, + "snapshotPath": { + "type": "string" + }, + "snapshotSize": { + "type": "integer" + }, + "snapshotURL": { + "type": "string" + }, + "snapshotUUID": { + "type": "string" + }, + "snapshotWidth": { + "type": "integer" + }, + "videoPath": { + "type": "string" + }, + "videoSize": { + "type": "integer" + }, + "videoType": { + "type": "string" + }, + "videoURL": { + "type": "string" + }, + "videoUUID": { + "type": "string" + } + } + }, + "office.Comment": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "contentID": { + "type": "string" + }, + "createTime": { + "type": "integer" + }, + "faceURL": { + "type": "string" + }, + "replyUserID": { + "type": "string" + }, + "replyUserName": { + "type": "string" + }, + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "office.PermissionGroup": { + "type": "object", + "properties": { + "groupID": { + "type": "string" + }, + "groupName": { + "type": "string" + } + } + }, + "office.Tag": { + "type": "object", + "properties": { + "tagID": { + "type": "string" + }, + "tagName": { + "type": "string" + }, + "userList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.TagUser" + } + } + } + }, + "office.TagSendLog": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "sendTime": { + "type": "integer" + }, + "userList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.TagUser" + } + } + } + }, + "office.TagUser": { + "type": "object", + "properties": { + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "office.WorkMoment": { + "type": "object", + "properties": { + "atUserList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.WorkMomentUser" + } + }, + "comments": { + "type": "array", + "items": { + "$ref": "#/definitions/office.Comment" + } + }, + "content": { + "type": "string" + }, + "createTime": { + "type": "integer" + }, + "faceURL": { + "type": "string" + }, + "likeUserList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.WorkMomentUser" + } + }, + "permission": { + "type": "integer" + }, + "permissionGroupList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.PermissionGroup" + } + }, + "permissionUserList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.WorkMomentUser" + } + }, + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "office.WorkMomentUser": { + "type": "object", + "properties": { + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "pbRelay.GetUsersOnlineStatusResp_SuccessDetail": { + "type": "object", + "properties": { + "platform": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, + "pbRelay.GetUsersOnlineStatusResp_SuccessResult": { + "type": "object", + "properties": { + "detailPlatformStatus": { + "type": "array", + "items": { + "$ref": "#/definitions/pbRelay.GetUsersOnlineStatusResp_SuccessDetail" + } + }, + "status": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "server_api_params.Department": { + "type": "object", + "properties": { + "createTime": { + "type": "integer" + }, + "departmentID": { + "type": "string" + }, + "departmentType": { + "type": "integer" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "memberNum": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "parentID": { + "type": "string" + }, + "subDepartmentNum": { + "type": "integer" + } + } + }, + "server_api_params.DepartmentMember": { + "type": "object", + "properties": { + "departmentID": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "leader": { + "type": "integer" + }, + "order": { + "type": "integer" + }, + "position": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "server_api_params.FriendInfo": { + "type": "object", + "properties": { + "addSource": { + "type": "integer" + }, + "createTime": { + "type": "integer" + }, + "ex": { + "type": "string" + }, + "friendUser": { + "$ref": "#/definitions/server_api_params.UserInfo" + }, + "operatorUserID": { + "type": "string" + }, + "ownerUserID": { + "type": "string" + }, + "remark": { + "type": "string" + } + } + }, + "server_api_params.FriendRequest": { + "type": "object", + "properties": { + "createTime": { + "type": "integer" + }, + "ex": { + "type": "string" + }, + "fromFaceURL": { + "type": "string" + }, + "fromGender": { + "type": "integer" + }, + "fromNickname": { + "type": "string" + }, + "fromUserID": { + "type": "string" + }, + "handleMsg": { + "type": "string" + }, + "handleResult": { + "type": "integer" + }, + "handleTime": { + "type": "integer" + }, + "handlerUserID": { + "type": "string" + }, + "reqMsg": { + "type": "string" + }, + "toFaceURL": { + "type": "string" + }, + "toGender": { + "type": "integer" + }, + "toNickname": { + "type": "string" + }, + "toUserID": { + "type": "string" + } + } + }, + "server_api_params.GroupInfo": { + "type": "object", + "properties": { + "createTime": { + "type": "integer" + }, + "creatorUserID": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "groupID": { + "type": "string" + }, + "groupName": { + "type": "string" + }, + "groupType": { + "type": "integer" + }, + "introduction": { + "type": "string" + }, + "memberCount": { + "type": "integer" + }, + "needVerification": { + "type": "integer" + }, + "notification": { + "type": "string" + }, + "ownerUserID": { + "type": "string" + }, + "status": { + "type": "integer" + } + } + }, + "server_api_params.GroupMemberFullInfo": { + "type": "object", + "properties": { + "appMangerLevel": { + "type": "integer" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "groupID": { + "type": "string" + }, + "joinSource": { + "type": "integer" + }, + "joinTime": { + "type": "integer" + }, + "muteEndTime": { + "type": "integer" + }, + "nickname": { + "type": "string" + }, + "operatorUserID": { + "type": "string" + }, + "roleLevel": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "server_api_params.GroupRequest": { + "type": "object", + "properties": { + "ex": { + "type": "string" + }, + "groupInfo": { + "$ref": "#/definitions/server_api_params.GroupInfo" + }, + "handleMsg": { + "type": "string" + }, + "handleResult": { + "type": "integer" + }, + "handleTime": { + "type": "integer" + }, + "handleUserID": { + "type": "string" + }, + "reqMsg": { + "type": "string" + }, + "reqTime": { + "type": "integer" + }, + "userInfo": { + "$ref": "#/definitions/server_api_params.PublicUserInfo" + } + } + }, + "server_api_params.OfflinePushInfo": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "iOSBadgeCount": { + "type": "boolean" + }, + "iOSPushSound": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "server_api_params.OrganizationUser": { + "type": "object", + "properties": { + "birth": { + "type": "integer" + }, + "createTime": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "englishName": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "mobile": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "telephone": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "server_api_params.PublicUserInfo": { + "type": "object", + "properties": { + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "nickname": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "server_api_params.UserDepartmentMember": { + "type": "object", + "properties": { + "departmentMember": { + "$ref": "#/definitions/server_api_params.DepartmentMember" + }, + "organizationUser": { + "$ref": "#/definitions/server_api_params.OrganizationUser" + } + } + }, + "server_api_params.UserInDepartment": { + "type": "object", + "properties": { + "departmentMemberList": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.DepartmentMember" + } + }, + "organizationUser": { + "$ref": "#/definitions/server_api_params.OrganizationUser" + } + } + }, + "server_api_params.UserInfo": { + "type": "object", + "properties": { + "appMangerLevel": { + "type": "integer" + }, + "birth": { + "type": "integer" + }, + "createTime": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "globalRecvMsgOpt": { + "type": "integer" + }, + "nickname": { + "type": "string" + }, + "phoneNumber": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "server_api_params.UserSendMsgResp": { + "type": "object", + "properties": { + "clientMsgID": { + "type": "string" + }, + "sendTime": { + "type": "integer" + }, + "serverMsgID": { + "type": "string" + } + } + }, + "user.AccountCheckResp_SingleUserStatus": { + "type": "object", + "properties": { + "accountStatus": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + } + } +}` + +// SwaggerInfo holds exported Swagger Info so clients can modify it +var SwaggerInfo = &swag.Spec{ + Version: "1.0", + Host: "", + BasePath: "/", + Schemes: []string{}, + Title: "open-IM-Server API", + Description: "open-IM-Server 的API服务器文档, 文档中所有请求都有一个operationID字段用于链路追踪", + InfoInstanceName: "swagger", + SwaggerTemplate: docTemplate, +} + +func init() { + swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) +} diff --git a/cmd/open_im_api/docs/swagger.json b/cmd/open_im_api/docs/swagger.json new file mode 100644 index 000000000..d93a390f8 --- /dev/null +++ b/cmd/open_im_api/docs/swagger.json @@ -0,0 +1,8504 @@ +{ + "swagger": "2.0", + "info": { + "description": "open-IM-Server 的API服务器文档, 文档中所有请求都有一个operationID字段用于链路追踪", + "title": "open-IM-Server API", + "contact": {}, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version": "1.0" + }, + "basePath": "/", + "paths": { + "/auth/force_logout": { + "post": { + "description": "对应的平台强制登出", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "鉴权认证" + ], + "summary": "强制登出", + "operationId": "ForceLogout", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "platform为平台ID \u003cbr\u003e fromUserID为要执行强制登出的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.ForceLogoutReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.ForceLogoutResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/auth/parse_token": { + "post": { + "description": "解析当前用户token(token在请求头中传入)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "鉴权认证" + ], + "summary": "解析当前用户token", + "operationId": "ParseToken", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "secret为openIM密钥, 详细见服务端config.yaml secret字段\u003cbr\u003eplatform为平台ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.ParseTokenReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.ParseTokenResp" + }, + { + "type": "object", + "properties": { + "Data": { + "$ref": "#/definitions/base_info.ExpireTime" + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/auth/user_register": { + "post": { + "description": "用户注册", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "鉴权认证" + ], + "summary": "用户注册", + "operationId": "UserRegister", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "secret为openIM密钥, 详细见服务端config.yaml secret字段 \u003cbr\u003e platform为平台ID \u003cbr\u003e ex为拓展字段 \u003cbr\u003e gender为性别, 0为女, 1为男", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.UserRegisterReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.UserRegisterResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/auth/user_token": { + "post": { + "description": "获取用户的token", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "鉴权认证" + ], + "summary": "用户登录", + "operationId": "UserToken", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "secret为openIM密钥, 详细见服务端config.yaml secret字段 \u003cbr\u003e platform为平台ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.UserTokenReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.UserTokenResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/add_black": { + "post": { + "description": "添加黑名单", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "添加黑名单", + "operationId": "AddBlack", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为设置的用户 \u003cbr\u003e toUserID为被设置的用户", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.AddBlacklistReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.AddBlacklistResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/add_friend": { + "post": { + "description": "添加好友", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "添加好友", + "operationId": "AddFriend", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "reqMsg为申请信息 \u003cbr\u003e fromUserID为申请用户 \u003cbr\u003e toUserID为被添加用户", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.AddFriendReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.AddFriendResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/add_friend_response": { + "post": { + "description": "同意/拒绝好友请求", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "同意/拒绝好友请求", + "operationId": "AddFriendResponse", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID同意/拒绝的用户ID\u003cbr\u003etoUserID为申请用户D\u003cbr\u003ehandleMsg为处理信息\u003cbr\u003eflag为具体操作, 1为同意, 2为拒绝", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.AddFriendResponseReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.AddFriendResponseResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/delete_friend": { + "post": { + "description": "删除好友", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "删除好友", + "operationId": "DeleteFriend", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为操作用户\u003cbr\u003etoUserID为被删除用户", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteFriendReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteFriendResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/get_black_list": { + "post": { + "description": "获取黑名单列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "获取黑名单列表", + "operationId": "GetBlacklist", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID要获取黑名单的用户", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetBlackListReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetBlackListResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.PublicUserInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + } + } + } + }, + "/friend/get_friend_apply_list": { + "post": { + "description": "删除好友", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "获取好友申请列表", + "operationId": "GetFriendApplyList", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为要获取申请列表的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetFriendApplyListReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetFriendApplyListResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.FriendRequest" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + } + } + } + }, + "/friend/get_friend_list": { + "post": { + "description": "获取用户的好友列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "获取用户的好友列表", + "operationId": "GetFriendList", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为要获取好友列表的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetFriendListReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetFriendListResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.FriendInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/get_self_friend_apply_list": { + "post": { + "description": "获取自己的好友申请列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "获取自己的好友申请列表", + "operationId": "GetSelfFriendApplyList", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为自己的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetSelfApplyListReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetSelfApplyListResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.FriendRequest" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/import_friend": { + "post": { + "description": "批量加好友", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "批量加好友", + "operationId": "ImportFriend", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID批量加好友的用户ID\u003cbr\u003e friendUserIDList为", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.ImportFriendReq" + } + } + ], + "responses": { + "0": { + "description": "data列表中对象的result-1为添加该用户失败\u003cbr\u003e0为成功", + "schema": { + "$ref": "#/definitions/base_info.ImportFriendResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/is_friend": { + "post": { + "description": "检查用户之间是否为好友", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "检查用户之间是否为好友", + "operationId": "IsFriend", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为请求用户\u003cbr\u003e toUserID为要检查的用户", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.IsFriendReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.IsFriendResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/remove_black": { + "post": { + "description": "把用户移除黑名单", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "把用户移除黑名单", + "operationId": "RemoveBlack", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID要获取黑名单的用户", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.RemoveBlackListReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.RemoveBlackListResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/friend/set_friend_remark": { + "post": { + "description": "设置好友备注", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "好友相关" + ], + "summary": "设置好友备注", + "operationId": "SetFriendRemark", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为设置的用户\u003cbr\u003e toUserID为被设置的用户\u003cbr\u003e remark为好友备注", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SetFriendRemarkReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SetFriendRemarkResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/cancel_mute_group": { + "post": { + "description": "取消禁言群组", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "取消禁言群组", + "operationId": "CancelMuteGroup", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为群组ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CancelMuteGroupReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CancelMuteGroupResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/cancel_mute_group_member": { + "post": { + "description": "取消禁言群成员", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "取消禁言群成员", + "operationId": "CancelMuteGroupMember", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为群组ID \u003cbr\u003e userID为要取消禁言的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CancelMuteGroupMemberReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CancelMuteGroupMemberResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/create_group": { + "post": { + "description": "创建群组", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "创建群组", + "operationId": "CreateGroup", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupType这里填0代表普通群 \u003cbr\u003egroupName为群名称\u003cbr\u003e introduction为群介绍\u003cbr\u003e notification为群公共\u003cbr\u003eownerUserID为群主ID \u003cbr\u003e ex为群扩展字段 \u003cbr\u003e memberList中对象roleLevel为群员角色,1为普通用户 2为群主 3为管理员", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CreateGroupReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.CreateGroupResp" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/server_api_params.GroupInfo" + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/dismiss_group": { + "post": { + "description": "解散群组", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "解散群组", + "operationId": "DismissGroup", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为要解散的群组ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DismissGroupReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DismissGroupResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/get_group_all_member_list": { + "post": { + "description": "获取全部群成员列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "获取全部群成员列表", + "operationId": "GetGroupAllMemberList", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "GroupID为要获取群成员的群ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetGroupAllMemberReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetGroupAllMemberResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.GroupMemberFullInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/get_group_members_info": { + "post": { + "description": "获取群成员信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "获取群成员信息", + "operationId": "GetGroupMembersInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为要获取的群ID \u003cbr\u003e memberList为要获取群成员的群ID列表", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetGroupMembersInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetGroupMembersInfoResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.GroupMemberFullInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/get_groups_info": { + "post": { + "description": "通过群ID列表获取群信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "通过群ID列表获取群信息", + "operationId": "GetGroupsInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupIDList为群ID列表", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetGroupInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetGroupInfoResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/get_joined_group_list": { + "post": { + "description": "获取用户加入群列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "获取用户加入群列表", + "operationId": "GetJoinedGroupList", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为要获取的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetJoinedGroupListReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetJoinedGroupListResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.GroupInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/get_recv_group_applicationList": { + "post": { + "description": "获取用户收到的加群信息列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "获取用户收到的加群信息列表", + "operationId": "GetRecvGroupApplicationList", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "fromUserID为要获取的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetGroupApplicationListReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetGroupApplicationListResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.GroupRequest" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/get_user_req_group_applicationList": { + "post": { + "description": "获取用户加群申请列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "获取用户加群申请列表", + "operationId": "GetUserReqGroupApplicationList", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "userID为要获取的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserReqGroupApplicationListReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetGroupApplicationListResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.GroupRequest" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/group_application_response": { + "post": { + "description": "处理加群消息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "处理加群消息", + "operationId": "ApplicationGroupResponse", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为要处理的群ID \u003cbr\u003e fromUserID为要处理的用户ID \u003cbr\u003e handleMsg为处理结果信息 \u003cbr\u003e handleResult为处理结果 1为同意加群 2为拒绝加群", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.ApplicationGroupResponseReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.ApplicationGroupResponseResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/invite_user_to_group": { + "post": { + "description": "将用户拉入群组", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "将用户拉入群组", + "operationId": "InviteUserToGroup", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为要拉进的群组ID \u003cbr\u003e invitedUserIDList为要获取群成员的群ID列表 \u003cbr\u003e reason为原因", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.InviteUserToGroupReq" + } + } + ], + "responses": { + "0": { + "description": "result为结果码, -1为失败, 0为成功", + "schema": { + "$ref": "#/definitions/base_info.InviteUserToGroupResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/join_group": { + "post": { + "description": "加入群聊", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "加入群聊", + "operationId": "JoinGroup", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "reqMessage为申请进群信息\u003cbr\u003egroupID为申请的群ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.JoinGroupReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.JoinGroupResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/kick_group": { + "post": { + "description": "把用户踢出群组", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "把用户踢出群组", + "operationId": "KickGroupMember", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "GroupID为要操作的群ID \u003cbr\u003e kickedUserIDList为要踢出的群用户ID \u003cbr\u003e reason为原因", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.KickGroupMemberReq" + } + } + ], + "responses": { + "0": { + "description": "result为结果码, -1为失败, 0为成功", + "schema": { + "$ref": "#/definitions/base_info.KickGroupMemberResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/mute_group": { + "post": { + "description": "禁言群组", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "禁言群组", + "operationId": "MuteGroup", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为群组ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.MuteGroupReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.MuteGroupResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.MuteGroupResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.MuteGroupResp" + } + } + } + } + }, + "/group/mute_group_member": { + "post": { + "description": "禁言群成员", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "禁言群成员", + "operationId": "MuteGroupMember", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为群组ID \u003cbr\u003e userID为要禁言的用户ID \u003cbr\u003e mutedSeconds为禁言秒数", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.MuteGroupMemberReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DismissGroupResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/quit_group": { + "post": { + "description": "当前用户退出群聊", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "当前用户退出群聊", + "operationId": "QuitGroup", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为要退出的群ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.QuitGroupReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.QuitGroupResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/set_group_info": { + "post": { + "description": "设置群信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "设置群信息", + "operationId": "SetGroupInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "groupID为要修改的群ID\u003cbr\u003egroupName为新的群名称\u003cbr\u003enotification为群介绍 \u003cbr\u003e introduction为群公告 \u003cbr\u003e needVerification为加群验证 0为申请需要同意 邀请直接进 1为所有人进群需要验证,除了群主管理员邀请进群 2为直接进群", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SetGroupInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SetGroupInfoResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/set_group_member_info": { + "post": { + "description": "修改群成员信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "修改群成员信息", + "operationId": "SetGroupMemberInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "除了operationID, userID, groupID其他参数可选\u003cbr\u003eex为拓展字段\u003cbr\u003efaceURL为群头像\u003cbr\u003enickName为群昵称\u003cbr\u003eroleLevel为群员角色,1为普通用户 2为群主 3为管理员", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SetGroupMemberInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SetGroupMemberInfoResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/group/transfer_group": { + "post": { + "description": "转让群主", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "群组相关" + ], + "summary": "转让群主", + "operationId": "TransferGroupOwner", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "GroupID为要操作的群ID \u003cbr\u003e oldOwnerUserID为老群主ID \u003cbr\u003e newOwnerUserID为新群主ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.TransferGroupOwnerReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.TransferGroupOwnerResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/msg/batch_send_msg": { + "post": { + "description": "管理员批量发送群聊单聊消息 消息格式详细见\u003ca href=\"https://doc.rentsoft.cn/#/server_doc/admin?id=%e6%b6%88%e6%81%af%e7%b1%bb%e5%9e%8b%e6%a0%bc%e5%bc%8f%e6%8f%8f%e8%bf%b0\"\u003e消息格式\u003c/href\u003e", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "消息相关" + ], + "summary": "管理员批量发送群聊单聊消息", + "operationId": "ManagementBatchSendMsg", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "该请求和消息结构体一样 \u003cbr\u003e recvIDList为接受消息的用户ID列表", + "name": "管理员批量发送单聊消息", + "in": "body", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.ManagementBatchSendMsgReq" + }, + { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/Open_IM_internal_api_manage.TextElem" + } + } + } + ] + } + }, + { + "description": "该请求和消息结构体一样 \u003cbr\u003e recvIDList为接受消息的用户ID列表", + "name": "管理员批量发送OA通知", + "in": "body", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.ManagementSendMsgReq" + }, + { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/Open_IM_internal_api_manage.OANotificationElem" + } + } + } + ] + } + } + ], + "responses": { + "0": { + "description": "serverMsgID为服务器消息ID \u003cbr\u003e clientMsgID为客户端消息ID \u003cbr\u003e sendTime为发送消息时间", + "schema": { + "$ref": "#/definitions/base_info.ManagementBatchSendMsgReq" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.ManagementBatchSendMsgReq" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.ManagementBatchSendMsgReq" + } + } + } + } + }, + "/msg/clear_msg": { + "post": { + "description": "清空用户消息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "消息相关" + ], + "summary": "清空用户消息", + "operationId": "ClearMsg", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "userID为要清空的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CleanUpMsgReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CleanUpMsgResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/msg/del_msg": { + "post": { + "description": "根据seq列表删除消息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "消息相关" + ], + "summary": "根据seq列表删除消息", + "operationId": "DelMsg", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "userID为要删除的用户ID \u003cbr\u003e seqList为seq列表", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DelMsgReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DelMsgResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/msg/get_all_conversations": { + "post": { + "description": "获取用户所有会话", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "会话相关" + ], + "summary": "获取用户所有会话", + "operationId": "GetAllConversations", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "ownerUserID为要获取的用户ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetAllConversationsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetAllConversationsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/msg/get_conversation": { + "post": { + "description": "根据会话ID获取会话", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "会话相关" + ], + "summary": "根据会话ID获取会话", + "operationId": "GetConversation", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "ownerUserID为要获取的用户ID\u003cbr\u003econversationID为要获取的会话ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetConversationReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetConversationResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/msg/get_conversations": { + "post": { + "description": "根据会话ID列表获取会话", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "会话相关" + ], + "summary": "根据会话ID列表获取会话", + "operationId": "GetConversations", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "ownerUserID为要获取的用户ID\u003cbr\u003econversationIDs为要获取的会话ID列表", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetConversationsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetConversationsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/msg/manage_send_msg": { + "post": { + "description": "管理员发送/撤回消息 消息格式详细见\u003ca href=\"https://doc.rentsoft.cn/#/server_doc/admin?id=%e6%b6%88%e6%81%af%e7%b1%bb%e5%9e%8b%e6%a0%bc%e5%bc%8f%e6%8f%8f%e8%bf%b0\"\u003e消息格式\u003c/href\u003e", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "消息相关" + ], + "summary": "管理员发送/撤回消息", + "operationId": "ManagementSendMsg", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "该请求和消息结构体一样", + "name": "管理员发送文字消息", + "in": "body", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.ManagementSendMsgReq" + }, + { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/Open_IM_internal_api_manage.TextElem" + } + } + } + ] + } + }, + { + "description": "该请求和消息结构体一样", + "name": "管理员发送OA通知消息", + "in": "body", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.ManagementSendMsgReq" + }, + { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/Open_IM_internal_api_manage.OANotificationElem" + } + } + } + ] + } + }, + { + "description": "该请求和消息结构体一样", + "name": "管理员撤回单聊消息", + "in": "body", + "required": true, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.ManagementSendMsgReq" + }, + { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/Open_IM_internal_api_manage.RevokeElem" + } + } + } + ] + } + } + ], + "responses": { + "0": { + "description": "serverMsgID为服务器消息ID \u003cbr\u003e clientMsgID为客户端消息ID \u003cbr\u003e sendTime为发送消息时间", + "schema": { + "$ref": "#/definitions/base_info.ManagementSendMsgResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.ManagementSendMsgResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.ManagementSendMsgResp" + } + } + } + } + }, + "/office/comment_one_work_moment": { + "post": { + "description": "评论一条工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "评论一条工作圈", + "operationId": "CommentOneWorkMoment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CommentOneWorkMomentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CommentOneWorkMomentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/create_one_work_moment": { + "post": { + "description": "用户创建一条工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "创建一条工作圈", + "operationId": "CreateOneWorkMoment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求 atUserList likeUserList permissionGroupList permissionUserList 字段中userName可以不填", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CreateOneWorkMomentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CreateOneWorkMomentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/create_tag": { + "post": { + "description": "创建标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "创建标签", + "operationId": "CreateTag", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CreateTagReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CreateTagResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/delete_comment": { + "post": { + "description": "删除一条评论", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "删除一条评论", + "operationId": "DeleteComment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteCommentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteCommentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/delete_one_work_moment": { + "post": { + "description": "根据用户工作圈ID删除一条工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "删除一条工作圈", + "operationId": "DeleteOneWorkMoment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteOneWorkMomentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteOneWorkMomentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/delete_tag": { + "post": { + "description": "根据标签ID创建标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "删除标签", + "operationId": "DeleteTag", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteTagReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteTagResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/get_send_tag_log": { + "post": { + "description": "分页获取发送历史记录", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "获取发送历史记录", + "operationId": "GetTagSendLogs", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetTagSendLogsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetTagSendLogsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/get_user_friend_work_moments": { + "post": { + "description": "查询用户工作圈页面", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "查询自己大工作圈页面", + "operationId": "GetUserFriendWorkMoments", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserFriendWorkMomentsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUserFriendWorkMomentsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/get_user_tag_by_id": { + "post": { + "description": "通过标签id获取该用户的标签信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "获取该用户的标签信息", + "operationId": "GetUserTagByID", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserTagByIDReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUserTagByIDResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/get_user_tags": { + "post": { + "description": "用户获取自己的所有的标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "获取用户标签信息", + "operationId": "GetUserTags", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserTagsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUserTagsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/get_user_work_moments": { + "post": { + "description": "查询用户工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "查询用户工作圈", + "operationId": "GetUserWorkMoments", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserWorkMomentsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUserWorkMomentsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/get_work_moment_by_id": { + "post": { + "description": "通过ID获取工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "通过ID获取工作圈", + "operationId": "GetWorkMomentByID", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetWorkMomentByIDReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetWorkMomentByIDResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/like_one_work_moment": { + "post": { + "description": "工作圈ID点赞一条工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "点赞一条工作圈", + "operationId": "LikeOneWorkMoment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.LikeOneWorkMomentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.LikeOneWorkMomentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/send_msg_to_tag": { + "post": { + "description": "对标签用户发送消息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "发送标签消息", + "operationId": "SendMsg2Tag", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SendMsg2TagReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SendMsg2TagResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/office/set_tag": { + "post": { + "description": "根据标签ID修改标签用户列表, 名称", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "修改标签", + "operationId": "SetTag", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SetTagReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SetTagResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/create_department": { + "post": { + "description": "创建部门", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "创建部门", + "operationId": "CreateDepartment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CreateDepartmentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.CreateDepartmentResp" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/server_api_params.Department" + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/create_department_member": { + "post": { + "description": "创建部门用户", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "创建部门用户", + "operationId": "CreateDepartmentMember", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CreateDepartmentMemberReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CreateDepartmentMemberResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/create_organization_user": { + "post": { + "description": "组织架构导入用户", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "组织架构导入用户", + "operationId": "CreateOrganizationUser", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CreateOrganizationUserReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CreateOrganizationUserResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/delete_department": { + "post": { + "description": "删除部门", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "删除部门", + "operationId": "DeleteDepartment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteDepartmentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteDepartmentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/delete_organization_user": { + "post": { + "description": "删除组织架构中某个用户", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "删除组织架构中某个用户", + "operationId": "DeleteOrganizationUser", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteOrganizationUserReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteOrganizationUserResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/delete_user_in_department": { + "post": { + "description": "删除部门中某个用户", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "删除部门中某个用户", + "operationId": "DeleteUserInDepartment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteUserInDepartmentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteUserInDepartmentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/get_department_member": { + "post": { + "description": "获取部门中所有成员", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "获取部门中所有成员", + "operationId": "GetDepartmentMember", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetDepartmentMemberReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetDepartmentMemberResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.UserDepartmentMember" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/get_sub_department": { + "post": { + "description": "获取子部门列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "获取子部门列表", + "operationId": "GetSubDepartment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetSubDepartmentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetSubDepartmentResp" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.Department" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/get_user_in_department": { + "post": { + "description": "获取部门中的所有用户", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "获取部门中的所有用户", + "operationId": "GetUserInDepartment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserInDepartmentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetUserInDepartmentResp" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/server_api_params.UserInDepartment" + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/update_department": { + "post": { + "description": "更新部门信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "更新部门信息", + "operationId": "UpdateDepartment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.UpdateDepartmentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.UpdateDepartmentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/update_organization_user": { + "post": { + "description": "更新组织架构中的用户", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "更新组织架构中的用户", + "operationId": "UpdateOrganizationUser", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.UpdateOrganizationUserReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.UpdateOrganizationUserResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/organization/update_user_in_department": { + "post": { + "description": "更新部门中某个用户", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "组织架构相关" + ], + "summary": "更新部门中某个用户", + "operationId": "UpdateUserInDepartment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.UpdateUserInDepartmentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.UpdateUserInDepartmentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/third/minio_upload": { + "post": { + "description": "minio上传文件(web api), 请注意本api请求为form并非json", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "第三方服务相关" + ], + "summary": "minio上传文件(web api)", + "operationId": "MinioUploadFile", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "type": "file", + "description": "要上传的文件文件", + "name": "file", + "in": "formData", + "required": true + }, + { + "type": "integer", + "description": "文件类型", + "name": "fileType", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "操作唯一ID", + "name": "operationID", + "in": "formData", + "required": true + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.MinioUploadFileResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/user/account_check": { + "post": { + "description": "传入UserIDList检查列表账户注册状态,并且返回结果", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "检查列表账户注册状态,并且返回结果", + "operationId": "AccountCheck", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.AccountCheckReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.AccountCheckResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/user/get_all_users_uid": { + "post": { + "description": "获取所有用户uid列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "获取所有用户uid列表", + "operationId": "GetAllUsersUid", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetAllUsersUidReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetAllUsersUidResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/user/get_self_user_info": { + "post": { + "description": "传入ID获取自己的信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "获取自己的信息", + "operationId": "GetSelfUserInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetSelfUserInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetSelfUserInfoResp" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/server_api_params.UserInfo" + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/user/get_users_info": { + "post": { + "description": "根据用户列表批量获取用户信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "获取用户信息", + "operationId": "GetUsersInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUsersInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/base_info.GetUsersInfoResp" + }, + { + "type": "object", + "properties": { + "Data": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.PublicUserInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/user/get_users_online_status": { + "post": { + "description": "获取用户在线状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "获取用户在线状态", + "operationId": "GetUsersOnlineStatus", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUsersOnlineStatusReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUsersOnlineStatusResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/user/set_global_msg_recv_opt": { + "post": { + "description": "设置全局免打扰", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "设置全局免打扰", + "operationId": "SetGlobalRecvMessageOpt", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "globalRecvMsgOpt为全局免打扰设置0为关闭 1为开启", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SetGlobalRecvMessageOptReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SetGlobalRecvMessageOptResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + }, + "/user/update_user_info": { + "post": { + "description": "修改用户信息 userID faceURL等", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "修改用户信息", + "operationId": "UpdateUserInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.UpdateSelfUserInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.UpdateUserInfoResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.Swagger400Resp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.Swagger500Resp" + } + } + } + } + } + }, + "definitions": { + "Open_IM_internal_api_manage.FileElem": { + "type": "object", + "properties": { + "fileName": { + "type": "string" + }, + "filePath": { + "type": "string" + }, + "fileSize": { + "type": "integer" + }, + "sourceURL": { + "type": "string" + }, + "uuid": { + "type": "string" + } + } + }, + "Open_IM_internal_api_manage.OANotificationElem": { + "type": "object", + "required": [ + "notificationFaceURL", + "notificationName", + "notificationType", + "text" + ], + "properties": { + "ex": { + "type": "string" + }, + "fileElem": { + "$ref": "#/definitions/Open_IM_internal_api_manage.FileElem" + }, + "mixType": { + "type": "integer" + }, + "notificationFaceURL": { + "type": "string" + }, + "notificationName": { + "type": "string" + }, + "notificationType": { + "type": "integer" + }, + "pictureElem": { + "$ref": "#/definitions/Open_IM_internal_api_manage.PictureElem" + }, + "soundElem": { + "$ref": "#/definitions/Open_IM_internal_api_manage.SoundElem" + }, + "text": { + "type": "string" + }, + "url": { + "type": "string" + }, + "videoElem": { + "$ref": "#/definitions/Open_IM_internal_api_manage.VideoElem" + } + } + }, + "Open_IM_internal_api_manage.PictureBaseInfo": { + "type": "object", + "properties": { + "height": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "uuid": { + "type": "string" + }, + "width": { + "type": "integer" + } + } + }, + "Open_IM_internal_api_manage.PictureElem": { + "type": "object", + "properties": { + "bigPicture": { + "$ref": "#/definitions/Open_IM_internal_api_manage.PictureBaseInfo" + }, + "snapshotPicture": { + "$ref": "#/definitions/Open_IM_internal_api_manage.PictureBaseInfo" + }, + "sourcePath": { + "type": "string" + }, + "sourcePicture": { + "$ref": "#/definitions/Open_IM_internal_api_manage.PictureBaseInfo" + } + } + }, + "Open_IM_internal_api_manage.RevokeElem": { + "type": "object", + "required": [ + "revokeMsgClientID" + ], + "properties": { + "revokeMsgClientID": { + "type": "string" + } + } + }, + "Open_IM_internal_api_manage.SoundElem": { + "type": "object", + "properties": { + "dataSize": { + "type": "integer" + }, + "duration": { + "type": "integer" + }, + "soundPath": { + "type": "string" + }, + "sourceURL": { + "type": "string" + }, + "uuid": { + "type": "string" + } + } + }, + "Open_IM_internal_api_manage.TextElem": { + "type": "object", + "required": [ + "text" + ], + "properties": { + "text": { + "type": "string" + } + } + }, + "Open_IM_internal_api_manage.VideoElem": { + "type": "object", + "properties": { + "duration": { + "type": "integer" + }, + "snapshotHeight": { + "type": "integer" + }, + "snapshotPath": { + "type": "string" + }, + "snapshotSize": { + "type": "integer" + }, + "snapshotURL": { + "type": "string" + }, + "snapshotUUID": { + "type": "string" + }, + "snapshotWidth": { + "type": "integer" + }, + "videoPath": { + "type": "string" + }, + "videoSize": { + "type": "integer" + }, + "videoType": { + "type": "string" + }, + "videoURL": { + "type": "string" + }, + "videoUUID": { + "type": "string" + } + } + }, + "base_info.AccountCheckReq": { + "type": "object", + "required": [ + "checkUserIDList", + "operationID" + ], + "properties": { + "checkUserIDList": { + "type": "array", + "maxItems": 100, + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.AccountCheckResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/user.AccountCheckResp_SingleUserStatus" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.AddBlacklistReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID", + "toUserID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "toUserID": { + "type": "string" + } + } + }, + "base_info.AddBlacklistResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.AddFriendReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID", + "toUserID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "reqMsg": { + "type": "string" + }, + "toUserID": { + "type": "string" + } + } + }, + "base_info.AddFriendResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.AddFriendResponseReq": { + "type": "object", + "required": [ + "flag", + "fromUserID", + "operationID", + "toUserID" + ], + "properties": { + "flag": { + "type": "integer", + "enum": [ + -1, + 0, + 1 + ] + }, + "fromUserID": { + "type": "string" + }, + "handleMsg": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "toUserID": { + "type": "string" + } + } + }, + "base_info.AddFriendResponseResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.ApplicationGroupResponseReq": { + "type": "object", + "required": [ + "fromUserID", + "groupID", + "handleResult", + "operationID" + ], + "properties": { + "fromUserID": { + "description": "application from FromUserID", + "type": "string" + }, + "groupID": { + "type": "string" + }, + "handleResult": { + "type": "integer", + "enum": [ + -1, + 1 + ] + }, + "handledMsg": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.ApplicationGroupResponseResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CancelMuteGroupMemberReq": { + "type": "object", + "required": [ + "groupID", + "operationID", + "userID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.CancelMuteGroupMemberResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CancelMuteGroupReq": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.CancelMuteGroupResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CleanUpMsgReq": { + "type": "object", + "required": [ + "operationID", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.CleanUpMsgResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.Comment": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "contentID": { + "type": "string" + }, + "createTime": { + "type": "integer" + }, + "replyUserID": { + "type": "string" + }, + "replyUserName": { + "type": "string" + }, + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "base_info.CommentOneWorkMomentReq": { + "type": "object", + "required": [ + "content", + "operationID", + "workMomentID" + ], + "properties": { + "content": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "replyUserID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.CommentOneWorkMomentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.Conversation": { + "type": "object", + "required": [ + "conversationID", + "conversationType", + "ownerUserID" + ], + "properties": { + "attachedInfo": { + "type": "string" + }, + "conversationID": { + "type": "string" + }, + "conversationType": { + "type": "integer" + }, + "draftTextTime": { + "type": "integer" + }, + "ex": { + "type": "string" + }, + "groupAtType": { + "type": "integer" + }, + "groupID": { + "type": "string" + }, + "isNotInGroup": { + "type": "boolean" + }, + "isPinned": { + "type": "boolean" + }, + "isPrivateChat": { + "type": "boolean" + }, + "ownerUserID": { + "type": "string" + }, + "recvMsgOpt": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ] + }, + "unreadCount": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.CreateDepartmentMemberReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "departmentID": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "leader": { + "type": "integer" + }, + "operationID": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "position": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.CreateDepartmentMemberResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CreateDepartmentReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "createTime": { + "type": "integer" + }, + "departmentID": { + "type": "string" + }, + "departmentType": { + "type": "integer" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "memberNum": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "parentID": { + "type": "string" + }, + "subDepartmentNum": { + "type": "integer" + } + } + }, + "base_info.CreateDepartmentResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CreateGroupReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "groupID": { + "type": "string" + }, + "groupName": { + "type": "string" + }, + "groupType": { + "type": "integer" + }, + "introduction": { + "type": "string" + }, + "memberList": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.GroupAddMemberInfo" + } + }, + "notification": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "ownerUserID": { + "type": "string" + } + } + }, + "base_info.CreateGroupResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CreateOneWorkMomentReq": { + "type": "object", + "properties": { + "operationID": { + "type": "string" + }, + "workMoment": { + "$ref": "#/definitions/office.WorkMoment" + } + } + }, + "base_info.CreateOneWorkMomentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CreateOrganizationUserReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "birth": { + "type": "integer" + }, + "createTime": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "englishName": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "mobile": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "telephone": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.CreateOrganizationUserResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CreateTagReq": { + "type": "object", + "required": [ + "operationID", + "tagName", + "userIDList" + ], + "properties": { + "operationID": { + "type": "string" + }, + "tagName": { + "description": "tag名称", + "type": "string" + }, + "userIDList": { + "description": "用户ID列表", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "base_info.CreateTagResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DelMsgReq": { + "type": "object", + "required": [ + "operationID", + "seqList", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "seqList": { + "type": "array", + "items": { + "type": "integer" + } + }, + "userID": { + "type": "string" + } + } + }, + "base_info.DelMsgResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteCommentReq": { + "type": "object", + "required": [ + "contentID", + "operationID", + "workMomentID" + ], + "properties": { + "contentID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.DeleteCommentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteDepartmentReq": { + "type": "object", + "required": [ + "departmentID", + "operationID" + ], + "properties": { + "departmentID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.DeleteDepartmentResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteFriendReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID", + "toUserID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "toUserID": { + "type": "string" + } + } + }, + "base_info.DeleteFriendResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteOneWorkMomentReq": { + "type": "object", + "required": [ + "operationID", + "workMomentID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.DeleteOneWorkMomentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteOrganizationUserReq": { + "type": "object", + "required": [ + "operationID", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.DeleteOrganizationUserResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteTagReq": { + "type": "object", + "required": [ + "operationID", + "tagID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "tagID": { + "type": "string" + } + } + }, + "base_info.DeleteTagResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteUserInDepartmentReq": { + "type": "object", + "required": [ + "departmentID", + "operationID", + "userID" + ], + "properties": { + "departmentID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.DeleteUserInDepartmentResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DismissGroupReq": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.DismissGroupResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.ExpireTime": { + "type": "object", + "properties": { + "expireTimeSeconds": { + "type": "integer" + } + } + }, + "base_info.ForceLogoutReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID", + "platform" + ], + "properties": { + "fromUserID": { + "type": "string", + "maxLength": 64, + "minLength": 1 + }, + "operationID": { + "type": "string" + }, + "platform": { + "type": "integer", + "maximum": 8, + "minimum": 1 + } + } + }, + "base_info.ForceLogoutResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetAllConversationsReq": { + "type": "object", + "required": [ + "operationID", + "ownerUserID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "ownerUserID": { + "type": "string" + } + } + }, + "base_info.GetAllConversationsResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.Conversation" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetAllUsersUidReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "base_info.GetAllUsersUidResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "string" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetBlackListReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetBlackListResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetConversationReq": { + "type": "object", + "required": [ + "conversationID", + "operationID", + "ownerUserID" + ], + "properties": { + "conversationID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "ownerUserID": { + "type": "string" + } + } + }, + "base_info.GetConversationResp": { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/base_info.Conversation" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetConversationsReq": { + "type": "object", + "required": [ + "conversationIDs", + "operationID", + "ownerUserID" + ], + "properties": { + "conversationIDs": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + }, + "ownerUserID": { + "type": "string" + } + } + }, + "base_info.GetConversationsResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.Conversation" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetDepartmentMemberReq": { + "type": "object", + "required": [ + "departmentID", + "operationID" + ], + "properties": { + "departmentID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetDepartmentMemberResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetFriendApplyListReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetFriendApplyListResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetFriendListReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetFriendListResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetGroupAllMemberReq": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetGroupAllMemberResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetGroupApplicationListReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID" + ], + "properties": { + "fromUserID": { + "description": "作为管理员或群主收到的 进群申请", + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetGroupApplicationListResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetGroupInfoReq": { + "type": "object", + "required": [ + "groupIDList", + "operationID" + ], + "properties": { + "groupIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetGroupInfoResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetGroupMembersInfoReq": { + "type": "object", + "required": [ + "groupID", + "memberList", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "memberList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetGroupMembersInfoResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetJoinedGroupListReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetJoinedGroupListResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetSelfApplyListReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetSelfApplyListResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetSelfUserInfoReq": { + "type": "object", + "required": [ + "operationID", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.GetSelfUserInfoResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetSubDepartmentReq": { + "type": "object", + "required": [ + "departmentID", + "operationID" + ], + "properties": { + "departmentID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetSubDepartmentResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetTagSendLogsReq": { + "type": "object", + "required": [ + "operationID", + "pageNumber", + "showNumber" + ], + "properties": { + "operationID": { + "type": "string" + }, + "pageNumber": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + } + } + }, + "base_info.GetTagSendLogsResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "logs": { + "type": "array", + "items": { + "$ref": "#/definitions/office.TagSendLog" + } + }, + "showNumber": { + "type": "integer" + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserFriendWorkMomentsReq": { + "type": "object", + "required": [ + "operationID", + "pageNumber", + "showNumber" + ], + "properties": { + "operationID": { + "type": "string" + }, + "pageNumber": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + } + } + }, + "base_info.GetUserFriendWorkMomentsResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + }, + "workMoments": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMoment" + } + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserInDepartmentReq": { + "type": "object", + "required": [ + "operationID", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.GetUserInDepartmentResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserReqGroupApplicationListReq": { + "type": "object", + "required": [ + "operationID", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.GetUserTagByIDReq": { + "type": "object", + "required": [ + "operationID", + "tagID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "tagID": { + "type": "string" + } + } + }, + "base_info.GetUserTagByIDResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "tag": { + "$ref": "#/definitions/office.Tag" + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserTagsReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "base_info.GetUserTagsResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/office.Tag" + } + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserWorkMomentsReq": { + "type": "object", + "required": [ + "operationID", + "pageNumber", + "showNumber" + ], + "properties": { + "operationID": { + "type": "string" + }, + "pageNumber": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.GetUserWorkMomentsResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + }, + "workMoments": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMoment" + } + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUsersInfoReq": { + "type": "object", + "required": [ + "operationID", + "userIDList" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userIDList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "base_info.GetUsersInfoResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUsersOnlineStatusReq": { + "type": "object", + "required": [ + "operationID", + "userIDList" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userIDList": { + "type": "array", + "maxItems": 200, + "items": { + "type": "string" + } + } + } + }, + "base_info.GetUsersOnlineStatusResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/pbRelay.GetUsersOnlineStatusResp_SuccessResult" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetWorkMomentByIDReq": { + "type": "object", + "required": [ + "operationID", + "workMomentID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.GetWorkMomentByIDResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "workMoment": { + "$ref": "#/definitions/base_info.WorkMoment" + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GroupAddMemberInfo": { + "type": "object", + "required": [ + "roleLevel", + "userID" + ], + "properties": { + "roleLevel": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.ImportFriendReq": { + "type": "object", + "required": [ + "friendUserIDList", + "fromUserID", + "operationID" + ], + "properties": { + "friendUserIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.ImportFriendResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.UserIDResult" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.InviteUserToGroupReq": { + "type": "object", + "required": [ + "groupID", + "invitedUserIDList", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "invitedUserIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + }, + "reason": { + "type": "string" + } + } + }, + "base_info.InviteUserToGroupResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.UserIDResult" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.IsFriendReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID", + "toUserID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "toUserID": { + "type": "string" + } + } + }, + "base_info.IsFriendResp": { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/base_info.Response" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.JoinGroupReq": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "reqMessage": { + "type": "string" + } + } + }, + "base_info.JoinGroupResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.KickGroupMemberReq": { + "type": "object", + "required": [ + "groupID", + "kickedUserIDList", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "kickedUserIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + }, + "reason": { + "type": "string" + } + } + }, + "base_info.KickGroupMemberResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.UserIDResult" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.LikeOneWorkMomentReq": { + "type": "object", + "required": [ + "operationID", + "workMomentID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.LikeOneWorkMomentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.ManagementBatchSendMsgReq": { + "type": "object", + "required": [ + "contentType", + "operationID", + "sendID", + "sessionType" + ], + "properties": { + "contentType": { + "type": "integer" + }, + "groupID": { + "type": "string" + }, + "isOnlineOnly": { + "type": "boolean" + }, + "offlinePushInfo": { + "$ref": "#/definitions/server_api_params.OfflinePushInfo" + }, + "operationID": { + "type": "string" + }, + "recvIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "sendID": { + "type": "string" + }, + "senderFaceURL": { + "type": "string" + }, + "senderNickname": { + "type": "string" + }, + "senderPlatformID": { + "type": "integer" + }, + "sessionType": { + "type": "integer" + } + } + }, + "base_info.ManagementSendMsgReq": { + "type": "object", + "required": [ + "contentType", + "operationID", + "sendID", + "sessionType" + ], + "properties": { + "contentType": { + "type": "integer" + }, + "groupID": { + "type": "string" + }, + "isOnlineOnly": { + "type": "boolean" + }, + "offlinePushInfo": { + "$ref": "#/definitions/server_api_params.OfflinePushInfo" + }, + "operationID": { + "type": "string" + }, + "recvID": { + "type": "string" + }, + "sendID": { + "type": "string" + }, + "senderFaceURL": { + "type": "string" + }, + "senderNickname": { + "type": "string" + }, + "senderPlatformID": { + "type": "integer" + }, + "sessionType": { + "type": "integer" + } + } + }, + "base_info.ManagementSendMsgResp": { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/server_api_params.UserSendMsgResp" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.MinioUploadFileResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "URL": { + "type": "string" + }, + "newName": { + "type": "string" + }, + "snapshotName": { + "type": "string" + }, + "snapshotURL": { + "type": "string" + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.MuteGroupMemberReq": { + "type": "object", + "required": [ + "groupID", + "mutedSeconds", + "operationID", + "userID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "mutedSeconds": { + "type": "integer" + }, + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.MuteGroupReq": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.MuteGroupResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.ParseTokenReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "base_info.ParseTokenResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.QuitGroupReq": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.QuitGroupResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.RemoveBlackListReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID", + "toUserID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "toUserID": { + "type": "string" + } + } + }, + "base_info.RemoveBlackListResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.Response": { + "type": "object", + "properties": { + "isFriend": { + "type": "boolean" + } + } + }, + "base_info.SendMsg2TagReq": { + "type": "object", + "required": [ + "content", + "operationID", + "senderPlatformID" + ], + "properties": { + "content": { + "type": "string" + }, + "groupList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + }, + "senderPlatformID": { + "type": "integer" + }, + "tagList": { + "type": "array", + "items": { + "type": "string" + } + }, + "userList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "base_info.SendMsg2TagResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.SetFriendRemarkReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID", + "remark", + "toUserID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "toUserID": { + "type": "string" + } + } + }, + "base_info.SetFriendRemarkResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.SetGlobalRecvMessageOptReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "globalRecvMsgOpt": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ] + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.SetGlobalRecvMessageOptResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.SetGroupInfoReq": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "groupID": { + "type": "string" + }, + "groupName": { + "type": "string" + }, + "introduction": { + "type": "string" + }, + "needVerification": { + "type": "integer" + }, + "notification": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.SetGroupInfoResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.SetGroupMemberInfoReq": { + "type": "object", + "required": [ + "groupID", + "operationID", + "userID" + ], + "properties": { + "ex": { + "type": "string" + }, + "groupID": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "roleLevel": { + "type": "integer", + "maximum": 3, + "minimum": 1 + }, + "userGroupFaceUrl": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.SetGroupMemberInfoResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.SetTagReq": { + "type": "object", + "required": [ + "operationID", + "tagID" + ], + "properties": { + "increaseUserIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "newName": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "reduceUserIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "tagID": { + "type": "string" + } + } + }, + "base_info.SetTagResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.Swagger400Resp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer", + "example": 400 + }, + "errMsg": { + "type": "string", + "example": "err msg" + } + } + }, + "base_info.Swagger500Resp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer", + "example": 500 + }, + "errMsg": { + "type": "string", + "example": "err msg" + } + } + }, + "base_info.TransferGroupOwnerReq": { + "type": "object", + "required": [ + "groupID", + "newOwnerUserID", + "oldOwnerUserID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "newOwnerUserID": { + "type": "string" + }, + "oldOwnerUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.TransferGroupOwnerResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.UpdateDepartmentReq": { + "type": "object", + "required": [ + "departmentID", + "operationID" + ], + "properties": { + "createTime": { + "type": "integer" + }, + "departmentID": { + "type": "string" + }, + "departmentType": { + "type": "integer" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "memberNum": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "parentID": { + "type": "string" + }, + "subDepartmentNum": { + "type": "integer" + } + } + }, + "base_info.UpdateDepartmentResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.UpdateOrganizationUserReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "birth": { + "type": "integer" + }, + "createTime": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "englishName": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "mobile": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "telephone": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.UpdateOrganizationUserResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.UpdateSelfUserInfoReq": { + "type": "object", + "required": [ + "operationID", + "userID" + ], + "properties": { + "birth": { + "type": "integer" + }, + "email": { + "type": "string", + "maxLength": 64 + }, + "ex": { + "type": "string", + "maxLength": 1024 + }, + "faceURL": { + "type": "string", + "maxLength": 1024 + }, + "gender": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ] + }, + "nickname": { + "type": "string", + "maxLength": 64, + "minLength": 1 + }, + "operationID": { + "type": "string" + }, + "phoneNumber": { + "type": "string", + "maxLength": 32 + }, + "userID": { + "type": "string", + "maxLength": 64, + "minLength": 1 + } + } + }, + "base_info.UpdateUserInDepartmentReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "departmentID": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "leader": { + "type": "integer" + }, + "operationID": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "position": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.UpdateUserInDepartmentResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.UpdateUserInfoResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.UserIDResult": { + "type": "object", + "properties": { + "result": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.UserRegisterReq": { + "type": "object", + "required": [ + "operationID", + "platform", + "secret", + "userID" + ], + "properties": { + "birth": { + "type": "integer" + }, + "email": { + "type": "string", + "maxLength": 64 + }, + "ex": { + "type": "string", + "maxLength": 1024 + }, + "faceURL": { + "type": "string", + "maxLength": 1024 + }, + "gender": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ] + }, + "nickname": { + "type": "string", + "maxLength": 64, + "minLength": 1 + }, + "operationID": { + "type": "string" + }, + "phoneNumber": { + "type": "string", + "maxLength": 32 + }, + "platform": { + "type": "integer", + "maximum": 7, + "minimum": 1 + }, + "secret": { + "type": "string", + "maxLength": 32 + }, + "userID": { + "type": "string", + "maxLength": 64, + "minLength": 1 + } + } + }, + "base_info.UserRegisterResp": { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/base_info.UserTokenInfo" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.UserTokenInfo": { + "type": "object", + "properties": { + "expiredTime": { + "type": "integer" + }, + "token": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.UserTokenReq": { + "type": "object", + "required": [ + "operationID", + "platform", + "secret", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "platform": { + "type": "integer", + "maximum": 8, + "minimum": 1 + }, + "secret": { + "type": "string", + "maxLength": 32 + }, + "userID": { + "type": "string", + "maxLength": 64, + "minLength": 1 + } + } + }, + "base_info.UserTokenResp": { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/base_info.UserTokenInfo" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.WorkMoment": { + "type": "object", + "properties": { + "atUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMomentUser" + } + }, + "comments": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.Comment" + } + }, + "content": { + "type": "string" + }, + "createTime": { + "type": "integer" + }, + "faceURL": { + "type": "string" + }, + "likeUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMomentUser" + } + }, + "permission": { + "type": "integer" + }, + "permissionUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMomentUser" + } + }, + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.WorkMomentUser": { + "type": "object", + "properties": { + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "internal_api_manage.FileElem": { + "type": "object", + "properties": { + "fileName": { + "type": "string" + }, + "filePath": { + "type": "string" + }, + "fileSize": { + "type": "integer" + }, + "sourceURL": { + "type": "string" + }, + "uuid": { + "type": "string" + } + } + }, + "internal_api_manage.OANotificationElem": { + "type": "object", + "required": [ + "notificationFaceURL", + "notificationName", + "notificationType", + "text" + ], + "properties": { + "ex": { + "type": "string" + }, + "fileElem": { + "$ref": "#/definitions/internal_api_manage.FileElem" + }, + "mixType": { + "type": "integer" + }, + "notificationFaceURL": { + "type": "string" + }, + "notificationName": { + "type": "string" + }, + "notificationType": { + "type": "integer" + }, + "pictureElem": { + "$ref": "#/definitions/internal_api_manage.PictureElem" + }, + "soundElem": { + "$ref": "#/definitions/internal_api_manage.SoundElem" + }, + "text": { + "type": "string" + }, + "url": { + "type": "string" + }, + "videoElem": { + "$ref": "#/definitions/internal_api_manage.VideoElem" + } + } + }, + "internal_api_manage.PictureBaseInfo": { + "type": "object", + "properties": { + "height": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "uuid": { + "type": "string" + }, + "width": { + "type": "integer" + } + } + }, + "internal_api_manage.PictureElem": { + "type": "object", + "properties": { + "bigPicture": { + "$ref": "#/definitions/internal_api_manage.PictureBaseInfo" + }, + "snapshotPicture": { + "$ref": "#/definitions/internal_api_manage.PictureBaseInfo" + }, + "sourcePath": { + "type": "string" + }, + "sourcePicture": { + "$ref": "#/definitions/internal_api_manage.PictureBaseInfo" + } + } + }, + "internal_api_manage.RevokeElem": { + "type": "object", + "required": [ + "revokeMsgClientID" + ], + "properties": { + "revokeMsgClientID": { + "type": "string" + } + } + }, + "internal_api_manage.SoundElem": { + "type": "object", + "properties": { + "dataSize": { + "type": "integer" + }, + "duration": { + "type": "integer" + }, + "soundPath": { + "type": "string" + }, + "sourceURL": { + "type": "string" + }, + "uuid": { + "type": "string" + } + } + }, + "internal_api_manage.TextElem": { + "type": "object", + "required": [ + "text" + ], + "properties": { + "text": { + "type": "string" + } + } + }, + "internal_api_manage.VideoElem": { + "type": "object", + "properties": { + "duration": { + "type": "integer" + }, + "snapshotHeight": { + "type": "integer" + }, + "snapshotPath": { + "type": "string" + }, + "snapshotSize": { + "type": "integer" + }, + "snapshotURL": { + "type": "string" + }, + "snapshotUUID": { + "type": "string" + }, + "snapshotWidth": { + "type": "integer" + }, + "videoPath": { + "type": "string" + }, + "videoSize": { + "type": "integer" + }, + "videoType": { + "type": "string" + }, + "videoURL": { + "type": "string" + }, + "videoUUID": { + "type": "string" + } + } + }, + "office.Comment": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "contentID": { + "type": "string" + }, + "createTime": { + "type": "integer" + }, + "faceURL": { + "type": "string" + }, + "replyUserID": { + "type": "string" + }, + "replyUserName": { + "type": "string" + }, + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "office.PermissionGroup": { + "type": "object", + "properties": { + "groupID": { + "type": "string" + }, + "groupName": { + "type": "string" + } + } + }, + "office.Tag": { + "type": "object", + "properties": { + "tagID": { + "type": "string" + }, + "tagName": { + "type": "string" + }, + "userList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.TagUser" + } + } + } + }, + "office.TagSendLog": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "sendTime": { + "type": "integer" + }, + "userList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.TagUser" + } + } + } + }, + "office.TagUser": { + "type": "object", + "properties": { + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "office.WorkMoment": { + "type": "object", + "properties": { + "atUserList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.WorkMomentUser" + } + }, + "comments": { + "type": "array", + "items": { + "$ref": "#/definitions/office.Comment" + } + }, + "content": { + "type": "string" + }, + "createTime": { + "type": "integer" + }, + "faceURL": { + "type": "string" + }, + "likeUserList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.WorkMomentUser" + } + }, + "permission": { + "type": "integer" + }, + "permissionGroupList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.PermissionGroup" + } + }, + "permissionUserList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.WorkMomentUser" + } + }, + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "office.WorkMomentUser": { + "type": "object", + "properties": { + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "pbRelay.GetUsersOnlineStatusResp_SuccessDetail": { + "type": "object", + "properties": { + "platform": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, + "pbRelay.GetUsersOnlineStatusResp_SuccessResult": { + "type": "object", + "properties": { + "detailPlatformStatus": { + "type": "array", + "items": { + "$ref": "#/definitions/pbRelay.GetUsersOnlineStatusResp_SuccessDetail" + } + }, + "status": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "server_api_params.Department": { + "type": "object", + "properties": { + "createTime": { + "type": "integer" + }, + "departmentID": { + "type": "string" + }, + "departmentType": { + "type": "integer" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "memberNum": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "parentID": { + "type": "string" + }, + "subDepartmentNum": { + "type": "integer" + } + } + }, + "server_api_params.DepartmentMember": { + "type": "object", + "properties": { + "departmentID": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "leader": { + "type": "integer" + }, + "order": { + "type": "integer" + }, + "position": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "server_api_params.FriendInfo": { + "type": "object", + "properties": { + "addSource": { + "type": "integer" + }, + "createTime": { + "type": "integer" + }, + "ex": { + "type": "string" + }, + "friendUser": { + "$ref": "#/definitions/server_api_params.UserInfo" + }, + "operatorUserID": { + "type": "string" + }, + "ownerUserID": { + "type": "string" + }, + "remark": { + "type": "string" + } + } + }, + "server_api_params.FriendRequest": { + "type": "object", + "properties": { + "createTime": { + "type": "integer" + }, + "ex": { + "type": "string" + }, + "fromFaceURL": { + "type": "string" + }, + "fromGender": { + "type": "integer" + }, + "fromNickname": { + "type": "string" + }, + "fromUserID": { + "type": "string" + }, + "handleMsg": { + "type": "string" + }, + "handleResult": { + "type": "integer" + }, + "handleTime": { + "type": "integer" + }, + "handlerUserID": { + "type": "string" + }, + "reqMsg": { + "type": "string" + }, + "toFaceURL": { + "type": "string" + }, + "toGender": { + "type": "integer" + }, + "toNickname": { + "type": "string" + }, + "toUserID": { + "type": "string" + } + } + }, + "server_api_params.GroupInfo": { + "type": "object", + "properties": { + "createTime": { + "type": "integer" + }, + "creatorUserID": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "groupID": { + "type": "string" + }, + "groupName": { + "type": "string" + }, + "groupType": { + "type": "integer" + }, + "introduction": { + "type": "string" + }, + "memberCount": { + "type": "integer" + }, + "needVerification": { + "type": "integer" + }, + "notification": { + "type": "string" + }, + "ownerUserID": { + "type": "string" + }, + "status": { + "type": "integer" + } + } + }, + "server_api_params.GroupMemberFullInfo": { + "type": "object", + "properties": { + "appMangerLevel": { + "type": "integer" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "groupID": { + "type": "string" + }, + "joinSource": { + "type": "integer" + }, + "joinTime": { + "type": "integer" + }, + "muteEndTime": { + "type": "integer" + }, + "nickname": { + "type": "string" + }, + "operatorUserID": { + "type": "string" + }, + "roleLevel": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "server_api_params.GroupRequest": { + "type": "object", + "properties": { + "ex": { + "type": "string" + }, + "groupInfo": { + "$ref": "#/definitions/server_api_params.GroupInfo" + }, + "handleMsg": { + "type": "string" + }, + "handleResult": { + "type": "integer" + }, + "handleTime": { + "type": "integer" + }, + "handleUserID": { + "type": "string" + }, + "reqMsg": { + "type": "string" + }, + "reqTime": { + "type": "integer" + }, + "userInfo": { + "$ref": "#/definitions/server_api_params.PublicUserInfo" + } + } + }, + "server_api_params.OfflinePushInfo": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "iOSBadgeCount": { + "type": "boolean" + }, + "iOSPushSound": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "server_api_params.OrganizationUser": { + "type": "object", + "properties": { + "birth": { + "type": "integer" + }, + "createTime": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "englishName": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "mobile": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "telephone": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "server_api_params.PublicUserInfo": { + "type": "object", + "properties": { + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "nickname": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "server_api_params.UserDepartmentMember": { + "type": "object", + "properties": { + "departmentMember": { + "$ref": "#/definitions/server_api_params.DepartmentMember" + }, + "organizationUser": { + "$ref": "#/definitions/server_api_params.OrganizationUser" + } + } + }, + "server_api_params.UserInDepartment": { + "type": "object", + "properties": { + "departmentMemberList": { + "type": "array", + "items": { + "$ref": "#/definitions/server_api_params.DepartmentMember" + } + }, + "organizationUser": { + "$ref": "#/definitions/server_api_params.OrganizationUser" + } + } + }, + "server_api_params.UserInfo": { + "type": "object", + "properties": { + "appMangerLevel": { + "type": "integer" + }, + "birth": { + "type": "integer" + }, + "createTime": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "faceURL": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "globalRecvMsgOpt": { + "type": "integer" + }, + "nickname": { + "type": "string" + }, + "phoneNumber": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "server_api_params.UserSendMsgResp": { + "type": "object", + "properties": { + "clientMsgID": { + "type": "string" + }, + "sendTime": { + "type": "integer" + }, + "serverMsgID": { + "type": "string" + } + } + }, + "user.AccountCheckResp_SingleUserStatus": { + "type": "object", + "properties": { + "accountStatus": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/cmd/open_im_api/docs/swagger.yaml b/cmd/open_im_api/docs/swagger.yaml new file mode 100644 index 000000000..08b433cd2 --- /dev/null +++ b/cmd/open_im_api/docs/swagger.yaml @@ -0,0 +1,5598 @@ +basePath: / +definitions: + Open_IM_internal_api_manage.FileElem: + properties: + fileName: + type: string + filePath: + type: string + fileSize: + type: integer + sourceURL: + type: string + uuid: + type: string + type: object + Open_IM_internal_api_manage.OANotificationElem: + properties: + ex: + type: string + fileElem: + $ref: '#/definitions/Open_IM_internal_api_manage.FileElem' + mixType: + type: integer + notificationFaceURL: + type: string + notificationName: + type: string + notificationType: + type: integer + pictureElem: + $ref: '#/definitions/Open_IM_internal_api_manage.PictureElem' + soundElem: + $ref: '#/definitions/Open_IM_internal_api_manage.SoundElem' + text: + type: string + url: + type: string + videoElem: + $ref: '#/definitions/Open_IM_internal_api_manage.VideoElem' + required: + - notificationFaceURL + - notificationName + - notificationType + - text + type: object + Open_IM_internal_api_manage.PictureBaseInfo: + properties: + height: + type: integer + size: + type: integer + type: + type: string + url: + type: string + uuid: + type: string + width: + type: integer + type: object + Open_IM_internal_api_manage.PictureElem: + properties: + bigPicture: + $ref: '#/definitions/Open_IM_internal_api_manage.PictureBaseInfo' + snapshotPicture: + $ref: '#/definitions/Open_IM_internal_api_manage.PictureBaseInfo' + sourcePath: + type: string + sourcePicture: + $ref: '#/definitions/Open_IM_internal_api_manage.PictureBaseInfo' + type: object + Open_IM_internal_api_manage.RevokeElem: + properties: + revokeMsgClientID: + type: string + required: + - revokeMsgClientID + type: object + Open_IM_internal_api_manage.SoundElem: + properties: + dataSize: + type: integer + duration: + type: integer + soundPath: + type: string + sourceURL: + type: string + uuid: + type: string + type: object + Open_IM_internal_api_manage.TextElem: + properties: + text: + type: string + required: + - text + type: object + Open_IM_internal_api_manage.VideoElem: + properties: + duration: + type: integer + snapshotHeight: + type: integer + snapshotPath: + type: string + snapshotSize: + type: integer + snapshotURL: + type: string + snapshotUUID: + type: string + snapshotWidth: + type: integer + videoPath: + type: string + videoSize: + type: integer + videoType: + type: string + videoURL: + type: string + videoUUID: + type: string + type: object + base_info.AccountCheckReq: + properties: + checkUserIDList: + items: + type: string + maxItems: 100 + type: array + operationID: + type: string + required: + - checkUserIDList + - operationID + type: object + base_info.AccountCheckResp: + properties: + data: + items: + $ref: '#/definitions/user.AccountCheckResp_SingleUserStatus' + type: array + errCode: + type: integer + errMsg: + type: string + type: object + base_info.AddBlacklistReq: + properties: + fromUserID: + type: string + operationID: + type: string + toUserID: + type: string + required: + - fromUserID + - operationID + - toUserID + type: object + base_info.AddBlacklistResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.AddFriendReq: + properties: + fromUserID: + type: string + operationID: + type: string + reqMsg: + type: string + toUserID: + type: string + required: + - fromUserID + - operationID + - toUserID + type: object + base_info.AddFriendResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.AddFriendResponseReq: + properties: + flag: + enum: + - -1 + - 0 + - 1 + type: integer + fromUserID: + type: string + handleMsg: + type: string + operationID: + type: string + toUserID: + type: string + required: + - flag + - fromUserID + - operationID + - toUserID + type: object + base_info.AddFriendResponseResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.ApplicationGroupResponseReq: + properties: + fromUserID: + description: application from FromUserID + type: string + groupID: + type: string + handleResult: + enum: + - -1 + - 1 + type: integer + handledMsg: + type: string + operationID: + type: string + required: + - fromUserID + - groupID + - handleResult + - operationID + type: object + base_info.ApplicationGroupResponseResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.CancelMuteGroupMemberReq: + properties: + groupID: + type: string + operationID: + type: string + userID: + type: string + required: + - groupID + - operationID + - userID + type: object + base_info.CancelMuteGroupMemberResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.CancelMuteGroupReq: + properties: + groupID: + type: string + operationID: + type: string + required: + - groupID + - operationID + type: object + base_info.CancelMuteGroupResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.CleanUpMsgReq: + properties: + operationID: + type: string + userID: + type: string + required: + - operationID + - userID + type: object + base_info.CleanUpMsgResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.Comment: + properties: + content: + type: string + contentID: + type: string + createTime: + type: integer + replyUserID: + type: string + replyUserName: + type: string + userID: + type: string + userName: + type: string + type: object + base_info.CommentOneWorkMomentReq: + properties: + content: + type: string + operationID: + type: string + replyUserID: + type: string + workMomentID: + type: string + required: + - content + - operationID + - workMomentID + type: object + base_info.CommentOneWorkMomentResp: + properties: + data: + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.Conversation: + properties: + attachedInfo: + type: string + conversationID: + type: string + conversationType: + type: integer + draftTextTime: + type: integer + ex: + type: string + groupAtType: + type: integer + groupID: + type: string + isNotInGroup: + type: boolean + isPinned: + type: boolean + isPrivateChat: + type: boolean + ownerUserID: + type: string + recvMsgOpt: + enum: + - 0 + - 1 + - 2 + type: integer + unreadCount: + type: integer + userID: + type: string + required: + - conversationID + - conversationType + - ownerUserID + type: object + base_info.CreateDepartmentMemberReq: + properties: + departmentID: + type: string + ex: + type: string + leader: + type: integer + operationID: + type: string + order: + type: integer + position: + type: string + status: + type: integer + userID: + type: string + required: + - operationID + type: object + base_info.CreateDepartmentMemberResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.CreateDepartmentReq: + properties: + createTime: + type: integer + departmentID: + type: string + departmentType: + type: integer + ex: + type: string + faceURL: + type: string + memberNum: + type: integer + name: + type: string + operationID: + type: string + order: + type: integer + parentID: + type: string + subDepartmentNum: + type: integer + required: + - operationID + type: object + base_info.CreateDepartmentResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.CreateGroupReq: + properties: + ex: + type: string + faceURL: + type: string + groupID: + type: string + groupName: + type: string + groupType: + type: integer + introduction: + type: string + memberList: + items: + $ref: '#/definitions/base_info.GroupAddMemberInfo' + type: array + notification: + type: string + operationID: + type: string + ownerUserID: + type: string + required: + - operationID + type: object + base_info.CreateGroupResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.CreateOneWorkMomentReq: + properties: + operationID: + type: string + workMoment: + $ref: '#/definitions/office.WorkMoment' + type: object + base_info.CreateOneWorkMomentResp: + properties: + data: + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.CreateOrganizationUserReq: + properties: + birth: + type: integer + createTime: + type: integer + email: + type: string + englishName: + type: string + ex: + type: string + faceURL: + type: string + gender: + type: integer + mobile: + type: string + nickname: + type: string + operationID: + type: string + telephone: + type: string + userID: + type: string + required: + - operationID + type: object + base_info.CreateOrganizationUserResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.CreateTagReq: + properties: + operationID: + type: string + tagName: + description: tag名称 + type: string + userIDList: + description: 用户ID列表 + items: + type: string + type: array + required: + - operationID + - tagName + - userIDList + type: object + base_info.CreateTagResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.DelMsgReq: + properties: + operationID: + type: string + seqList: + items: + type: integer + type: array + userID: + type: string + required: + - operationID + - seqList + - userID + type: object + base_info.DelMsgResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.DeleteCommentReq: + properties: + contentID: + type: string + operationID: + type: string + workMomentID: + type: string + required: + - contentID + - operationID + - workMomentID + type: object + base_info.DeleteCommentResp: + properties: + data: + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.DeleteDepartmentReq: + properties: + departmentID: + type: string + operationID: + type: string + required: + - departmentID + - operationID + type: object + base_info.DeleteDepartmentResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.DeleteFriendReq: + properties: + fromUserID: + type: string + operationID: + type: string + toUserID: + type: string + required: + - fromUserID + - operationID + - toUserID + type: object + base_info.DeleteFriendResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.DeleteOneWorkMomentReq: + properties: + operationID: + type: string + workMomentID: + type: string + required: + - operationID + - workMomentID + type: object + base_info.DeleteOneWorkMomentResp: + properties: + data: + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.DeleteOrganizationUserReq: + properties: + operationID: + type: string + userID: + type: string + required: + - operationID + - userID + type: object + base_info.DeleteOrganizationUserResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.DeleteTagReq: + properties: + operationID: + type: string + tagID: + type: string + required: + - operationID + - tagID + type: object + base_info.DeleteTagResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.DeleteUserInDepartmentReq: + properties: + departmentID: + type: string + operationID: + type: string + userID: + type: string + required: + - departmentID + - operationID + - userID + type: object + base_info.DeleteUserInDepartmentResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.DismissGroupReq: + properties: + groupID: + type: string + operationID: + type: string + required: + - groupID + - operationID + type: object + base_info.DismissGroupResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.ExpireTime: + properties: + expireTimeSeconds: + type: integer + type: object + base_info.ForceLogoutReq: + properties: + fromUserID: + maxLength: 64 + minLength: 1 + type: string + operationID: + type: string + platform: + maximum: 8 + minimum: 1 + type: integer + required: + - fromUserID + - operationID + - platform + type: object + base_info.ForceLogoutResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetAllConversationsReq: + properties: + operationID: + type: string + ownerUserID: + type: string + required: + - operationID + - ownerUserID + type: object + base_info.GetAllConversationsResp: + properties: + data: + items: + $ref: '#/definitions/base_info.Conversation' + type: array + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetAllUsersUidReq: + properties: + operationID: + type: string + required: + - operationID + type: object + base_info.GetAllUsersUidResp: + properties: + data: + items: + type: string + type: array + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetBlackListReq: + properties: + fromUserID: + type: string + operationID: + type: string + required: + - fromUserID + - operationID + type: object + base_info.GetBlackListResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetConversationReq: + properties: + conversationID: + type: string + operationID: + type: string + ownerUserID: + type: string + required: + - conversationID + - operationID + - ownerUserID + type: object + base_info.GetConversationResp: + properties: + data: + $ref: '#/definitions/base_info.Conversation' + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetConversationsReq: + properties: + conversationIDs: + items: + type: string + type: array + operationID: + type: string + ownerUserID: + type: string + required: + - conversationIDs + - operationID + - ownerUserID + type: object + base_info.GetConversationsResp: + properties: + data: + items: + $ref: '#/definitions/base_info.Conversation' + type: array + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetDepartmentMemberReq: + properties: + departmentID: + type: string + operationID: + type: string + required: + - departmentID + - operationID + type: object + base_info.GetDepartmentMemberResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetFriendApplyListReq: + properties: + fromUserID: + type: string + operationID: + type: string + required: + - fromUserID + - operationID + type: object + base_info.GetFriendApplyListResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetFriendListReq: + properties: + fromUserID: + type: string + operationID: + type: string + required: + - fromUserID + - operationID + type: object + base_info.GetFriendListResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetGroupAllMemberReq: + properties: + groupID: + type: string + operationID: + type: string + required: + - groupID + - operationID + type: object + base_info.GetGroupAllMemberResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetGroupApplicationListReq: + properties: + fromUserID: + description: 作为管理员或群主收到的 进群申请 + type: string + operationID: + type: string + required: + - fromUserID + - operationID + type: object + base_info.GetGroupApplicationListResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetGroupInfoReq: + properties: + groupIDList: + items: + type: string + type: array + operationID: + type: string + required: + - groupIDList + - operationID + type: object + base_info.GetGroupInfoResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetGroupMembersInfoReq: + properties: + groupID: + type: string + memberList: + items: + type: string + type: array + operationID: + type: string + required: + - groupID + - memberList + - operationID + type: object + base_info.GetGroupMembersInfoResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetJoinedGroupListReq: + properties: + fromUserID: + type: string + operationID: + type: string + required: + - fromUserID + - operationID + type: object + base_info.GetJoinedGroupListResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetSelfApplyListReq: + properties: + fromUserID: + type: string + operationID: + type: string + required: + - fromUserID + - operationID + type: object + base_info.GetSelfApplyListResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetSelfUserInfoReq: + properties: + operationID: + type: string + userID: + type: string + required: + - operationID + - userID + type: object + base_info.GetSelfUserInfoResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetSubDepartmentReq: + properties: + departmentID: + type: string + operationID: + type: string + required: + - departmentID + - operationID + type: object + base_info.GetSubDepartmentResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetTagSendLogsReq: + properties: + operationID: + type: string + pageNumber: + type: integer + showNumber: + type: integer + required: + - operationID + - pageNumber + - showNumber + type: object + base_info.GetTagSendLogsResp: + properties: + data: + properties: + currentPage: + type: integer + logs: + items: + $ref: '#/definitions/office.TagSendLog' + type: array + showNumber: + type: integer + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetUserFriendWorkMomentsReq: + properties: + operationID: + type: string + pageNumber: + type: integer + showNumber: + type: integer + required: + - operationID + - pageNumber + - showNumber + type: object + base_info.GetUserFriendWorkMomentsResp: + properties: + data: + properties: + currentPage: + type: integer + showNumber: + type: integer + workMoments: + items: + $ref: '#/definitions/base_info.WorkMoment' + type: array + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetUserInDepartmentReq: + properties: + operationID: + type: string + userID: + type: string + required: + - operationID + - userID + type: object + base_info.GetUserInDepartmentResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetUserReqGroupApplicationListReq: + properties: + operationID: + type: string + userID: + type: string + required: + - operationID + - userID + type: object + base_info.GetUserTagByIDReq: + properties: + operationID: + type: string + tagID: + type: string + required: + - operationID + - tagID + type: object + base_info.GetUserTagByIDResp: + properties: + data: + properties: + tag: + $ref: '#/definitions/office.Tag' + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetUserTagsReq: + properties: + operationID: + type: string + required: + - operationID + type: object + base_info.GetUserTagsResp: + properties: + data: + properties: + tags: + items: + $ref: '#/definitions/office.Tag' + type: array + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetUserWorkMomentsReq: + properties: + operationID: + type: string + pageNumber: + type: integer + showNumber: + type: integer + userID: + type: string + required: + - operationID + - pageNumber + - showNumber + type: object + base_info.GetUserWorkMomentsResp: + properties: + data: + properties: + currentPage: + type: integer + showNumber: + type: integer + workMoments: + items: + $ref: '#/definitions/base_info.WorkMoment' + type: array + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetUsersInfoReq: + properties: + operationID: + type: string + userIDList: + items: + type: string + type: array + required: + - operationID + - userIDList + type: object + base_info.GetUsersInfoResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetUsersOnlineStatusReq: + properties: + operationID: + type: string + userIDList: + items: + type: string + maxItems: 200 + type: array + required: + - operationID + - userIDList + type: object + base_info.GetUsersOnlineStatusResp: + properties: + data: + items: + $ref: '#/definitions/pbRelay.GetUsersOnlineStatusResp_SuccessResult' + type: array + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetWorkMomentByIDReq: + properties: + operationID: + type: string + workMomentID: + type: string + required: + - operationID + - workMomentID + type: object + base_info.GetWorkMomentByIDResp: + properties: + data: + properties: + workMoment: + $ref: '#/definitions/base_info.WorkMoment' + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GroupAddMemberInfo: + properties: + roleLevel: + type: integer + userID: + type: string + required: + - roleLevel + - userID + type: object + base_info.ImportFriendReq: + properties: + friendUserIDList: + items: + type: string + type: array + fromUserID: + type: string + operationID: + type: string + required: + - friendUserIDList + - fromUserID + - operationID + type: object + base_info.ImportFriendResp: + properties: + data: + items: + $ref: '#/definitions/base_info.UserIDResult' + type: array + errCode: + type: integer + errMsg: + type: string + type: object + base_info.InviteUserToGroupReq: + properties: + groupID: + type: string + invitedUserIDList: + items: + type: string + type: array + operationID: + type: string + reason: + type: string + required: + - groupID + - invitedUserIDList + - operationID + type: object + base_info.InviteUserToGroupResp: + properties: + data: + items: + $ref: '#/definitions/base_info.UserIDResult' + type: array + errCode: + type: integer + errMsg: + type: string + type: object + base_info.IsFriendReq: + properties: + fromUserID: + type: string + operationID: + type: string + toUserID: + type: string + required: + - fromUserID + - operationID + - toUserID + type: object + base_info.IsFriendResp: + properties: + data: + $ref: '#/definitions/base_info.Response' + errCode: + type: integer + errMsg: + type: string + type: object + base_info.JoinGroupReq: + properties: + groupID: + type: string + operationID: + type: string + reqMessage: + type: string + required: + - groupID + - operationID + type: object + base_info.JoinGroupResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.KickGroupMemberReq: + properties: + groupID: + type: string + kickedUserIDList: + items: + type: string + type: array + operationID: + type: string + reason: + type: string + required: + - groupID + - kickedUserIDList + - operationID + type: object + base_info.KickGroupMemberResp: + properties: + data: + items: + $ref: '#/definitions/base_info.UserIDResult' + type: array + errCode: + type: integer + errMsg: + type: string + type: object + base_info.LikeOneWorkMomentReq: + properties: + operationID: + type: string + workMomentID: + type: string + required: + - operationID + - workMomentID + type: object + base_info.LikeOneWorkMomentResp: + properties: + data: + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.ManagementBatchSendMsgReq: + properties: + contentType: + type: integer + groupID: + type: string + isOnlineOnly: + type: boolean + offlinePushInfo: + $ref: '#/definitions/server_api_params.OfflinePushInfo' + operationID: + type: string + recvIDList: + items: + type: string + type: array + sendID: + type: string + senderFaceURL: + type: string + senderNickname: + type: string + senderPlatformID: + type: integer + sessionType: + type: integer + required: + - contentType + - operationID + - sendID + - sessionType + type: object + base_info.ManagementSendMsgReq: + properties: + contentType: + type: integer + groupID: + type: string + isOnlineOnly: + type: boolean + offlinePushInfo: + $ref: '#/definitions/server_api_params.OfflinePushInfo' + operationID: + type: string + recvID: + type: string + sendID: + type: string + senderFaceURL: + type: string + senderNickname: + type: string + senderPlatformID: + type: integer + sessionType: + type: integer + required: + - contentType + - operationID + - sendID + - sessionType + type: object + base_info.ManagementSendMsgResp: + properties: + data: + $ref: '#/definitions/server_api_params.UserSendMsgResp' + errCode: + type: integer + errMsg: + type: string + type: object + base_info.MinioUploadFileResp: + properties: + data: + properties: + URL: + type: string + newName: + type: string + snapshotName: + type: string + snapshotURL: + type: string + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.MuteGroupMemberReq: + properties: + groupID: + type: string + mutedSeconds: + type: integer + operationID: + type: string + userID: + type: string + required: + - groupID + - mutedSeconds + - operationID + - userID + type: object + base_info.MuteGroupReq: + properties: + groupID: + type: string + operationID: + type: string + required: + - groupID + - operationID + type: object + base_info.MuteGroupResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.ParseTokenReq: + properties: + operationID: + type: string + required: + - operationID + type: object + base_info.ParseTokenResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.QuitGroupReq: + properties: + groupID: + type: string + operationID: + type: string + required: + - groupID + - operationID + type: object + base_info.QuitGroupResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.RemoveBlackListReq: + properties: + fromUserID: + type: string + operationID: + type: string + toUserID: + type: string + required: + - fromUserID + - operationID + - toUserID + type: object + base_info.RemoveBlackListResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.Response: + properties: + isFriend: + type: boolean + type: object + base_info.SendMsg2TagReq: + properties: + content: + type: string + groupList: + items: + type: string + type: array + operationID: + type: string + senderPlatformID: + type: integer + tagList: + items: + type: string + type: array + userList: + items: + type: string + type: array + required: + - content + - operationID + - senderPlatformID + type: object + base_info.SendMsg2TagResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.SetFriendRemarkReq: + properties: + fromUserID: + type: string + operationID: + type: string + remark: + type: string + toUserID: + type: string + required: + - fromUserID + - operationID + - remark + - toUserID + type: object + base_info.SetFriendRemarkResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.SetGlobalRecvMessageOptReq: + properties: + globalRecvMsgOpt: + enum: + - 0 + - 1 + - 2 + type: integer + operationID: + type: string + required: + - operationID + type: object + base_info.SetGlobalRecvMessageOptResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.SetGroupInfoReq: + properties: + ex: + type: string + faceURL: + type: string + groupID: + type: string + groupName: + type: string + introduction: + type: string + needVerification: + type: integer + notification: + type: string + operationID: + type: string + required: + - groupID + - operationID + type: object + base_info.SetGroupInfoResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.SetGroupMemberInfoReq: + properties: + ex: + type: string + groupID: + type: string + nickname: + type: string + operationID: + type: string + roleLevel: + maximum: 3 + minimum: 1 + type: integer + userGroupFaceUrl: + type: string + userID: + type: string + required: + - groupID + - operationID + - userID + type: object + base_info.SetGroupMemberInfoResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.SetTagReq: + properties: + increaseUserIDList: + items: + type: string + type: array + newName: + type: string + operationID: + type: string + reduceUserIDList: + items: + type: string + type: array + tagID: + type: string + required: + - operationID + - tagID + type: object + base_info.SetTagResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.Swagger400Resp: + properties: + errCode: + example: 400 + type: integer + errMsg: + example: err msg + type: string + type: object + base_info.Swagger500Resp: + properties: + errCode: + example: 500 + type: integer + errMsg: + example: err msg + type: string + type: object + base_info.TransferGroupOwnerReq: + properties: + groupID: + type: string + newOwnerUserID: + type: string + oldOwnerUserID: + type: string + operationID: + type: string + required: + - groupID + - newOwnerUserID + - oldOwnerUserID + - operationID + type: object + base_info.TransferGroupOwnerResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.UpdateDepartmentReq: + properties: + createTime: + type: integer + departmentID: + type: string + departmentType: + type: integer + ex: + type: string + faceURL: + type: string + memberNum: + type: integer + name: + type: string + operationID: + type: string + order: + type: integer + parentID: + type: string + subDepartmentNum: + type: integer + required: + - departmentID + - operationID + type: object + base_info.UpdateDepartmentResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.UpdateOrganizationUserReq: + properties: + birth: + type: integer + createTime: + type: integer + email: + type: string + englishName: + type: string + ex: + type: string + faceURL: + type: string + gender: + type: integer + mobile: + type: string + nickname: + type: string + operationID: + type: string + telephone: + type: string + userID: + type: string + required: + - operationID + type: object + base_info.UpdateOrganizationUserResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.UpdateSelfUserInfoReq: + properties: + birth: + type: integer + email: + maxLength: 64 + type: string + ex: + maxLength: 1024 + type: string + faceURL: + maxLength: 1024 + type: string + gender: + enum: + - 0 + - 1 + - 2 + type: integer + nickname: + maxLength: 64 + minLength: 1 + type: string + operationID: + type: string + phoneNumber: + maxLength: 32 + type: string + userID: + maxLength: 64 + minLength: 1 + type: string + required: + - operationID + - userID + type: object + base_info.UpdateUserInDepartmentReq: + properties: + departmentID: + type: string + ex: + type: string + leader: + type: integer + operationID: + type: string + order: + type: integer + position: + type: string + status: + type: integer + userID: + type: string + required: + - operationID + type: object + base_info.UpdateUserInDepartmentResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.UpdateUserInfoResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.UserIDResult: + properties: + result: + type: integer + userID: + type: string + type: object + base_info.UserRegisterReq: + properties: + birth: + type: integer + email: + maxLength: 64 + type: string + ex: + maxLength: 1024 + type: string + faceURL: + maxLength: 1024 + type: string + gender: + enum: + - 0 + - 1 + - 2 + type: integer + nickname: + maxLength: 64 + minLength: 1 + type: string + operationID: + type: string + phoneNumber: + maxLength: 32 + type: string + platform: + maximum: 7 + minimum: 1 + type: integer + secret: + maxLength: 32 + type: string + userID: + maxLength: 64 + minLength: 1 + type: string + required: + - operationID + - platform + - secret + - userID + type: object + base_info.UserRegisterResp: + properties: + data: + $ref: '#/definitions/base_info.UserTokenInfo' + errCode: + type: integer + errMsg: + type: string + type: object + base_info.UserTokenInfo: + properties: + expiredTime: + type: integer + token: + type: string + userID: + type: string + type: object + base_info.UserTokenReq: + properties: + operationID: + type: string + platform: + maximum: 8 + minimum: 1 + type: integer + secret: + maxLength: 32 + type: string + userID: + maxLength: 64 + minLength: 1 + type: string + required: + - operationID + - platform + - secret + - userID + type: object + base_info.UserTokenResp: + properties: + data: + $ref: '#/definitions/base_info.UserTokenInfo' + errCode: + type: integer + errMsg: + type: string + type: object + base_info.WorkMoment: + properties: + atUsers: + items: + $ref: '#/definitions/base_info.WorkMomentUser' + type: array + comments: + items: + $ref: '#/definitions/base_info.Comment' + type: array + content: + type: string + createTime: + type: integer + faceURL: + type: string + likeUsers: + items: + $ref: '#/definitions/base_info.WorkMomentUser' + type: array + permission: + type: integer + permissionUsers: + items: + $ref: '#/definitions/base_info.WorkMomentUser' + type: array + userID: + type: string + userName: + type: string + workMomentID: + type: string + type: object + base_info.WorkMomentUser: + properties: + userID: + type: string + userName: + type: string + type: object + internal_api_manage.FileElem: + properties: + fileName: + type: string + filePath: + type: string + fileSize: + type: integer + sourceURL: + type: string + uuid: + type: string + type: object + internal_api_manage.OANotificationElem: + properties: + ex: + type: string + fileElem: + $ref: '#/definitions/internal_api_manage.FileElem' + mixType: + type: integer + notificationFaceURL: + type: string + notificationName: + type: string + notificationType: + type: integer + pictureElem: + $ref: '#/definitions/internal_api_manage.PictureElem' + soundElem: + $ref: '#/definitions/internal_api_manage.SoundElem' + text: + type: string + url: + type: string + videoElem: + $ref: '#/definitions/internal_api_manage.VideoElem' + required: + - notificationFaceURL + - notificationName + - notificationType + - text + type: object + internal_api_manage.PictureBaseInfo: + properties: + height: + type: integer + size: + type: integer + type: + type: string + url: + type: string + uuid: + type: string + width: + type: integer + type: object + internal_api_manage.PictureElem: + properties: + bigPicture: + $ref: '#/definitions/internal_api_manage.PictureBaseInfo' + snapshotPicture: + $ref: '#/definitions/internal_api_manage.PictureBaseInfo' + sourcePath: + type: string + sourcePicture: + $ref: '#/definitions/internal_api_manage.PictureBaseInfo' + type: object + internal_api_manage.RevokeElem: + properties: + revokeMsgClientID: + type: string + required: + - revokeMsgClientID + type: object + internal_api_manage.SoundElem: + properties: + dataSize: + type: integer + duration: + type: integer + soundPath: + type: string + sourceURL: + type: string + uuid: + type: string + type: object + internal_api_manage.TextElem: + properties: + text: + type: string + required: + - text + type: object + internal_api_manage.VideoElem: + properties: + duration: + type: integer + snapshotHeight: + type: integer + snapshotPath: + type: string + snapshotSize: + type: integer + snapshotURL: + type: string + snapshotUUID: + type: string + snapshotWidth: + type: integer + videoPath: + type: string + videoSize: + type: integer + videoType: + type: string + videoURL: + type: string + videoUUID: + type: string + type: object + office.Comment: + properties: + content: + type: string + contentID: + type: string + createTime: + type: integer + faceURL: + type: string + replyUserID: + type: string + replyUserName: + type: string + userID: + type: string + userName: + type: string + type: object + office.PermissionGroup: + properties: + groupID: + type: string + groupName: + type: string + type: object + office.Tag: + properties: + tagID: + type: string + tagName: + type: string + userList: + items: + $ref: '#/definitions/office.TagUser' + type: array + type: object + office.TagSendLog: + properties: + content: + type: string + sendTime: + type: integer + userList: + items: + $ref: '#/definitions/office.TagUser' + type: array + type: object + office.TagUser: + properties: + userID: + type: string + userName: + type: string + type: object + office.WorkMoment: + properties: + atUserList: + items: + $ref: '#/definitions/office.WorkMomentUser' + type: array + comments: + items: + $ref: '#/definitions/office.Comment' + type: array + content: + type: string + createTime: + type: integer + faceURL: + type: string + likeUserList: + items: + $ref: '#/definitions/office.WorkMomentUser' + type: array + permission: + type: integer + permissionGroupList: + items: + $ref: '#/definitions/office.PermissionGroup' + type: array + permissionUserList: + items: + $ref: '#/definitions/office.WorkMomentUser' + type: array + userID: + type: string + userName: + type: string + workMomentID: + type: string + type: object + office.WorkMomentUser: + properties: + userID: + type: string + userName: + type: string + type: object + pbRelay.GetUsersOnlineStatusResp_SuccessDetail: + properties: + platform: + type: string + status: + type: string + type: object + pbRelay.GetUsersOnlineStatusResp_SuccessResult: + properties: + detailPlatformStatus: + items: + $ref: '#/definitions/pbRelay.GetUsersOnlineStatusResp_SuccessDetail' + type: array + status: + type: string + userID: + type: string + type: object + server_api_params.Department: + properties: + createTime: + type: integer + departmentID: + type: string + departmentType: + type: integer + ex: + type: string + faceURL: + type: string + memberNum: + type: integer + name: + type: string + order: + type: integer + parentID: + type: string + subDepartmentNum: + type: integer + type: object + server_api_params.DepartmentMember: + properties: + departmentID: + type: string + ex: + type: string + leader: + type: integer + order: + type: integer + position: + type: string + status: + type: integer + userID: + type: string + type: object + server_api_params.FriendInfo: + properties: + addSource: + type: integer + createTime: + type: integer + ex: + type: string + friendUser: + $ref: '#/definitions/server_api_params.UserInfo' + operatorUserID: + type: string + ownerUserID: + type: string + remark: + type: string + type: object + server_api_params.FriendRequest: + properties: + createTime: + type: integer + ex: + type: string + fromFaceURL: + type: string + fromGender: + type: integer + fromNickname: + type: string + fromUserID: + type: string + handleMsg: + type: string + handleResult: + type: integer + handleTime: + type: integer + handlerUserID: + type: string + reqMsg: + type: string + toFaceURL: + type: string + toGender: + type: integer + toNickname: + type: string + toUserID: + type: string + type: object + server_api_params.GroupInfo: + properties: + createTime: + type: integer + creatorUserID: + type: string + ex: + type: string + faceURL: + type: string + groupID: + type: string + groupName: + type: string + groupType: + type: integer + introduction: + type: string + memberCount: + type: integer + needVerification: + type: integer + notification: + type: string + ownerUserID: + type: string + status: + type: integer + type: object + server_api_params.GroupMemberFullInfo: + properties: + appMangerLevel: + type: integer + ex: + type: string + faceURL: + type: string + groupID: + type: string + joinSource: + type: integer + joinTime: + type: integer + muteEndTime: + type: integer + nickname: + type: string + operatorUserID: + type: string + roleLevel: + type: integer + userID: + type: string + type: object + server_api_params.GroupRequest: + properties: + ex: + type: string + groupInfo: + $ref: '#/definitions/server_api_params.GroupInfo' + handleMsg: + type: string + handleResult: + type: integer + handleTime: + type: integer + handleUserID: + type: string + reqMsg: + type: string + reqTime: + type: integer + userInfo: + $ref: '#/definitions/server_api_params.PublicUserInfo' + type: object + server_api_params.OfflinePushInfo: + properties: + desc: + type: string + ex: + type: string + iOSBadgeCount: + type: boolean + iOSPushSound: + type: string + title: + type: string + type: object + server_api_params.OrganizationUser: + properties: + birth: + type: integer + createTime: + type: integer + email: + type: string + englishName: + type: string + ex: + type: string + faceURL: + type: string + gender: + type: integer + mobile: + type: string + nickname: + type: string + telephone: + type: string + userID: + type: string + type: object + server_api_params.PublicUserInfo: + properties: + ex: + type: string + faceURL: + type: string + gender: + type: integer + nickname: + type: string + userID: + type: string + type: object + server_api_params.UserDepartmentMember: + properties: + departmentMember: + $ref: '#/definitions/server_api_params.DepartmentMember' + organizationUser: + $ref: '#/definitions/server_api_params.OrganizationUser' + type: object + server_api_params.UserInDepartment: + properties: + departmentMemberList: + items: + $ref: '#/definitions/server_api_params.DepartmentMember' + type: array + organizationUser: + $ref: '#/definitions/server_api_params.OrganizationUser' + type: object + server_api_params.UserInfo: + properties: + appMangerLevel: + type: integer + birth: + type: integer + createTime: + type: integer + email: + type: string + ex: + type: string + faceURL: + type: string + gender: + type: integer + globalRecvMsgOpt: + type: integer + nickname: + type: string + phoneNumber: + type: string + userID: + type: string + type: object + server_api_params.UserSendMsgResp: + properties: + clientMsgID: + type: string + sendTime: + type: integer + serverMsgID: + type: string + type: object + user.AccountCheckResp_SingleUserStatus: + properties: + accountStatus: + type: string + userID: + type: string + type: object +info: + contact: {} + description: open-IM-Server 的API服务器文档, 文档中所有请求都有一个operationID字段用于链路追踪 + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + title: open-IM-Server API + version: "1.0" +paths: + /auth/force_logout: + post: + consumes: + - application/json + description: 对应的平台强制登出 + operationId: ForceLogout + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: platform为平台ID
fromUserID为要执行强制登出的用户ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.ForceLogoutReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.ForceLogoutResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 强制登出 + tags: + - 鉴权认证 + /auth/parse_token: + post: + consumes: + - application/json + description: 解析当前用户token(token在请求头中传入) + operationId: ParseToken + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: secret为openIM密钥, 详细见服务端config.yaml secret字段
platform为平台ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.ParseTokenReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.ParseTokenResp' + - properties: + Data: + $ref: '#/definitions/base_info.ExpireTime' + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 解析当前用户token + tags: + - 鉴权认证 + /auth/user_register: + post: + consumes: + - application/json + description: 用户注册 + operationId: UserRegister + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: secret为openIM密钥, 详细见服务端config.yaml secret字段
platform为平台ID +
ex为拓展字段
gender为性别, 0为女, 1为男 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.UserRegisterReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.UserRegisterResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 用户注册 + tags: + - 鉴权认证 + /auth/user_token: + post: + consumes: + - application/json + description: 获取用户的token + operationId: UserToken + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: secret为openIM密钥, 详细见服务端config.yaml secret字段
platform为平台ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.UserTokenReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.UserTokenResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 用户登录 + tags: + - 鉴权认证 + /friend/add_black: + post: + consumes: + - application/json + description: 添加黑名单 + operationId: AddBlack + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: fromUserID为设置的用户
toUserID为被设置的用户 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.AddBlacklistReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.AddBlacklistResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 添加黑名单 + tags: + - 好友相关 + /friend/add_friend: + post: + consumes: + - application/json + description: 添加好友 + operationId: AddFriend + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: reqMsg为申请信息
fromUserID为申请用户
toUserID为被添加用户 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.AddFriendReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.AddFriendResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 添加好友 + tags: + - 好友相关 + /friend/add_friend_response: + post: + consumes: + - application/json + description: 同意/拒绝好友请求 + operationId: AddFriendResponse + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: fromUserID同意/拒绝的用户ID
toUserID为申请用户D
handleMsg为处理信息
flag为具体操作, + 1为同意, 2为拒绝 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.AddFriendResponseReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.AddFriendResponseResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 同意/拒绝好友请求 + tags: + - 好友相关 + /friend/delete_friend: + post: + consumes: + - application/json + description: 删除好友 + operationId: DeleteFriend + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: fromUserID为操作用户
toUserID为被删除用户 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.DeleteFriendReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.DeleteFriendResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 删除好友 + tags: + - 好友相关 + /friend/get_black_list: + post: + consumes: + - application/json + description: 获取黑名单列表 + operationId: GetBlacklist + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: fromUserID要获取黑名单的用户 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetBlackListReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.GetBlackListResp' + - properties: + data: + items: + $ref: '#/definitions/server_api_params.PublicUserInfo' + type: array + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + summary: 获取黑名单列表 + tags: + - 好友相关 + /friend/get_friend_apply_list: + post: + consumes: + - application/json + description: 删除好友 + operationId: GetFriendApplyList + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: fromUserID为要获取申请列表的用户ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetFriendApplyListReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.GetFriendApplyListResp' + - properties: + data: + items: + $ref: '#/definitions/server_api_params.FriendRequest' + type: array + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + summary: 获取好友申请列表 + tags: + - 好友相关 + /friend/get_friend_list: + post: + consumes: + - application/json + description: 获取用户的好友列表 + operationId: GetFriendList + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: fromUserID为要获取好友列表的用户ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetFriendListReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.GetFriendListResp' + - properties: + data: + items: + $ref: '#/definitions/server_api_params.FriendInfo' + type: array + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取用户的好友列表 + tags: + - 好友相关 + /friend/get_self_friend_apply_list: + post: + consumes: + - application/json + description: 获取自己的好友申请列表 + operationId: GetSelfFriendApplyList + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: fromUserID为自己的用户ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetSelfApplyListReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.GetSelfApplyListResp' + - properties: + data: + items: + $ref: '#/definitions/server_api_params.FriendRequest' + type: array + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取自己的好友申请列表 + tags: + - 好友相关 + /friend/import_friend: + post: + consumes: + - application/json + description: 批量加好友 + operationId: ImportFriend + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: fromUserID批量加好友的用户ID
friendUserIDList为 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.ImportFriendReq' + produces: + - application/json + responses: + "0": + description: data列表中对象的result-1为添加该用户失败
0为成功 + schema: + $ref: '#/definitions/base_info.ImportFriendResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 批量加好友 + tags: + - 好友相关 + /friend/is_friend: + post: + consumes: + - application/json + description: 检查用户之间是否为好友 + operationId: IsFriend + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: fromUserID为请求用户
toUserID为要检查的用户 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.IsFriendReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.IsFriendResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 检查用户之间是否为好友 + tags: + - 好友相关 + /friend/remove_black: + post: + consumes: + - application/json + description: 把用户移除黑名单 + operationId: RemoveBlack + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: fromUserID要获取黑名单的用户 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.RemoveBlackListReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.RemoveBlackListResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 把用户移除黑名单 + tags: + - 好友相关 + /friend/set_friend_remark: + post: + consumes: + - application/json + description: 设置好友备注 + operationId: SetFriendRemark + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: fromUserID为设置的用户
toUserID为被设置的用户
remark为好友备注 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.SetFriendRemarkReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.SetFriendRemarkResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 设置好友备注 + tags: + - 好友相关 + /group/cancel_mute_group: + post: + consumes: + - application/json + description: 取消禁言群组 + operationId: CancelMuteGroup + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: groupID为群组ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.CancelMuteGroupReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.CancelMuteGroupResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 取消禁言群组 + tags: + - 群组相关 + /group/cancel_mute_group_member: + post: + consumes: + - application/json + description: 取消禁言群成员 + operationId: CancelMuteGroupMember + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: groupID为群组ID
userID为要取消禁言的用户ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.CancelMuteGroupMemberReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.CancelMuteGroupMemberResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 取消禁言群成员 + tags: + - 群组相关 + /group/create_group: + post: + consumes: + - application/json + description: 创建群组 + operationId: CreateGroup + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: groupType这里填0代表普通群
groupName为群名称
introduction为群介绍
+ notification为群公共
ownerUserID为群主ID
ex为群扩展字段
memberList中对象roleLevel为群员角色,1为普通用户 + 2为群主 3为管理员 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.CreateGroupReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.CreateGroupResp' + - properties: + data: + $ref: '#/definitions/server_api_params.GroupInfo' + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 创建群组 + tags: + - 群组相关 + /group/dismiss_group: + post: + consumes: + - application/json + description: 解散群组 + operationId: DismissGroup + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: groupID为要解散的群组ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.DismissGroupReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.DismissGroupResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 解散群组 + tags: + - 群组相关 + /group/get_group_all_member_list: + post: + consumes: + - application/json + description: 获取全部群成员列表 + operationId: GetGroupAllMemberList + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: GroupID为要获取群成员的群ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetGroupAllMemberReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.GetGroupAllMemberResp' + - properties: + data: + items: + $ref: '#/definitions/server_api_params.GroupMemberFullInfo' + type: array + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取全部群成员列表 + tags: + - 群组相关 + /group/get_group_members_info: + post: + consumes: + - application/json + description: 获取群成员信息 + operationId: GetGroupMembersInfo + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: groupID为要获取的群ID
memberList为要获取群成员的群ID列表 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetGroupMembersInfoReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.GetGroupMembersInfoResp' + - properties: + data: + items: + $ref: '#/definitions/server_api_params.GroupMemberFullInfo' + type: array + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取群成员信息 + tags: + - 群组相关 + /group/get_groups_info: + post: + consumes: + - application/json + description: 通过群ID列表获取群信息 + operationId: GetGroupsInfo + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: groupIDList为群ID列表 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetGroupInfoReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetGroupInfoResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 通过群ID列表获取群信息 + tags: + - 群组相关 + /group/get_joined_group_list: + post: + consumes: + - application/json + description: 获取用户加入群列表 + operationId: GetJoinedGroupList + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: fromUserID为要获取的用户ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetJoinedGroupListReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.GetJoinedGroupListResp' + - properties: + data: + items: + $ref: '#/definitions/server_api_params.GroupInfo' + type: array + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取用户加入群列表 + tags: + - 群组相关 + /group/get_recv_group_applicationList: + post: + consumes: + - application/json + description: 获取用户收到的加群信息列表 + operationId: GetRecvGroupApplicationList + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: fromUserID为要获取的用户ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetGroupApplicationListReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.GetGroupApplicationListResp' + - properties: + data: + items: + $ref: '#/definitions/server_api_params.GroupRequest' + type: array + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取用户收到的加群信息列表 + tags: + - 群组相关 + /group/get_user_req_group_applicationList: + post: + consumes: + - application/json + description: 获取用户加群申请列表 + operationId: GetUserReqGroupApplicationList + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: userID为要获取的用户ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetUserReqGroupApplicationListReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.GetGroupApplicationListResp' + - properties: + data: + items: + $ref: '#/definitions/server_api_params.GroupRequest' + type: array + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取用户加群申请列表 + tags: + - 群组相关 + /group/group_application_response: + post: + consumes: + - application/json + description: 处理加群消息 + operationId: ApplicationGroupResponse + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: groupID为要处理的群ID
fromUserID为要处理的用户ID
handleMsg为处理结果信息 +
handleResult为处理结果 1为同意加群 2为拒绝加群 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.ApplicationGroupResponseReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.ApplicationGroupResponseResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 处理加群消息 + tags: + - 群组相关 + /group/invite_user_to_group: + post: + consumes: + - application/json + description: 将用户拉入群组 + operationId: InviteUserToGroup + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: groupID为要拉进的群组ID
invitedUserIDList为要获取群成员的群ID列表
reason为原因 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.InviteUserToGroupReq' + produces: + - application/json + responses: + "0": + description: result为结果码, -1为失败, 0为成功 + schema: + $ref: '#/definitions/base_info.InviteUserToGroupResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 将用户拉入群组 + tags: + - 群组相关 + /group/join_group: + post: + consumes: + - application/json + description: 加入群聊 + operationId: JoinGroup + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: reqMessage为申请进群信息
groupID为申请的群ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.JoinGroupReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.JoinGroupResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 加入群聊 + tags: + - 群组相关 + /group/kick_group: + post: + consumes: + - application/json + description: 把用户踢出群组 + operationId: KickGroupMember + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: GroupID为要操作的群ID
kickedUserIDList为要踢出的群用户ID
reason为原因 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.KickGroupMemberReq' + produces: + - application/json + responses: + "0": + description: result为结果码, -1为失败, 0为成功 + schema: + $ref: '#/definitions/base_info.KickGroupMemberResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 把用户踢出群组 + tags: + - 群组相关 + /group/mute_group: + post: + consumes: + - application/json + description: 禁言群组 + operationId: MuteGroup + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: groupID为群组ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.MuteGroupReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.MuteGroupResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.MuteGroupResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.MuteGroupResp' + summary: 禁言群组 + tags: + - 群组相关 + /group/mute_group_member: + post: + consumes: + - application/json + description: 禁言群成员 + operationId: MuteGroupMember + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: groupID为群组ID
userID为要禁言的用户ID
mutedSeconds为禁言秒数 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.MuteGroupMemberReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.DismissGroupResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 禁言群成员 + tags: + - 群组相关 + /group/quit_group: + post: + consumes: + - application/json + description: 当前用户退出群聊 + operationId: QuitGroup + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: groupID为要退出的群ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.QuitGroupReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.QuitGroupResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 当前用户退出群聊 + tags: + - 群组相关 + /group/set_group_info: + post: + consumes: + - application/json + description: 设置群信息 + operationId: SetGroupInfo + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: groupID为要修改的群ID
groupName为新的群名称
notification为群介绍
introduction为群公告 +
needVerification为加群验证 0为申请需要同意 邀请直接进 1为所有人进群需要验证,除了群主管理员邀请进群 2为直接进群 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.SetGroupInfoReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.SetGroupInfoResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 设置群信息 + tags: + - 群组相关 + /group/set_group_member_info: + post: + consumes: + - application/json + description: 修改群成员信息 + operationId: SetGroupMemberInfo + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 除了operationID, userID, groupID其他参数可选
ex为拓展字段
faceURL为群头像
nickName为群昵称
roleLevel为群员角色,1为普通用户 + 2为群主 3为管理员 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.SetGroupMemberInfoReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.SetGroupMemberInfoResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 修改群成员信息 + tags: + - 群组相关 + /group/transfer_group: + post: + consumes: + - application/json + description: 转让群主 + operationId: TransferGroupOwner + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: GroupID为要操作的群ID
oldOwnerUserID为老群主ID
newOwnerUserID为新群主ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.TransferGroupOwnerReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.TransferGroupOwnerResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 转让群主 + tags: + - 群组相关 + /msg/batch_send_msg: + post: + consumes: + - application/json + description: 管理员批量发送群聊单聊消息 消息格式详细见消息格式 + operationId: ManagementBatchSendMsg + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 该请求和消息结构体一样
recvIDList为接受消息的用户ID列表 + in: body + name: 管理员批量发送单聊消息 + required: true + schema: + allOf: + - $ref: '#/definitions/base_info.ManagementBatchSendMsgReq' + - properties: + content: + $ref: '#/definitions/Open_IM_internal_api_manage.TextElem' + type: object + - description: 该请求和消息结构体一样
recvIDList为接受消息的用户ID列表 + in: body + name: 管理员批量发送OA通知 + required: true + schema: + allOf: + - $ref: '#/definitions/base_info.ManagementSendMsgReq' + - properties: + content: + $ref: '#/definitions/Open_IM_internal_api_manage.OANotificationElem' + type: object + produces: + - application/json + responses: + "0": + description: serverMsgID为服务器消息ID
clientMsgID为客户端消息ID
sendTime为发送消息时间 + schema: + $ref: '#/definitions/base_info.ManagementBatchSendMsgReq' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.ManagementBatchSendMsgReq' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.ManagementBatchSendMsgReq' + summary: 管理员批量发送群聊单聊消息 + tags: + - 消息相关 + /msg/clear_msg: + post: + consumes: + - application/json + description: 清空用户消息 + operationId: ClearMsg + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: userID为要清空的用户ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.CleanUpMsgReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.CleanUpMsgResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 清空用户消息 + tags: + - 消息相关 + /msg/del_msg: + post: + consumes: + - application/json + description: 根据seq列表删除消息 + operationId: DelMsg + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: userID为要删除的用户ID
seqList为seq列表 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.DelMsgReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.DelMsgResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 根据seq列表删除消息 + tags: + - 消息相关 + /msg/get_all_conversations: + post: + consumes: + - application/json + description: 获取用户所有会话 + operationId: GetAllConversations + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: ownerUserID为要获取的用户ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetAllConversationsReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetAllConversationsResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取用户所有会话 + tags: + - 会话相关 + /msg/get_conversation: + post: + consumes: + - application/json + description: 根据会话ID获取会话 + operationId: GetConversation + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: ownerUserID为要获取的用户ID
conversationID为要获取的会话ID + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetConversationReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetConversationResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 根据会话ID获取会话 + tags: + - 会话相关 + /msg/get_conversations: + post: + consumes: + - application/json + description: 根据会话ID列表获取会话 + operationId: GetConversations + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: ownerUserID为要获取的用户ID
conversationIDs为要获取的会话ID列表 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetConversationsReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetConversationsResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 根据会话ID列表获取会话 + tags: + - 会话相关 + /msg/manage_send_msg: + post: + consumes: + - application/json + description: 管理员发送/撤回消息 消息格式详细见
消息格式 + operationId: ManagementSendMsg + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 该请求和消息结构体一样 + in: body + name: 管理员发送文字消息 + required: true + schema: + allOf: + - $ref: '#/definitions/base_info.ManagementSendMsgReq' + - properties: + content: + $ref: '#/definitions/Open_IM_internal_api_manage.TextElem' + type: object + - description: 该请求和消息结构体一样 + in: body + name: 管理员发送OA通知消息 + required: true + schema: + allOf: + - $ref: '#/definitions/base_info.ManagementSendMsgReq' + - properties: + content: + $ref: '#/definitions/Open_IM_internal_api_manage.OANotificationElem' + type: object + - description: 该请求和消息结构体一样 + in: body + name: 管理员撤回单聊消息 + required: true + schema: + allOf: + - $ref: '#/definitions/base_info.ManagementSendMsgReq' + - properties: + content: + $ref: '#/definitions/Open_IM_internal_api_manage.RevokeElem' + type: object + produces: + - application/json + responses: + "0": + description: serverMsgID为服务器消息ID
clientMsgID为客户端消息ID
sendTime为发送消息时间 + schema: + $ref: '#/definitions/base_info.ManagementSendMsgResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.ManagementSendMsgResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.ManagementSendMsgResp' + summary: 管理员发送/撤回消息 + tags: + - 消息相关 + /office/comment_one_work_moment: + post: + consumes: + - application/json + description: 评论一条工作圈 + operationId: CommentOneWorkMoment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.CommentOneWorkMomentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.CommentOneWorkMomentResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 评论一条工作圈 + tags: + - 工作圈 + /office/create_one_work_moment: + post: + consumes: + - application/json + description: 用户创建一条工作圈 + operationId: CreateOneWorkMoment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 atUserList likeUserList permissionGroupList permissionUserList + 字段中userName可以不填 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.CreateOneWorkMomentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.CreateOneWorkMomentResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 创建一条工作圈 + tags: + - 工作圈 + /office/create_tag: + post: + consumes: + - application/json + description: 创建标签 + operationId: CreateTag + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.CreateTagReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.CreateTagResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 创建标签 + tags: + - 标签 + /office/delete_comment: + post: + consumes: + - application/json + description: 删除一条评论 + operationId: DeleteComment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.DeleteCommentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.DeleteCommentResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 删除一条评论 + tags: + - 工作圈 + /office/delete_one_work_moment: + post: + consumes: + - application/json + description: 根据用户工作圈ID删除一条工作圈 + operationId: DeleteOneWorkMoment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.DeleteOneWorkMomentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.DeleteOneWorkMomentResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 删除一条工作圈 + tags: + - 工作圈 + /office/delete_tag: + post: + consumes: + - application/json + description: 根据标签ID创建标签 + operationId: DeleteTag + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.DeleteTagReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.DeleteTagResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 删除标签 + tags: + - 标签 + /office/get_send_tag_log: + post: + consumes: + - application/json + description: 分页获取发送历史记录 + operationId: GetTagSendLogs + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetTagSendLogsReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetTagSendLogsResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取发送历史记录 + tags: + - 标签 + /office/get_user_friend_work_moments: + post: + consumes: + - application/json + description: 查询用户工作圈页面 + operationId: GetUserFriendWorkMoments + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetUserFriendWorkMomentsReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetUserFriendWorkMomentsResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 查询自己大工作圈页面 + tags: + - 工作圈 + /office/get_user_tag_by_id: + post: + consumes: + - application/json + description: 通过标签id获取该用户的标签信息 + operationId: GetUserTagByID + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetUserTagByIDReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetUserTagByIDResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取该用户的标签信息 + tags: + - 标签 + /office/get_user_tags: + post: + consumes: + - application/json + description: 用户获取自己的所有的标签 + operationId: GetUserTags + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetUserTagsReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetUserTagsResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取用户标签信息 + tags: + - 标签 + /office/get_user_work_moments: + post: + consumes: + - application/json + description: 查询用户工作圈 + operationId: GetUserWorkMoments + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetUserWorkMomentsReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetUserWorkMomentsResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 查询用户工作圈 + tags: + - 工作圈 + /office/get_work_moment_by_id: + post: + consumes: + - application/json + description: 通过ID获取工作圈 + operationId: GetWorkMomentByID + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetWorkMomentByIDReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetWorkMomentByIDResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 通过ID获取工作圈 + tags: + - 工作圈 + /office/like_one_work_moment: + post: + consumes: + - application/json + description: 工作圈ID点赞一条工作圈 + operationId: LikeOneWorkMoment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.LikeOneWorkMomentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.LikeOneWorkMomentResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 点赞一条工作圈 + tags: + - 工作圈 + /office/send_msg_to_tag: + post: + consumes: + - application/json + description: 对标签用户发送消息 + operationId: SendMsg2Tag + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.SendMsg2TagReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.SendMsg2TagResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 发送标签消息 + tags: + - 标签 + /office/set_tag: + post: + consumes: + - application/json + description: 根据标签ID修改标签用户列表, 名称 + operationId: SetTag + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.SetTagReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.SetTagResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 修改标签 + tags: + - 标签 + /organization/create_department: + post: + consumes: + - application/json + description: 创建部门 + operationId: CreateDepartment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.CreateDepartmentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.CreateDepartmentResp' + - properties: + data: + $ref: '#/definitions/server_api_params.Department' + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 创建部门 + tags: + - 组织架构相关 + /organization/create_department_member: + post: + consumes: + - application/json + description: 创建部门用户 + operationId: CreateDepartmentMember + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.CreateDepartmentMemberReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.CreateDepartmentMemberResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 创建部门用户 + tags: + - 组织架构相关 + /organization/create_organization_user: + post: + consumes: + - application/json + description: 组织架构导入用户 + operationId: CreateOrganizationUser + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.CreateOrganizationUserReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.CreateOrganizationUserResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 组织架构导入用户 + tags: + - 组织架构相关 + /organization/delete_department: + post: + consumes: + - application/json + description: 删除部门 + operationId: DeleteDepartment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.DeleteDepartmentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.DeleteDepartmentResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 删除部门 + tags: + - 组织架构相关 + /organization/delete_organization_user: + post: + consumes: + - application/json + description: 删除组织架构中某个用户 + operationId: DeleteOrganizationUser + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.DeleteOrganizationUserReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.DeleteOrganizationUserResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 删除组织架构中某个用户 + tags: + - 组织架构相关 + /organization/delete_user_in_department: + post: + consumes: + - application/json + description: 删除部门中某个用户 + operationId: DeleteUserInDepartment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.DeleteUserInDepartmentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.DeleteUserInDepartmentResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 删除部门中某个用户 + tags: + - 组织架构相关 + /organization/get_department_member: + post: + consumes: + - application/json + description: 获取部门中所有成员 + operationId: GetDepartmentMember + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetDepartmentMemberReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.GetDepartmentMemberResp' + - properties: + data: + items: + $ref: '#/definitions/server_api_params.UserDepartmentMember' + type: array + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取部门中所有成员 + tags: + - 组织架构相关 + /organization/get_sub_department: + post: + consumes: + - application/json + description: 获取子部门列表 + operationId: GetSubDepartment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetSubDepartmentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.GetSubDepartmentResp' + - properties: + data: + items: + $ref: '#/definitions/server_api_params.Department' + type: array + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取子部门列表 + tags: + - 组织架构相关 + /organization/get_user_in_department: + post: + consumes: + - application/json + description: 获取部门中的所有用户 + operationId: GetUserInDepartment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetUserInDepartmentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.GetUserInDepartmentResp' + - properties: + data: + $ref: '#/definitions/server_api_params.UserInDepartment' + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取部门中的所有用户 + tags: + - 组织架构相关 + /organization/update_department: + post: + consumes: + - application/json + description: 更新部门信息 + operationId: UpdateDepartment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.UpdateDepartmentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.UpdateDepartmentResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 更新部门信息 + tags: + - 组织架构相关 + /organization/update_organization_user: + post: + consumes: + - application/json + description: 更新组织架构中的用户 + operationId: UpdateOrganizationUser + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.UpdateOrganizationUserReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.UpdateOrganizationUserResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 更新组织架构中的用户 + tags: + - 组织架构相关 + /organization/update_user_in_department: + post: + consumes: + - application/json + description: 更新部门中某个用户 + operationId: UpdateUserInDepartment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.UpdateUserInDepartmentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.UpdateUserInDepartmentResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 更新部门中某个用户 + tags: + - 组织架构相关 + /third/minio_upload: + post: + consumes: + - application/json + description: minio上传文件(web api), 请注意本api请求为form并非json + operationId: MinioUploadFile + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 要上传的文件文件 + in: formData + name: file + required: true + type: file + - description: 文件类型 + in: formData + name: fileType + required: true + type: integer + - description: 操作唯一ID + in: formData + name: operationID + required: true + type: string + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.MinioUploadFileResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: minio上传文件(web api) + tags: + - 第三方服务相关 + /user/account_check: + post: + consumes: + - application/json + description: 传入UserIDList检查列表账户注册状态,并且返回结果 + operationId: AccountCheck + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求体 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.AccountCheckReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.AccountCheckResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 检查列表账户注册状态,并且返回结果 + tags: + - 用户相关 + /user/get_all_users_uid: + post: + consumes: + - application/json + description: 获取所有用户uid列表 + operationId: GetAllUsersUid + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求体 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetAllUsersUidReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetAllUsersUidResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取所有用户uid列表 + tags: + - 用户相关 + /user/get_self_user_info: + post: + consumes: + - application/json + description: 传入ID获取自己的信息 + operationId: GetSelfUserInfo + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求体 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetSelfUserInfoReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.GetSelfUserInfoResp' + - properties: + data: + $ref: '#/definitions/server_api_params.UserInfo' + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取自己的信息 + tags: + - 用户相关 + /user/get_users_info: + post: + consumes: + - application/json + description: 根据用户列表批量获取用户信息 + operationId: GetUsersInfo + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求体 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetUsersInfoReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + allOf: + - $ref: '#/definitions/base_info.GetUsersInfoResp' + - properties: + Data: + items: + $ref: '#/definitions/server_api_params.PublicUserInfo' + type: array + type: object + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取用户信息 + tags: + - 用户相关 + /user/get_users_online_status: + post: + consumes: + - application/json + description: 获取用户在线状态 + operationId: GetUsersOnlineStatus + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求体 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetUsersOnlineStatusReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetUsersOnlineStatusResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 获取用户在线状态 + tags: + - 用户相关 + /user/set_global_msg_recv_opt: + post: + consumes: + - application/json + description: 设置全局免打扰 + operationId: SetGlobalRecvMessageOpt + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: globalRecvMsgOpt为全局免打扰设置0为关闭 1为开启 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.SetGlobalRecvMessageOptReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.SetGlobalRecvMessageOptResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 设置全局免打扰 + tags: + - 用户相关 + /user/update_user_info: + post: + consumes: + - application/json + description: 修改用户信息 userID faceURL等 + operationId: UpdateUserInfo + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求体 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.UpdateSelfUserInfoReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.UpdateUserInfoResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.Swagger400Resp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.Swagger500Resp' + summary: 修改用户信息 + tags: + - 用户相关 +swagger: "2.0" diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index cd774627b..37ceefff2 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -1,6 +1,7 @@ package main import ( + _ "Open_IM/cmd/open_im_api/docs" apiAuth "Open_IM/internal/api/auth" apiChat "Open_IM/internal/api/chat" "Open_IM/internal/api/conversation" @@ -16,6 +17,9 @@ import ( "Open_IM/pkg/utils" "flag" "fmt" + //_ "github.com/razeencheng/demo-go/swaggo-gin/docs" + swaggerFiles "github.com/swaggo/files" + ginSwagger "github.com/swaggo/gin-swagger" "io" "os" "strconv" @@ -25,6 +29,13 @@ import ( "Open_IM/pkg/common/constant" ) +// @title open-IM-Server API +// @version 1.0 +// @description open-IM-Server 的API服务器文档, 文档中所有请求都有一个operationID字段用于链路追踪 + +// @license.name Apache 2.0 +// @license.url http://www.apache.org/licenses/LICENSE-2.0.html +// @BasePath / func main() { log.NewPrivateLog(constant.LogFileName) gin.SetMode(gin.ReleaseMode) @@ -35,16 +46,21 @@ func main() { r.Use(utils.CorsHandler()) log.Info("load config: ", config.Config) + r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) // user routing group, which handles user registration and login services userRouterGroup := r.Group("/user") { - userRouterGroup.POST("/update_user_info", user.UpdateUserInfo) //1 + userRouterGroup.POST("/update_user_info", user.UpdateUserInfo) //1 + userRouterGroup.POST("/set_global_msg_recv_opt", user.SetGlobalRecvMessageOpt) userRouterGroup.POST("/get_users_info", user.GetUsersInfo) //1 userRouterGroup.POST("/get_self_user_info", user.GetSelfUserInfo) //1 userRouterGroup.POST("/get_users_online_status", user.GetUsersOnlineStatus) //1 userRouterGroup.POST("/get_users_info_from_cache", user.GetUsersInfoFromCache) userRouterGroup.POST("/get_user_friend_from_cache", user.GetFriendIDListFromCache) userRouterGroup.POST("/get_black_list_from_cache", user.GetBlackIDListFromCache) + userRouterGroup.POST("/get_all_users_uid", manage.GetAllUsersUid) //1 + userRouterGroup.POST("/account_check", manage.AccountCheck) //1 + // userRouterGroup.POST("/get_users_online_status", manage.GetUsersOnlineStatus) //1 } //friend routing group friendRouterGroup := r.Group("/friend") @@ -70,7 +86,7 @@ func main() { { groupRouterGroup.POST("/create_group", group.CreateGroup) //1 groupRouterGroup.POST("/set_group_info", group.SetGroupInfo) //1 - groupRouterGroup.POST("join_group", group.JoinGroup) //1 + groupRouterGroup.POST("/join_group", group.JoinGroup) //1 groupRouterGroup.POST("/quit_group", group.QuitGroup) //1 groupRouterGroup.POST("/group_application_response", group.ApplicationGroupResponse) //1 groupRouterGroup.POST("/transfer_group", group.TransferGroupOwner) //1 @@ -82,15 +98,19 @@ func main() { groupRouterGroup.POST("/get_group_all_member_list", group.GetGroupAllMemberList) //1 groupRouterGroup.POST("/get_group_members_info", group.GetGroupMembersInfo) //1 groupRouterGroup.POST("/invite_user_to_group", group.InviteUserToGroup) //1 - groupRouterGroup.POST("/get_joined_group_list", group.GetJoinedGroupList) //1 - groupRouterGroup.POST("/dismiss_group", group.DismissGroup) // + groupRouterGroup.POST("/get_joined_group_list", group.GetJoinedGroupList) + groupRouterGroup.POST("/dismiss_group", group.DismissGroup) // groupRouterGroup.POST("/mute_group_member", group.MuteGroupMember) groupRouterGroup.POST("/cancel_mute_group_member", group.CancelMuteGroupMember) //MuteGroup groupRouterGroup.POST("/mute_group", group.MuteGroup) groupRouterGroup.POST("/cancel_mute_group", group.CancelMuteGroup) - groupRouterGroup.POST("/set_group_member_nickname", group.SetGroupMemberNickname) - + groupRouterGroup.POST("/set_group_member_info", group.SetGroupMemberInfo) + } + superGroupRouterGroup := r.Group("/super_group") + { + superGroupRouterGroup.POST("/get_joined_group_list", group.GetJoinedSuperGroupList) + superGroupRouterGroup.POST("/get_groups_info", group.GetSuperGroupsInfo) } //certificate authRouterGroup := r.Group("/auth") @@ -98,6 +118,7 @@ func main() { authRouterGroup.POST("/user_register", apiAuth.UserRegister) //1 authRouterGroup.POST("/user_token", apiAuth.UserToken) //1 authRouterGroup.POST("/parse_token", apiAuth.ParseToken) //1 + authRouterGroup.POST("/force_logout", apiAuth.ForceLogout) //1 } //Third service thirdGroup := r.Group("/third") @@ -108,6 +129,8 @@ func main() { thirdGroup.POST("/minio_upload", apiThird.MinioUploadFile) thirdGroup.POST("/upload_update_app", apiThird.UploadUpdateApp) thirdGroup.POST("/get_download_url", apiThird.GetDownloadURL) + thirdGroup.POST("/get_rtc_invitation_info", apiThird.GetRTCInvitationInfo) + thirdGroup.POST("/get_rtc_invitation_start_app", apiThird.GetRTCInvitationInfoStartApp) } //Message chatGroup := r.Group("/msg") @@ -116,16 +139,14 @@ func main() { chatGroup.POST("/send_msg", apiChat.SendMsg) chatGroup.POST("/pull_msg_by_seq", apiChat.PullMsgBySeqList) chatGroup.POST("/del_msg", apiChat.DelMsg) + chatGroup.POST("/clear_msg", apiChat.ClearMsg) + chatGroup.POST("/manage_send_msg", manage.ManagementSendMsg) + chatGroup.POST("/batch_send_msg", manage.ManagementBatchSendMsg) } //Manager managementGroup := r.Group("/manager") { managementGroup.POST("/delete_user", manage.DeleteUser) //1 - managementGroup.POST("/send_msg", manage.ManagementSendMsg) - managementGroup.POST("/get_all_users_uid", manage.GetAllUsersUid) //1 - managementGroup.POST("/account_check", manage.AccountCheck) //1 - managementGroup.POST("/get_users_online_status", manage.GetUsersOnlineStatus) //1 - } //Conversation conversationGroup := r.Group("/conversation") @@ -182,7 +203,8 @@ func main() { } go apiThird.MinioInit() - ginPort := flag.Int("port", 10002, "get ginServerPort from cmd,default 10002 as port") + defaultPorts := config.Config.Api.GinPort + ginPort := flag.Int("port", defaultPorts[0], "get ginServerPort from cmd,default 10002 as port") flag.Parse() address := "0.0.0.0:" + strconv.Itoa(*ginPort) if config.Config.Api.ListenIP != "" { diff --git a/cmd/open_im_cms_api/main.go b/cmd/open_im_cms_api/main.go index 6a0068195..b2b1cae7c 100644 --- a/cmd/open_im_cms_api/main.go +++ b/cmd/open_im_cms_api/main.go @@ -15,7 +15,8 @@ func main() { gin.SetMode(gin.ReleaseMode) router := cms_api.NewGinRouter() router.Use(utils.CorsHandler()) - ginPort := flag.Int("port", 10006, "get ginServerPort from cmd,default 10006 as port") + defaultPorts := config.Config.CmsApi.GinPort + ginPort := flag.Int("port", defaultPorts[0], "get ginServerPort from cmd,default 10006 as port") flag.Parse() address := "0.0.0.0:" + strconv.Itoa(*ginPort) if config.Config.Api.ListenIP != "" { diff --git a/cmd/open_im_demo/main.go b/cmd/open_im_demo/main.go index c2ec21783..71d3e114c 100644 --- a/cmd/open_im_demo/main.go +++ b/cmd/open_im_demo/main.go @@ -32,8 +32,16 @@ func main() { authRouterGroup.POST("/login", register.Login) authRouterGroup.POST("/reset_password", register.ResetPassword) } - - ginPort := flag.Int("port", 42233, "get ginServerPort from cmd,default 42233 as port") + demoRouterGroup := r.Group("/auth") + { + demoRouterGroup.POST("/code", register.SendVerificationCode) + demoRouterGroup.POST("/verify", register.Verify) + demoRouterGroup.POST("/password", register.SetPassword) + demoRouterGroup.POST("/login", register.Login) + demoRouterGroup.POST("/reset_password", register.ResetPassword) + } + defaultPorts := config.Config.Demo.Port + ginPort := flag.Int("port", defaultPorts[0], "get ginServerPort from cmd,default 42233 as port") flag.Parse() fmt.Println("start demo api server, port: ", *ginPort) address := "0.0.0.0:" + strconv.Itoa(*ginPort) diff --git a/cmd/open_im_msg_gateway/main.go b/cmd/open_im_msg_gateway/main.go index 283f831b8..5996a4ac5 100644 --- a/cmd/open_im_msg_gateway/main.go +++ b/cmd/open_im_msg_gateway/main.go @@ -2,6 +2,7 @@ package main import ( "Open_IM/internal/msg_gateway/gate" + "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" "flag" @@ -11,8 +12,10 @@ import ( func main() { log.NewPrivateLog(constant.LogFileName) - rpcPort := flag.Int("rpc_port", 10400, "rpc listening port") - wsPort := flag.Int("ws_port", 17778, "ws listening port") + defaultRpcPorts := config.Config.RpcPort.OpenImMessageGatewayPort + defaultWsPorts := config.Config.LongConnSvr.WebsocketPort + rpcPort := flag.Int("rpc_port", defaultRpcPorts[0], "rpc listening port") + wsPort := flag.Int("ws_port", defaultWsPorts[0], "ws listening port") flag.Parse() var wg sync.WaitGroup wg.Add(1) diff --git a/cmd/open_im_push/main.go b/cmd/open_im_push/main.go index 95e8521dd..63b2aaa12 100644 --- a/cmd/open_im_push/main.go +++ b/cmd/open_im_push/main.go @@ -2,6 +2,7 @@ package main import ( "Open_IM/internal/push/logic" + "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" "flag" @@ -10,7 +11,8 @@ import ( ) func main() { - rpcPort := flag.Int("port", 10700, "rpc listening port") + defaultPorts := config.Config.RpcPort.OpenImPushPort + rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port") flag.Parse() var wg sync.WaitGroup wg.Add(1) diff --git a/cmd/rpc/open_im_admin_cms/main.go b/cmd/rpc/open_im_admin_cms/main.go index c69135645..eeb4ca588 100644 --- a/cmd/rpc/open_im_admin_cms/main.go +++ b/cmd/rpc/open_im_admin_cms/main.go @@ -2,12 +2,14 @@ package main import ( rpcMessageCMS "Open_IM/internal/rpc/admin_cms" + "Open_IM/pkg/common/config" "flag" "fmt" ) func main() { - rpcPort := flag.Int("port", 11000, "rpc listening port") + defaultPorts := config.Config.RpcPort.OpenImAdminCmsPort + rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port") flag.Parse() fmt.Println("start cms rpc server, port: ", *rpcPort) rpcServer := rpcMessageCMS.NewAdminCMSServer(*rpcPort) diff --git a/cmd/rpc/open_im_auth/main.go b/cmd/rpc/open_im_auth/main.go index 53b0f9de5..939c7d6f2 100644 --- a/cmd/rpc/open_im_auth/main.go +++ b/cmd/rpc/open_im_auth/main.go @@ -2,12 +2,14 @@ package main import ( rpcAuth "Open_IM/internal/rpc/auth" + "Open_IM/pkg/common/config" "flag" "fmt" ) func main() { - rpcPort := flag.Int("port", 10600, "RpcToken default listen port 10800") + defaultPorts := config.Config.RpcPort.OpenImAuthPort + rpcPort := flag.Int("port", defaultPorts[0], "RpcToken default listen port 10800") flag.Parse() fmt.Println("start auth rpc server, port: ", *rpcPort) rpcServer := rpcAuth.NewRpcAuthServer(*rpcPort) diff --git a/cmd/rpc/open_im_cache/main.go b/cmd/rpc/open_im_cache/main.go index bc50cc28e..d0aacfbc9 100644 --- a/cmd/rpc/open_im_cache/main.go +++ b/cmd/rpc/open_im_cache/main.go @@ -2,12 +2,14 @@ package main import ( rpcCache "Open_IM/internal/rpc/cache" + "Open_IM/pkg/common/config" "flag" "fmt" ) func main() { - rpcPort := flag.Int("port", 10600, "RpcToken default listen port 10800") + defaultPorts := config.Config.RpcPort.OpenImCachePort + rpcPort := flag.Int("port", defaultPorts[0], "RpcToken default listen port 10800") flag.Parse() fmt.Println("start auth rpc server, port: ", *rpcPort) rpcServer := rpcCache.NewCacheServer(*rpcPort) diff --git a/cmd/rpc/open_im_conversation/main.go b/cmd/rpc/open_im_conversation/main.go index dc43063e6..53769c4ac 100644 --- a/cmd/rpc/open_im_conversation/main.go +++ b/cmd/rpc/open_im_conversation/main.go @@ -2,12 +2,14 @@ package main import ( rpcConversation "Open_IM/internal/rpc/conversation" + "Open_IM/pkg/common/config" "flag" "fmt" ) func main() { - rpcPort := flag.Int("port", 11400, "RpcConversation default listen port 11300") + defaultPorts := config.Config.RpcPort.OpenImConversationPort + rpcPort := flag.Int("port", defaultPorts[0], "RpcConversation default listen port 11300") flag.Parse() fmt.Println("start conversation rpc server, port: ", *rpcPort) rpcServer := rpcConversation.NewRpcConversationServer(*rpcPort) diff --git a/cmd/rpc/open_im_friend/main.go b/cmd/rpc/open_im_friend/main.go index 85d05e39c..b6a650e63 100644 --- a/cmd/rpc/open_im_friend/main.go +++ b/cmd/rpc/open_im_friend/main.go @@ -2,13 +2,14 @@ package main import ( "Open_IM/internal/rpc/friend" + "Open_IM/pkg/common/config" "flag" "fmt" ) func main() { - - rpcPort := flag.Int("port", 10200, "get RpcFriendPort from cmd,default 12000 as port") + defaultPorts := config.Config.RpcPort.OpenImFriendPort + rpcPort := flag.Int("port", defaultPorts[0], "get RpcFriendPort from cmd,default 12000 as port") flag.Parse() fmt.Println("start friend rpc server, port: ", *rpcPort) rpcServer := friend.NewFriendServer(*rpcPort) diff --git a/cmd/rpc/open_im_group/main.go b/cmd/rpc/open_im_group/main.go index 7afc7ec57..14cb56722 100644 --- a/cmd/rpc/open_im_group/main.go +++ b/cmd/rpc/open_im_group/main.go @@ -2,12 +2,14 @@ package main import ( "Open_IM/internal/rpc/group" + "Open_IM/pkg/common/config" "flag" "fmt" ) func main() { - rpcPort := flag.Int("port", 10500, "get RpcGroupPort from cmd,default 16000 as port") + defaultPorts := config.Config.RpcPort.OpenImGroupPort + rpcPort := flag.Int("port", defaultPorts[0], "get RpcGroupPort from cmd,default 16000 as port") flag.Parse() fmt.Println("start group rpc server, port: ", *rpcPort) rpcServer := group.NewGroupServer(*rpcPort) diff --git a/cmd/rpc/open_im_message_cms/main.go b/cmd/rpc/open_im_message_cms/main.go index 16151a2ed..9c39a99e4 100644 --- a/cmd/rpc/open_im_message_cms/main.go +++ b/cmd/rpc/open_im_message_cms/main.go @@ -2,12 +2,14 @@ package main import ( rpcMessageCMS "Open_IM/internal/rpc/message_cms" + "Open_IM/pkg/common/config" "flag" "fmt" ) func main() { - rpcPort := flag.Int("port", 10900, "rpc listening port") + defaultPorts := config.Config.RpcPort.OpenImMessageCmsPort[0] + rpcPort := flag.Int("port", defaultPorts, "rpc listening port") flag.Parse() fmt.Println("start msg cms rpc server, port: ", *rpcPort) rpcServer := rpcMessageCMS.NewMessageCMSServer(*rpcPort) diff --git a/cmd/rpc/open_im_msg/main.go b/cmd/rpc/open_im_msg/main.go index 95908f48a..8c7948c1a 100644 --- a/cmd/rpc/open_im_msg/main.go +++ b/cmd/rpc/open_im_msg/main.go @@ -2,12 +2,14 @@ package main import ( rpcChat "Open_IM/internal/rpc/msg" + "Open_IM/pkg/common/config" "flag" "fmt" ) func main() { - rpcPort := flag.Int("port", 10300, "rpc listening port") + defaultPorts := config.Config.RpcPort.OpenImMessagePort + rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port") flag.Parse() fmt.Println("start msg rpc server, port: ", *rpcPort) rpcServer := rpcChat.NewRpcChatServer(*rpcPort) diff --git a/cmd/rpc/open_im_office/main.go b/cmd/rpc/open_im_office/main.go index c9a05c791..51ec154f0 100644 --- a/cmd/rpc/open_im_office/main.go +++ b/cmd/rpc/open_im_office/main.go @@ -2,12 +2,14 @@ package main import ( rpc "Open_IM/internal/rpc/office" + "Open_IM/pkg/common/config" "flag" "fmt" ) func main() { - rpcPort := flag.Int("port", 11100, "rpc listening port") + defaultPorts := config.Config.RpcPort.OpenImOfficePort + rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port") flag.Parse() fmt.Println("start office rpc server, port: ", *rpcPort) rpcServer := rpc.NewOfficeServer(*rpcPort) diff --git a/cmd/rpc/open_im_organization/main.go b/cmd/rpc/open_im_organization/main.go index 906ac510f..2e8b94bb1 100644 --- a/cmd/rpc/open_im_organization/main.go +++ b/cmd/rpc/open_im_organization/main.go @@ -2,12 +2,14 @@ package main import ( "Open_IM/internal/rpc/organization" + "Open_IM/pkg/common/config" "flag" "fmt" ) func main() { - rpcPort := flag.Int("port", 11200, "get RpcOrganizationPort from cmd,default 11200 as port") + defaultPorts := config.Config.RpcPort.OpenImOrganizationPort + rpcPort := flag.Int("port", defaultPorts[0], "get RpcOrganizationPort from cmd,default 11200 as port") flag.Parse() fmt.Println("start organization rpc server, port: ", *rpcPort) rpcServer := organization.NewServer(*rpcPort) diff --git a/cmd/rpc/open_im_statistics/main.go b/cmd/rpc/open_im_statistics/main.go index b87440abf..f9b0e8539 100644 --- a/cmd/rpc/open_im_statistics/main.go +++ b/cmd/rpc/open_im_statistics/main.go @@ -2,12 +2,14 @@ package main import ( "Open_IM/internal/rpc/statistics" + "Open_IM/pkg/common/config" "flag" "fmt" ) func main() { - rpcPort := flag.Int("port", 10800, "rpc listening port") + defaultPorts := config.Config.RpcPort.OpenImStatisticsPort + rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port") flag.Parse() fmt.Println("start statistics rpc server, port: ", *rpcPort) rpcServer := statistics.NewStatisticsServer(*rpcPort) diff --git a/cmd/rpc/open_im_user/main.go b/cmd/rpc/open_im_user/main.go index d8644d028..e50ebef35 100644 --- a/cmd/rpc/open_im_user/main.go +++ b/cmd/rpc/open_im_user/main.go @@ -2,12 +2,14 @@ package main import ( "Open_IM/internal/rpc/user" + "Open_IM/pkg/common/config" "flag" "fmt" ) func main() { - rpcPort := flag.Int("port", 10100, "rpc listening port") + defaultPorts := config.Config.RpcPort.OpenImUserPort + rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port") flag.Parse() fmt.Println("start user rpc server, port: ", *rpcPort) rpcServer := user.NewUserServer(*rpcPort) diff --git a/config/config.yaml b/config/config.yaml index 736b15bce..3190bb34f 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -1,4 +1,5 @@ # The class cannot be named by Pascal or camel case. +# The class cannot be named by Pascal or camel case. # If it is not used, the corresponding structure will not be set, # and it will not be read naturally. serverversion: 2.0.0 @@ -7,6 +8,8 @@ etcd: etcdSchema: openim #默认即可 etcdAddr: [ 127.0.0.1:2379 ] #单机部署时,默认即可 +k8sMod: false #开启k8s模式 使用pod里面环境变量请求services调用服务 而并非etcd + mysql: dbMysqlAddress: [ 127.0.0.1:13306 ] #mysql地址 目前仅支持单机,默认即可 dbMysqlUserName: root #mysql用户名,建议修改 @@ -20,22 +23,23 @@ mysql: mongo: dbUri: ""#当dbUri值不为空则直接使用该值 - dbAddress: [ 127.0.0.1:37017 ] #mongo地址 目前仅支持单机,默认即可 + dbAddress: 127.0.0.1:37017 #单机时为mongo地址,使用分片集群时,为mongos地址 默认即可 dbDirect: false - dbTimeout: 10 + dbTimeout: 60 dbDatabase: openIM #mongo db 默认即可 dbSource: admin - dbUserName: #mongo用户名,建议先不设置 - dbPassword: #mongo密码,建议先不设置 - dbMaxPoolSize: 20 + dbUserName: #mongo用户名,建议先不设置 + dbPassword: #mongo密码,建议先不设置 + dbMaxPoolSize: 100 dbRetainChatRecords: 3650 #mongo保存离线消息时间(天),根据需求修改 redis: - dbAddress: 127.0.0.1:16379 #redis地址 目前仅支持单机,默认即可 + dbAddress: [ 127.0.0.1:16379 ] #redis地址 单机时,填写一个地址即可,使用redis集群时候,填写集群中多个节点地址(主从地址都可以填写,增加容灾能力),默认即可 dbMaxIdle: 128 dbMaxActive: 0 dbIdleTimeout: 120 dbPassWord: openIM #redis密码 建议修改 + enableCluster: false #如果外部redis以集群方式启动,需要打开此开关 kafka: ws2mschat: @@ -44,12 +48,15 @@ kafka: ws2mschatoffline: addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可 topic: "ws2ms_chat_offline" + msgtomongo: + addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可 + topic: "msg_to_mongo" ms2pschat: addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可 topic: "ms2ps_chat" consumergroupid: - msgToMongo: mongo - msgToMongoOffline: mongo_offline + msgToTransfer: mongo + msgToMongo: mongo_ex msgToMySql: mysql msgToPush: push @@ -63,11 +70,11 @@ kafka: #如果是单机模式,用0.0.0.0或者不填,默认即可 serverip: 0.0.0.0 +#作为rpc时,注册到etcd的地址,单机默认即可,如果是集群部署,需要修改(具体使用内网地址还是外网地址,要依情况而定,目的是api/gateway能访问到) rpcRegisterIP: 127.0.0.1 +#默认即可 listenIP: 0.0.0.0 - - # endpoints 内部组件间访问的端点host名称,访问时,可以内部直接访问 host:port 来访问 endpoints: api: openim_api @@ -215,6 +222,7 @@ manager: #app管理员userID和对应的secret 建议修改。 用于管理后台登录,也可以用户管理后台对应的api appManagerUid: [ "openIM123456","openIM654321", "openIM333", "openIMAdmin"] secrets: [ "openIM1","openIM2", "openIM333", "openIMAdmin"] + appSysNotificationName: "系统通知" secret: tuoyun # 多端互踢策略 @@ -222,7 +230,15 @@ secret: tuoyun multiloginpolicy: 1 #chat log insert to db -chatPersistenceMysql: true +chatpersistencemysql: true +#可靠性存储 +reliablestorage: false +#消息缓存时间 +msgCacheTimeout: 86400 +#群聊已读开启 +groupMessageHasReadReceiptEnable: true +#单聊已读开启 +singleMessageHasReadReceiptEnable: true #token config tokenpolicy: @@ -245,12 +261,13 @@ messageverify: iospush: pushSound: "xxx" badgeCount: true + production: false callback: # callback url 需要自行更换callback url callbackUrl : "http://127.0.0.1:8080/callback" # 开启关闭操作前后回调的配置 - callbackbeforeSendSingleMsg: + callbackBeforeSendSingleMsg: enable: false # 回调是否启用 callbackTimeOut: 2 # 回调超时时间 callbackFailedContinue: true # 回调超时是否继续执行代码 @@ -268,7 +285,16 @@ callback: enable: false callbackTimeOut: 2 callbackFailedContinue: true - + callbackUserOnline: + enable: false + callbackTimeOut: 2 + callbackUserOffline: + enable: false + callbackTimeOut: 2 + callbackOfflinePush: + enable: false + callbackTimeOut: 2 + callbackFailedContinue: true # 回调超时是否继续离线推送 notification: groupCreated: @@ -655,7 +681,6 @@ notification: defaultTips: tips: "welcome user join department" - #---------------demo configuration---------------------# #The following configuration items are applied to openIM Demo configuration #是否启动demo,如果自身没有账号体系,设置为true @@ -664,14 +689,23 @@ demo: listenIP: 0.0.0.0 #demo对外服务端口,默认即可,需要开放此端口或做nginx转发 openImDemoPort: [ 10004 ] - alismsverify: #阿里云短信配置,在阿里云申请成功后修改以下四项,必须修改 + alismsverify: #阿里云短信配置,在阿里云申请成功后修改以下四项,enable为true则必须修改,阿里云为默认短信验证方式 accessKeyId: LTAI5tJPkn4HuuePdiLdGqe7 accessKeySecret: 4n9OJ7ZCVN1U6KeHDAtOyNeVZcjOuV signName: 托云信息技术 verificationCodeTemplateCode: SMS_226810164 + enable: false + tencentsms: #腾讯云短信配置,在腾讯云申请成功后,修改以下选项,enable为true则必须修改 + appID: 2400000648 + region: "ap-singapore" + secretID: IKIDra4JPGsFMDwQedMq42lESQBgwwgBQQAe + secretKey: HI6fz4uUotjJdiX6QUIrAE2buxlKdgU2 + signName: "" + verificationCodeTemplateCode: 2902877 + enable: true superCode: 666666 #超级验证码,建议修改掉,收不到短信验证码时可以用此替代 # second - codeTTL: 300 + codeTTL: 60 mail: #仅支持qq邮箱,具体操作参考 https://service.mail.qq.com/cgi-bin/help?subtype=1&id=28&no=1001256 必须修改 title: "openIM" senderMail: "765567899@qq.com" @@ -679,7 +713,7 @@ demo: smtpAddr: "smtp.qq.com" smtpPort: 25 #需开放此端口 出口方向 testDepartMentID: 001 + imAPIURL: http://127.0.0.1:10002 rtc: - port: 11300 - address: 127.0.0.1 + signalTimeout: 35 diff --git a/deploy/dockerfiles/Dockerfile.api b/deploy/dockerfiles/Dockerfile.api index 9c70d735d..99582608a 100644 --- a/deploy/dockerfiles/Dockerfile.api +++ b/deploy/dockerfiles/Dockerfile.api @@ -6,6 +6,7 @@ ENV CONFIG_NAME $WORKDIR/config/config.yaml # 将可执行文件复制到目标目录 ADD ./open_im_api $WORKDIR/main +COPY ./start_api.sh $$WORKDIR # 创建用于挂载的几个目录,添加可执行权限 RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ @@ -13,4 +14,4 @@ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ WORKDIR $WORKDIR -CMD ./main \ No newline at end of file +CMD ./start_api.sh \ No newline at end of file diff --git a/deploy_k8s/admin_cms/admin_cms.Dockerfile b/deploy_k8s/admin_cms/admin_cms.Dockerfile new file mode 100644 index 000000000..a7b33da70 --- /dev/null +++ b/deploy_k8s/admin_cms/admin_cms.Dockerfile @@ -0,0 +1,20 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + + +# 将可执行文件复制到目标目录 +ADD ./open_im_admin_cms $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config", "/Open-IM-Server/script"] + + +WORKDIR $CMDDIR +CMD ./main diff --git a/deploy_k8s/admin_cms/deployment.yaml b/deploy_k8s/admin_cms/deployment.yaml new file mode 100644 index 000000000..727a08520 --- /dev/null +++ b/deploy_k8s/admin_cms/deployment.yaml @@ -0,0 +1,32 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: admin-cms-deployment +spec: + selector: + matchLabels: + app: admin-cms # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: admin-cms # 标签 + spec: + containers: + - name: admin-cms + image: openim/admin_cms:v2.1.0 + # imagePullPolicy: Always #每次启动都重新拉取镜像 + ports: + - containerPort: 10200 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 + diff --git a/deploy_k8s/api/api.Dockerfile b/deploy_k8s/api/api.Dockerfile new file mode 100644 index 000000000..644621d5f --- /dev/null +++ b/deploy_k8s/api/api.Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_api $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + + +WORKDIR $CMDDIR +CMD ./main diff --git a/deploy_k8s/api/deployment.yaml b/deploy_k8s/api/deployment.yaml new file mode 100644 index 000000000..1a74ae7a1 --- /dev/null +++ b/deploy_k8s/api/deployment.yaml @@ -0,0 +1,45 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: api-deployment +spec: + selector: + matchLabels: + app: api # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: api # 标签 + spec: + containers: + - name: api + image: openim/api:v2.1.0 + # imagePullPolicy: Always + ports: + - containerPort: 10002 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 +--- +apiVersion: v1 +kind: Service +metadata: + name: api +spec: + ports: + - name: api-port + protocol: TCP + port: 10002 + targetPort: 10002 + selector: + app: api + type: NodePort \ No newline at end of file diff --git a/deploy_k8s/auth/auth.Dockerfile b/deploy_k8s/auth/auth.Dockerfile new file mode 100644 index 000000000..15eafd782 --- /dev/null +++ b/deploy_k8s/auth/auth.Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_auth $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/deploy_k8s/auth/deployment.yaml b/deploy_k8s/auth/deployment.yaml new file mode 100644 index 000000000..5b60d77f7 --- /dev/null +++ b/deploy_k8s/auth/deployment.yaml @@ -0,0 +1,31 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: auth-deployment +spec: + selector: + matchLabels: + app: auth # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: auth # 标签 + spec: + containers: + - name: auth + image: openim/auth:v2.1.0 + # imagePullPolicy: Always + ports: + - containerPort: 10160 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 \ No newline at end of file diff --git a/deploy_k8s/build_push_all_images.sh b/deploy_k8s/build_push_all_images.sh new file mode 100644 index 000000000..6f46bf33c --- /dev/null +++ b/deploy_k8s/build_push_all_images.sh @@ -0,0 +1,30 @@ +#/bin/sh +source ./path_info.cfg + +# images version +version=v2.1.0 +git pull +cd ../script/; ./build_all_service.sh +cd ../deploy_k8s/ + +for i in ${service[*]} +do + mv ../bin/open_im_${i} ./${i}/ +done + +echo "move success" + +echo "start to build images" + +for i in ${service[*]} +do + echo "start to build images" $i + cd $i + image="openim/${i}:$version" + docker build -t $image . -f ./${i}.Dockerfile + echo "build ${dockerfile} success" + docker push $image + echo "push ${image} success " + cd .. +done + diff --git a/deploy_k8s/cache/cache.Dockerfile b/deploy_k8s/cache/cache.Dockerfile new file mode 100644 index 000000000..13c5278bd --- /dev/null +++ b/deploy_k8s/cache/cache.Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + + +# 将可执行文件复制到目标目录 +ADD ./open_im_cache $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/deploy_k8s/cache/deployment.yaml b/deploy_k8s/cache/deployment.yaml new file mode 100644 index 000000000..ef41d2bde --- /dev/null +++ b/deploy_k8s/cache/deployment.yaml @@ -0,0 +1,31 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: cache-deployment +spec: + selector: + matchLabels: + app: cache # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: cache # 标签 + spec: + containers: + - name: cache + image: openim/cache:v2.1.0 + # imagePullPolicy: Always + ports: + - containerPort: 10240 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 \ No newline at end of file diff --git a/deploy_k8s/cms_api/cms_api.Dockerfile b/deploy_k8s/cms_api/cms_api.Dockerfile new file mode 100644 index 000000000..78eda6ecf --- /dev/null +++ b/deploy_k8s/cms_api/cms_api.Dockerfile @@ -0,0 +1,18 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_cms_api $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/deploy_k8s/cms_api/deployment.yaml b/deploy_k8s/cms_api/deployment.yaml new file mode 100644 index 000000000..6f3fd5b2d --- /dev/null +++ b/deploy_k8s/cms_api/deployment.yaml @@ -0,0 +1,45 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: cms-api-deployment +spec: + selector: + matchLabels: + app: cms-api # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: cms-api # 标签 + spec: + containers: + - name: cms-api + image: openim/cms_api:v2.1.0 + imagePullPolicy: Always + ports: + - containerPort: 10006 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 +--- +apiVersion: v1 +kind: Service +metadata: + name: cms-api +spec: + ports: + - name: cms-api-port + protocol: TCP + port: 10006 + targetPort: 10006 + selector: + app: cms-api + type: NodePort \ No newline at end of file diff --git a/deploy_k8s/conversation/conversation.Dockerfile b/deploy_k8s/conversation/conversation.Dockerfile new file mode 100644 index 000000000..bea8d4b00 --- /dev/null +++ b/deploy_k8s/conversation/conversation.Dockerfile @@ -0,0 +1,18 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_conversation $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/deploy_k8s/conversation/deployment.yaml b/deploy_k8s/conversation/deployment.yaml new file mode 100644 index 000000000..90b6bdab1 --- /dev/null +++ b/deploy_k8s/conversation/deployment.yaml @@ -0,0 +1,32 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: conversation-deployment +spec: + selector: + matchLabels: + app: conversation # 选择这个指定标签执行 + replicas: 2 # 运行pod数量 + template: + metadata: + labels: + app: conversation # 标签 + spec: + containers: + - name: conversation + image: openim/conversation:v2.1.0 + # imagePullPolicy: Always + ports: + - containerPort: 10230 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 + diff --git a/deploy_k8s/demo/demo.Dockerfile b/deploy_k8s/demo/demo.Dockerfile new file mode 100644 index 000000000..8b829dde0 --- /dev/null +++ b/deploy_k8s/demo/demo.Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_demo $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/deploy_k8s/demo/deployment.yaml b/deploy_k8s/demo/deployment.yaml new file mode 100644 index 000000000..8c612d153 --- /dev/null +++ b/deploy_k8s/demo/deployment.yaml @@ -0,0 +1,45 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: demo-deployment +spec: + selector: + matchLabels: + app: demo # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: demo # 标签 + spec: + containers: + - name: demo + image: openim/demo:v2.1.0 + imagePullPolicy: Always + ports: + - containerPort: 10004 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 +--- +apiVersion: v1 +kind: Service +metadata: + name: demo +spec: + ports: + - name: demo + protocol: TCP + port: 10004 + targetPort: 10004 + selector: + app: demo + type: NodePort \ No newline at end of file diff --git a/deploy_k8s/friend/deployment.yaml b/deploy_k8s/friend/deployment.yaml new file mode 100644 index 000000000..c521c7a3e --- /dev/null +++ b/deploy_k8s/friend/deployment.yaml @@ -0,0 +1,32 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: friend-deployment +spec: + selector: + matchLabels: + app: friend # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: friend # 标签 + spec: + containers: + - name: friend + image: openim/friend:v2.1.0 + # imagePullPolicy: Always + ports: + - containerPort: 10120 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 + diff --git a/deploy_k8s/friend/friend.Dockerfile b/deploy_k8s/friend/friend.Dockerfile new file mode 100644 index 000000000..54f430e01 --- /dev/null +++ b/deploy_k8s/friend/friend.Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + + +# 将可执行文件复制到目标目录 +ADD ./open_im_friend $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/deploy_k8s/group/deployment.yaml b/deploy_k8s/group/deployment.yaml new file mode 100644 index 000000000..a27dc2547 --- /dev/null +++ b/deploy_k8s/group/deployment.yaml @@ -0,0 +1,31 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: group-deployment +spec: + selector: + matchLabels: + app: group # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: group # 标签 + spec: + containers: + - name: group + image: openim/group:v2.1.0 + # imagePullPolicy: Always + ports: + - containerPort: 10150 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 \ No newline at end of file diff --git a/deploy_k8s/group/group.Dockerfile b/deploy_k8s/group/group.Dockerfile new file mode 100644 index 000000000..9baa7b5e9 --- /dev/null +++ b/deploy_k8s/group/group.Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_group $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/deploy_k8s/ingress.yaml b/deploy_k8s/ingress.yaml new file mode 100644 index 000000000..6d7fbda6d --- /dev/null +++ b/deploy_k8s/ingress.yaml @@ -0,0 +1,101 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/proxy-http-version: "1.1" + nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" + nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" + name: sdk-server-ingress +spec: + rules: + - host: sdk-server.openim.xxx.com + http: + paths: + - backend: + service: + name: sdk-server + port: + number: 10003 + path: / + pathType: Prefix +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/proxy-http-version: "1.1" + nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" + nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" + name: msg-gateway-ingress +spec: + rules: + - host: msg-gateway.openim.xxx.com + http: + paths: + - backend: + service: + name: msg-gateway + port: + number: 10001 + path: / + pathType: Prefix +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: "nginx" + name: api-ingress +spec: + rules: + - host: api.openim.xxx.com + http: + paths: + - backend: + service: + name: api + port: + number: 10002 + path: / + pathType: Prefix +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: "nginx" + name: demo-ingress +spec: + rules: + - host: demo.openim.xxx.com + http: + paths: + - backend: + service: + name: demo + port: + number: 10004 + path: / + pathType: Prefix +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: "nginx" + name: cms-api-ingress +spec: + rules: + - host: cms-api.openim.xxx.com + http: + paths: + - backend: + service: + name: cms-api + port: + number: 10006 + path: / + pathType: Prefix \ No newline at end of file diff --git a/deploy_k8s/k8s_openim_deploy.md b/deploy_k8s/k8s_openim_deploy.md new file mode 100644 index 000000000..aef9aecda --- /dev/null +++ b/deploy_k8s/k8s_openim_deploy.md @@ -0,0 +1,99 @@ +#### openIM k8s部署文档 +### 1. 修改配置文件 +在Open-IM-SERVER根目录下修改config/config.yaml配置文件, 请确保以下修改的所有地址必须保证k8s pod能够访问 +1. 修改ETCD配置为自己的ETCD ip地址, 最好和k8s本身使用的ETCD分开 +2. 修改MySQL配置 +3. 修改Mongo配置 +4. 修改Redis配置 +5. 修改Kafka配置 +6. 将rpcRegisterIP修改为空, 此地址为每个rpc注册到ETCD的地址, 置空每个rpc将会将pod地址注册到ETCD, 才能正确rpc请求(重要) +7. 如果使用minio作为对象存储, 还需要修改minio的地址 +8. 其他如果使用离线推送,需要修改push离线推送配置 +9. 修改demo中的imAPIURL字段为openIM api的ingress或者service地址, 需要让demo的pod能正确请求到(重要) +10. 其他非必须配置修改, 如短信,推送等 + +### 2. 项目根目录创建im configMap到k8s openim namespace +1. 为open-IM项目创建单独命名空间 + ``` + kubectl create namespace openim + ``` +2. 在项目根目录通过config/config.yaml + ``` + kubectl -n openim create configmap config --from-file=config/config.yaml + ``` + 查看configmap + ``` + kubectl -n openim get configmap + ``` + +### 3(可选). 修改每个deployment.yml + 每个rpc的deployment在Open-IM-SERVER根目录deploy_k8s下 + 给需要调度的node打上标签 + ``` + kubectl get nodes + kubectl label node k8s-node1 role=openIMworker + ``` + 在deployment的spec.template.spec加上 + ``` + nodeSelector: + role: openIMworker + ``` + 创建资源清单时添加上nodeSelector属性对应即可, + 修改每种服务数量,建议至少每种2个rpc。 + 如果修改了config/config.yaml某些配置比如端口,同时需要修改对应deployment端口和ingress端口 + + +### 4. 修改ingress.yaml配置文件 +1. 需要安装ingress controller, 这里使用的是ingress-nginx, 使用其他类型的ingress controller需要更改ingress.class, 将host改为自己部署服务的host + +### 5. 执行./kubectl_start.sh脚本 +1. 脚本给予可执行权限 + ``` + chmod +x ./kubectl_start.sh ./kubectl_stop.sh + ``` +2. 启动k8s service和deployment + ``` + ./kubectl_start.sh + ``` +3. 启动k8s ingress + ``` + kubectl -n openim apply -f ingress.yaml + ``` +kubectl 启动所有deployment, services, ingress + +### 6. 查看k8s deployment service ingress状态 + + ``` + kubectl -n openim get services + kubectl -n openim get deployment + kubectl -n openim get ingress + kubectl -n openim get pods + ``` + 检测服务可达 + ``` + telnet msg-gateway.openim.xxx.com {{your_ingress_port}} + telnet sdk-server.openim.xxx.com {{your_ingress_port}} + telnet api.openim.xxx.com {{your_ingress_port}} + telnet cms-api.openim.xxx.com {{your_ingress_port}} + telnet demo.openim.xxx.com {{your_ingress_port}} + ``` + +#### openIM k8s更新 +1. 暂存配置文件,拉取代码 + ``` + git stash push config/config.yaml + git pull + ``` +2. 合并配置文件, 解决冲突 + ``` + git stash pop + ``` +3. 重新生成configmap + ``` + kubectl -n openim create configmap config --from-file=config/config.yaml + ``` +4.修改所有deployment文件的spec.template.spec.image 改为新版本后在/deploy_k8s下重新执行 + ``` + ./kubectl_stop.sh + ./kubectl_start.sh + ``` \ No newline at end of file diff --git a/deploy_k8s/kubectl_start_all.sh b/deploy_k8s/kubectl_start_all.sh new file mode 100755 index 000000000..b1c11b0bd --- /dev/null +++ b/deploy_k8s/kubectl_start_all.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +source ./path_info.cfg + +#mkdir -p /db/sdk #path for jssdk sqlite + +for i in ${service[*]} +do + kubectl -n openim apply -f ./${i}/deployment.yaml +done + diff --git a/deploy_k8s/kubectl_stop_all.sh b/deploy_k8s/kubectl_stop_all.sh new file mode 100755 index 000000000..47f87eeb6 --- /dev/null +++ b/deploy_k8s/kubectl_stop_all.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +service=( + #api service file + api + cms-api + #rpc service file + user + friend + group + auth + admin-cms + message-cms + statistics + office + organization + conversation + cache + msg-gateway + msg-transfer + msg + push + sdk-server + demo +) + +for i in ${service[*]} +do + kubectl -n openim delete deployment "${i}-deployment" +done + +kubectl -n openim delete service api +kubectl -n openim delete service cms-api +kubectl -n openim delete service sdk-server +kubectl -n openim delete service msg-gateway +kubectl -n openim delete service demo + +echo done \ No newline at end of file diff --git a/deploy_k8s/message_cms/deployment.yaml b/deploy_k8s/message_cms/deployment.yaml new file mode 100644 index 000000000..8c5e3e83d --- /dev/null +++ b/deploy_k8s/message_cms/deployment.yaml @@ -0,0 +1,31 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: message-cms-deployment +spec: + selector: + matchLabels: + app: message-cms # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: message-cms # 标签 + spec: + containers: + - name: message-cms + image: openim/message_cms:v2.1.0 + # imagePullPolicy: Always + ports: + - containerPort: 10190 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 \ No newline at end of file diff --git a/deploy_k8s/message_cms/message_cms.Dockerfile b/deploy_k8s/message_cms/message_cms.Dockerfile new file mode 100644 index 000000000..24d08ece9 --- /dev/null +++ b/deploy_k8s/message_cms/message_cms.Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_message_cms $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/deploy_k8s/msg/deployment.yaml b/deploy_k8s/msg/deployment.yaml new file mode 100644 index 000000000..4e6873699 --- /dev/null +++ b/deploy_k8s/msg/deployment.yaml @@ -0,0 +1,31 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: msg-deployment +spec: + selector: + matchLabels: + app: msg # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: msg # 标签 + spec: + containers: + - name: msg + image: openim/msg:v2.1.0 + # imagePullPolicy: Always + ports: + - containerPort: 10130 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 \ No newline at end of file diff --git a/deploy_k8s/msg/msg.Dockerfile b/deploy_k8s/msg/msg.Dockerfile new file mode 100644 index 000000000..54a54f9bf --- /dev/null +++ b/deploy_k8s/msg/msg.Dockerfile @@ -0,0 +1,20 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + + +# 将可执行文件复制到目标目录 +ADD ./open_im_msg $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/deploy_k8s/msg_gateway/deployment.yaml b/deploy_k8s/msg_gateway/deployment.yaml new file mode 100644 index 000000000..604af28dd --- /dev/null +++ b/deploy_k8s/msg_gateway/deployment.yaml @@ -0,0 +1,50 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: msg-gateway-deployment +spec: + selector: + matchLabels: + app: msg-gateway # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: msg-gateway # 标签 + spec: + containers: + - name: msg-gateway + image: openim/msg_gateway:v2.1.0 + # imagePullPolicy: Always + ports: + - name: rpc-port + containerPort: 10140 + - name: ws-port + containerPort: 10001 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 +--- +apiVersion: v1 +kind: Service +metadata: + name: msg-gateway +spec: + ports: + - name: msg-gateway-port + protocol: TCP + port: 10001 + targetPort: ws-port + selector: + app: msg-gateway + type: NodePort + + \ No newline at end of file diff --git a/deploy_k8s/msg_gateway/msg_gateway.Dockerfile b/deploy_k8s/msg_gateway/msg_gateway.Dockerfile new file mode 100644 index 000000000..8954af854 --- /dev/null +++ b/deploy_k8s/msg_gateway/msg_gateway.Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_msg_gateway $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/deploy_k8s/msg_transfer/deployment.yaml b/deploy_k8s/msg_transfer/deployment.yaml new file mode 100644 index 000000000..459a93410 --- /dev/null +++ b/deploy_k8s/msg_transfer/deployment.yaml @@ -0,0 +1,29 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: msg-transfer-deployment +spec: + selector: + matchLabels: + app: msg-transfer # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: msg-transfer # 标签 + spec: + containers: + - name: msg-transfer + image: openim/msg_transfer:v2.1.0 + # imagePullPolicy: Always + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 diff --git a/deploy_k8s/msg_transfer/msg_transfer.Dockerfile b/deploy_k8s/msg_transfer/msg_transfer.Dockerfile new file mode 100644 index 000000000..9d103ce07 --- /dev/null +++ b/deploy_k8s/msg_transfer/msg_transfer.Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_msg_transfer $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/deploy_k8s/office/deployment.yaml b/deploy_k8s/office/deployment.yaml new file mode 100644 index 000000000..c7a6c1da5 --- /dev/null +++ b/deploy_k8s/office/deployment.yaml @@ -0,0 +1,31 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: office-deployment +spec: + selector: + matchLabels: + app: office # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: office # 标签 + spec: + containers: + - name: office + image: openim/office:v2.1.0 + # imagePullPolicy: Always + ports: + - containerPort: 10210 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 \ No newline at end of file diff --git a/deploy_k8s/office/office.Dockerfile b/deploy_k8s/office/office.Dockerfile new file mode 100644 index 000000000..8144deaa1 --- /dev/null +++ b/deploy_k8s/office/office.Dockerfile @@ -0,0 +1,20 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + + +# 将可执行文件复制到目标目录 +ADD ./open_im_office $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/deploy_k8s/organization/deployment.yaml b/deploy_k8s/organization/deployment.yaml new file mode 100644 index 000000000..fce6fde5a --- /dev/null +++ b/deploy_k8s/organization/deployment.yaml @@ -0,0 +1,31 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: organization-deployment +spec: + selector: + matchLabels: + app: organization # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: organization # 标签 + spec: + containers: + - name: organization + image: openim/organization:v2.1.0 + # imagePullPolicy: Always + ports: + - containerPort: 10220 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 \ No newline at end of file diff --git a/deploy_k8s/organization/organization.Dockerfile b/deploy_k8s/organization/organization.Dockerfile new file mode 100644 index 000000000..9a824f1fe --- /dev/null +++ b/deploy_k8s/organization/organization.Dockerfile @@ -0,0 +1,20 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_organization $WORKDIR/cmd/main + + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/deploy_k8s/path_info.cfg b/deploy_k8s/path_info.cfg new file mode 100644 index 000000000..6839e97bf --- /dev/null +++ b/deploy_k8s/path_info.cfg @@ -0,0 +1,24 @@ +#/bin/sh +service=( + #api service file + api + cms_api + #rpc service file + user + friend + group + auth + admin_cms + message_cms + statistics + office + organization + conversation + cache + msg_gateway + msg_transfer + msg + push + sdk_server + demo +) \ No newline at end of file diff --git a/deploy_k8s/push/deployment.yaml b/deploy_k8s/push/deployment.yaml new file mode 100644 index 000000000..14ba13fdd --- /dev/null +++ b/deploy_k8s/push/deployment.yaml @@ -0,0 +1,31 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: push-deployment +spec: + selector: + matchLabels: + app: push # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: push # 标签 + spec: + containers: + - name: push + image: openim/push:v2.1.0 + # imagePullPolicy: Always + ports: + - containerPort: 10170 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 \ No newline at end of file diff --git a/deploy_k8s/push/push.Dockerfile b/deploy_k8s/push/push.Dockerfile new file mode 100644 index 000000000..92409d225 --- /dev/null +++ b/deploy_k8s/push/push.Dockerfile @@ -0,0 +1,20 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + + +# 将可执行文件复制到目标目录 +ADD ./open_im_push $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/deploy_k8s/sdk_server/deployment.yaml b/deploy_k8s/sdk_server/deployment.yaml new file mode 100644 index 000000000..f99e67006 --- /dev/null +++ b/deploy_k8s/sdk_server/deployment.yaml @@ -0,0 +1,54 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: sdk-server-deployment +spec: + selector: + matchLabels: + app: sdk-server # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: sdk-server # 标签 + spec: + containers: + - name: sdk-server + image: openim/sdk_server:v2.1.0 + # imagePullPolicy: Always + ports: + - containerPort: 10003 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + - name: local-db + mountPath: /db/sdk + command: ["/Open-IM-Server/main"] + args: ["-openIM_api_port", "10002", "-openIM_ws_port", "10001", "-sdk_ws_port", "10003", "-openIM_log_level", "6"] + volumes: + - name: config + configMap: + name: openim-config + - name: local-db + hostPath: + path: /db/sdk + strategy: #更新策略 + type: RollingUpdate # 滚动更新 +--- +apiVersion: v1 +kind: Service +metadata: + name: sdk-server +spec: + ports: + - name: sdk-server-port + protocol: TCP + port: 10003 + targetPort: 10003 + selector: + app: sdk-server + type: NodePort + + \ No newline at end of file diff --git a/deploy_k8s/sdk_server/sdk_server.Dockerfile b/deploy_k8s/sdk_server/sdk_server.Dockerfile new file mode 100644 index 000000000..9a6eaf8fe --- /dev/null +++ b/deploy_k8s/sdk_server/sdk_server.Dockerfile @@ -0,0 +1,18 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_sdk_server $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"] + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/deploy_k8s/statistics/deployment.yaml b/deploy_k8s/statistics/deployment.yaml new file mode 100644 index 000000000..d7cc5e15b --- /dev/null +++ b/deploy_k8s/statistics/deployment.yaml @@ -0,0 +1,31 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: statistics-deployment +spec: + selector: + matchLabels: + app: statistics # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: statistics # 标签 + spec: + containers: + - name: statistics + image: openim/statistics:v2.1.0 + # imagePullPolicy: Always + ports: + - containerPort: 10180 + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 diff --git a/deploy_k8s/statistics/statistics.Dockerfile b/deploy_k8s/statistics/statistics.Dockerfile new file mode 100644 index 000000000..e271aca29 --- /dev/null +++ b/deploy_k8s/statistics/statistics.Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_statistics $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/deploy_k8s/user/deployment.yaml b/deploy_k8s/user/deployment.yaml new file mode 100644 index 000000000..6473094f0 --- /dev/null +++ b/deploy_k8s/user/deployment.yaml @@ -0,0 +1,29 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: user-deployment +spec: + selector: + matchLabels: + app: user # 选择这个指定标签执行 + replicas: 1 # 运行pod数量 + template: + metadata: + labels: + app: user # 标签 + spec: + containers: + - name: user + image: openim/user:v2.1.0 + # imagePullPolicy: Always + volumeMounts: + - name: config + mountPath: /Open-IM-Server/config + readOnly: true + volumes: + - name: config + configMap: + name: openim-config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 diff --git a/deploy_k8s/user/user.Dockerfile b/deploy_k8s/user/user.Dockerfile new file mode 100644 index 000000000..813757d85 --- /dev/null +++ b/deploy_k8s/user/user.Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu + +# 设置固定的项目路径 +ENV WORKDIR /Open-IM-Server +ENV CMDDIR $WORKDIR/cmd +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_user $WORKDIR/cmd/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ + chmod +x $WORKDIR/cmd/main + +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] + + +WORKDIR $CMDDIR +CMD ./main \ No newline at end of file diff --git a/go.mod b/go.mod index c3dd5f1e8..5fefcb9d6 100644 --- a/go.mod +++ b/go.mod @@ -4,25 +4,22 @@ go 1.15 require ( github.com/Shopify/sarama v1.32.0 - github.com/Shopify/toxiproxy v2.1.4+incompatible // indirect github.com/alibabacloud-go/darabonba-openapi v0.1.11 github.com/alibabacloud-go/dysmsapi-20170525/v2 v2.0.8 github.com/alibabacloud-go/sts-20150401 v1.1.0 github.com/alibabacloud-go/tea v1.1.17 github.com/antonfisher/nested-logrus-formatter v1.3.0 github.com/bwmarrin/snowflake v0.3.0 - github.com/eapache/go-resiliency v1.2.0 // indirect - github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect - github.com/eapache/queue v1.1.0 // indirect github.com/fatih/structs v1.1.0 - github.com/garyburd/redigo v1.6.2 - github.com/gin-gonic/gin v1.7.0 - github.com/go-playground/validator/v10 v10.4.1 + github.com/gin-gonic/gin v1.8.1 + github.com/go-openapi/spec v0.20.6 // indirect + github.com/go-openapi/swag v0.21.1 // indirect + github.com/go-playground/validator/v10 v10.11.0 + github.com/go-redis/redis/v8 v8.11.5 github.com/go-sql-driver/mysql v1.6.0 // indirect github.com/gogo/protobuf v1.3.2 github.com/golang-jwt/jwt/v4 v4.1.0 github.com/golang/protobuf v1.5.2 - github.com/golang/snappy v0.0.4 // indirect github.com/gorilla/websocket v1.4.2 github.com/jinzhu/copier v0.3.4 github.com/jinzhu/gorm v1.9.16 @@ -36,24 +33,33 @@ require ( github.com/mitchellh/mapstructure v1.4.2 github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 github.com/olivere/elastic/v7 v7.0.23 - github.com/pierrec/lz4 v2.6.1+incompatible // indirect + github.com/pelletier/go-toml/v2 v2.0.2 // indirect github.com/pkg/errors v0.9.1 - github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 github.com/sirupsen/logrus v1.8.1 - github.com/stretchr/testify v1.7.0 + github.com/stretchr/testify v1.7.2 + github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe + github.com/swaggo/gin-swagger v1.5.0 + github.com/swaggo/swag v1.8.3 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.428 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.428 github.com/tencentyun/qcloud-cos-sts-sdk v0.0.0-20210325043845-84a0811633ca go.etcd.io/etcd/api/v3 v3.5.4 go.etcd.io/etcd/client/v3 v3.5.4 go.mongodb.org/mongo-driver v1.8.3 + golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb - golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd + golang.org/x/net v0.0.0-20220622184535-263ec571b305 + golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664 // indirect + golang.org/x/tools v0.1.11 // indirect google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 // indirect google.golang.org/grpc v1.45.0 - google.golang.org/protobuf v1.27.1 + google.golang.org/protobuf v1.28.0 gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df gopkg.in/ini.v1 v1.66.2 // indirect gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b + gopkg.in/yaml.v3 v3.0.1 ) + +replace github.com/Shopify/sarama => github.com/Shopify/sarama v1.29.0 diff --git a/go.sum b/go.sum index 59d70ead3..fea29fb1c 100644 --- a/go.sum +++ b/go.sum @@ -1,16 +1,17 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= +github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= -github.com/Shopify/sarama v1.19.0 h1:9oksLxC6uxVPHPVYUmq6xhr1BOF/hHobWH2UzO67z1s= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/sarama v1.32.0 h1:P+RUjEaRU0GMMbYexGMDyrMkLhbbBVUVISDywi+IlFU= -github.com/Shopify/sarama v1.32.0/go.mod h1:+EmJJKZWVT/faR9RcOxJerP+LId4iWdQPBGLy1Y1Njs= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/Shopify/sarama v1.29.0 h1:ARid8o8oieau9XrHI55f/L3EoRAhm9px6sonbD7yuUE= +github.com/Shopify/sarama v1.29.0/go.mod h1:2QpgD79wpdAESqNQMxNc0KYMkycd4slxGdV3TWSVqrU= github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/Shopify/toxiproxy/v2 v2.3.0 h1:62YkpiP4bzdhKMH+6uC5E95y608k3zDwdzuBMsnn3uQ= -github.com/Shopify/toxiproxy/v2 v2.3.0/go.mod h1:KvQTtB6RjCJY4zqNJn7C7JDFgsG5uoHYDirfUfpIm0c= +github.com/agiledragon/gomonkey/v2 v2.3.1/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -54,8 +55,14 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -75,6 +82,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM= github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.2.0 h1:v7g92e/KSN71Rq7vSThKaWIq68fL4YHvWyiUKorFR1Q= @@ -97,36 +106,61 @@ github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/frankban/quicktest v1.14.0 h1:+cqqvzZV87b4adx/5ayVOaYZ2CrvM4ejQvUdBzPPUss= -github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= -github.com/frankban/quicktest v1.14.2 h1:SPb1KFFmM+ybpEjPUhCCkZOM5xlovT5UbrMvWnXyBns= -github.com/frankban/quicktest v1.14.2/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= -github.com/garyburd/redigo v1.6.2 h1:yE/pwKCrbLpLpQICzYTeZ7JsTA/C53wFTJHaEtRqniM= -github.com/garyburd/redigo v1.6.2/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= +github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/gzip v0.0.5 h1:mhnVU32YnnBh2LPH2iqRqsA/eR7SAqRaD388jL2s/j0= +github.com/gin-contrib/gzip v0.0.5/go.mod h1:OPIK6HR0Um2vNmBUTlayD7qle4yVVRZT0PyhdUigrKk= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= -github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/spec v0.20.6 h1:ich1RQ3WDbfoeTqTAb+5EIxNmpKVJZWBNah9RAT0jIQ= +github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU= +github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= +github.com/go-playground/validator/v10 v10.11.0 h1:0W+xRM511GY47Yy3bZUbJVitCNg2BOGlCyvTqsp/xIw= +github.com/go-playground/validator/v10 v10.11.0/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= +github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= +github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= +github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -154,8 +188,8 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -164,18 +198,15 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI= @@ -186,6 +217,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= @@ -217,18 +250,18 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.14.4 h1:eijASRJcobkVtSt81Olfh7JX43osYLwy5krOJo6YEu4= -github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s= github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4= @@ -243,8 +276,9 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4= @@ -254,10 +288,14 @@ github.com/lestrrat-go/strftime v1.0.4/go.mod h1:E1nN3pCbtMSu1yjSVeyuRFVm/U0xoR7 github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= @@ -276,20 +314,44 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/olivere/elastic/v7 v7.0.23 h1:b7tjMogDMhf2CisGI+L02LXLVa0ZyE82Z15XfW1e8t8= github.com/olivere/elastic/v7 v7.0.23/go.mod h1:OuWmD2DiuYhddWegBKPWQuelVKBLrW0fa/VUYgxuGTY= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ= +github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= -github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= +github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= +github.com/pelletier/go-toml/v2 v2.0.2 h1:+jQXlF3scKIcSEKkdHzXhCTDLPFi5r1wnK6yPS+49Gw= +github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= +github.com/pierrec/lz4 v2.6.0+incompatible h1:Ix9yFKn1nSPBLFl/yZknTp8TU5G4Ps0JDmguYK6iH1A= +github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -316,8 +378,9 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqn github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 h1:mZHayPoR0lNmnHyvtYjDeq0zlVHn9K/ZXoy17ylucdo= github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5/go.mod h1:GEXHk5HgEKCvEIIrSpFI3ozzG5xOKA2DVlEX/gGnewM= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -342,33 +405,50 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe h1:K8pHPVoTgxFJt1lXuIzzOX7zZhZFldJQK/CgKx9BFIc= +github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w= +github.com/swaggo/gin-swagger v1.5.0 h1:hlLbxPj6qvbtX2wpbsZuOIlcnPRCUDGccA0zMKVNpME= +github.com/swaggo/gin-swagger v1.5.0/go.mod h1:3mKpZClKx7mnUGsiwJeEkNhnr1VHMkMaTAXIoFYUXrA= +github.com/swaggo/swag v1.8.1/go.mod h1:ugemnJsPZm/kRwFUnzBlbHRd0JY9zE1M4F+uy2pAaPQ= +github.com/swaggo/swag v1.8.3 h1:3pZSSCQ//gAH88lfmxM3Cd1+JCsxV8Md6f36b9hrZ5s= +github.com/swaggo/swag v1.8.3/go.mod h1:jMLeXOOmYyjk8PvHTsXBdrubsNd9gUJTTCzL5iBnseg= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.428 h1:146Tg+UznuAJbNLZXo34QksEhCSj0m5+9qwdpViL1lU= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.428/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.428 h1:HPgQZFVh69foPdKzyFg7Zx8IA1IDrjAXOwALy+ueYv8= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.428/go.mod h1:Rso2ljUOZ0uwlIY6G8wL/hhPdj6iTcjYaLE7tbR48Fk= github.com/tencentyun/qcloud-cos-sts-sdk v0.0.0-20210325043845-84a0811633ca h1:G/aIr3WiUesWHL2YGYgEqjM5tCAJ43Ml+0C18wDkWWs= github.com/tencentyun/qcloud-cos-sts-sdk v0.0.0-20210325043845-84a0811633ca/go.mod h1:b18KQa4IxHbxeseW1GcZox53d7J0z39VNONTxvvlkXw= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tjfoc/gmsm v1.3.2 h1:7JVkAn5bvUJ7HtU08iW6UiD+UTmJTIToHCfeFzkcCxM= github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= +github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= +github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= -github.com/xdg-go/scram v1.1.0 h1:d70R37I0HrDLsafRrMBXyrD4lmQbCHE873t00Vr0gm0= -github.com/xdg-go/scram v1.1.0/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xdg/scram v1.0.3/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v1.0.3/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.30/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/etcd/api/v3 v3.5.4 h1:OHVyt3TopwtUQ2GKdd5wu3PmmipR4FTwCqoEjSyRdIc= go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4 h1:lrneYvz923dvC14R54XcA7FXoZ3mlGZAgmwhfm7HqOg= @@ -395,10 +475,12 @@ golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292 h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= +golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb h1:fqpd0EBDzlHRCjiphRR5Zo/RSWWQlWv34418dnEixWk= golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -410,9 +492,13 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -425,6 +511,7 @@ golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -432,9 +519,15 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= +golang.org/x/net v0.0.0-20210427231257-85d9c07bbe3a/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220622184535-263ec571b305 h1:dAgbJ2SP4jD6XYfMNLVj0BF21jo2PjChrtGaAvF5M3I= +golang.org/x/net v0.0.0-20220622184535-263ec571b305/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -450,11 +543,16 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cO golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -463,15 +561,23 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664 h1:wEZYwx+kK+KlZ0hpvP2Ls1Xr4+RWnlzGFwPP0aiDjIU= +golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -493,9 +599,14 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= +golang.org/x/tools v0.1.11 h1:loJ25fNOEhSXfHrpoGj91eCUThwdNX6u24rO1xnNteY= +golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -532,19 +643,20 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE= gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw= gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= @@ -553,6 +665,7 @@ gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -564,8 +677,12 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= + + diff --git a/internal/api/auth/auth.go b/internal/api/auth/auth.go index 59ad579ca..540e6cc92 100644 --- a/internal/api/auth/auth.go +++ b/internal/api/auth/auth.go @@ -16,6 +16,18 @@ import ( "strings" ) +// @Summary 用户注册 +// @Description 用户注册 +// @Tags 鉴权认证 +// @ID UserRegister +// @Accept json +// @Param token header string true "im token" +// @Param req body api.UserRegisterReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段
platform为平台ID
ex为拓展字段
gender为性别, 0为女, 1为男" +// @Produce json +// @Success 0 {object} api.UserRegisterResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /auth/user_register [post] func UserRegister(c *gin.Context) { params := api.UserRegisterReq{} if err := c.BindJSON(¶ms); err != nil { @@ -36,7 +48,13 @@ func UserRegister(c *gin.Context) { //copier.Copy(req.UserInfo, ¶ms) req.OperationID = params.OperationID log.NewInfo(req.OperationID, "UserRegister args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + " getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewAuthClient(etcdConn) reply, err := client.UserRegister(context.Background(), req) if err != nil { @@ -67,6 +85,18 @@ func UserRegister(c *gin.Context) { } +// @Summary 用户登录 +// @Description 获取用户的token +// @Tags 鉴权认证 +// @ID UserToken +// @Accept json +// @Param token header string true "im token" +// @Param req body api.UserTokenReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段
platform为平台ID" +// @Produce json +// @Success 0 {object} api.UserTokenResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /auth/user_token [post] func UserToken(c *gin.Context) { params := api.UserTokenReq{} if err := c.BindJSON(¶ms); err != nil { @@ -84,11 +114,17 @@ func UserToken(c *gin.Context) { } req := &rpc.UserTokenReq{Platform: params.Platform, FromUserID: params.UserID, OperationID: params.OperationID} log.NewInfo(req.OperationID, "UserToken args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + " getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewAuthClient(etcdConn) reply, err := client.UserToken(context.Background(), req) if err != nil { - errMsg := req.OperationID + " UserToken failed " + err.Error() + req.String() + errMsg := req.OperationID + " UserToken failed " + err.Error() + " req: " + req.String() log.NewError(req.OperationID, errMsg) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) return @@ -99,6 +135,18 @@ func UserToken(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 解析当前用户token +// @Description 解析当前用户token(token在请求头中传入) +// @Tags 鉴权认证 +// @ID ParseToken +// @Accept json +// @Param token header string true "im token" +// @Param req body api.ParseTokenReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段
platform为平台ID" +// @Produce json +// @Success 0 {object} api.ParseTokenResp{Data=api.ExpireTime} +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /auth/parse_token [post] func ParseToken(c *gin.Context) { params := api.ParseTokenReq{} if err := c.BindJSON(¶ms); err != nil { @@ -124,3 +172,58 @@ func ParseToken(c *gin.Context) { log.NewInfo(params.OperationID, "ParseToken return ", resp) c.JSON(http.StatusOK, resp) } + +// @Summary 强制登出 +// @Description 对应的平台强制登出 +// @Tags 鉴权认证 +// @ID ForceLogout +// @Accept json +// @Param token header string true "im token" +// @Param req body api.ForceLogoutReq true "platform为平台ID
fromUserID为要执行强制登出的用户ID" +// @Produce json +// @Success 0 {object} api.ForceLogoutResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /auth/force_logout [post] +func ForceLogout(c *gin.Context) { + params := api.ForceLogoutReq{} + if err := c.BindJSON(¶ms); err != nil { + errMsg := " BindJSON failed " + err.Error() + log.NewError("0", errMsg) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg}) + return + } + + req := &rpc.ForceLogoutReq{} + utils.CopyStructFields(req, ¶ms) + + var ok bool + var errInfo string + ok, req.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + log.NewInfo(req.OperationID, "ForceLogout args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + " getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewAuthClient(etcdConn) + reply, err := client.ForceLogout(context.Background(), req) + if err != nil { + errMsg := req.OperationID + " UserToken failed " + err.Error() + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + resp := api.ForceLogoutResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}} + log.NewInfo(params.OperationID, utils.GetSelfFuncName(), " return ", resp) + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/chat/del_msg.go b/internal/api/chat/del_msg.go index d883f095c..c6a6da385 100644 --- a/internal/api/chat/del_msg.go +++ b/internal/api/chat/del_msg.go @@ -5,8 +5,9 @@ import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" - pbChat "Open_IM/pkg/proto/chat" + rpc "Open_IM/pkg/proto/chat" pbCommon "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" @@ -15,6 +16,18 @@ import ( "strings" ) +// @Summary 根据seq列表删除消息 +// @Description 根据seq列表删除消息 +// @Tags 消息相关 +// @ID DelMsg +// @Accept json +// @Param token header string true "im token" +// @Param req body api.DelMsgReq true "userID为要删除的用户ID
seqList为seq列表" +// @Produce json +// @Success 0 {object} api.DelMsgResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /msg/del_msg [post] func DelMsg(c *gin.Context) { var ( req api.DelMsgReq @@ -29,8 +42,25 @@ func DelMsg(c *gin.Context) { if err := utils.CopyStructFields(&reqPb, &req); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields", err.Error()) } - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) - msgClient := pbChat.NewChatClient(grpcConn) + + var ok bool + var errInfo string + ok, reqPb.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, req.OperationID) + if grpcConn == nil { + errMsg := req.OperationID + " getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + msgClient := rpc.NewChatClient(grpcConn) respPb, err := msgClient.DelMsgList(context.Background(), &reqPb) if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsgList failed", err.Error(), reqPb) @@ -42,3 +72,59 @@ func DelMsg(c *gin.Context) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp) c.JSON(http.StatusOK, resp) } + +// @Summary 清空用户消息 +// @Description 清空用户消息 +// @Tags 消息相关 +// @ID ClearMsg +// @Accept json +// @Param token header string true "im token" +// @Param req body api.CleanUpMsgReq true "userID为要清空的用户ID" +// @Produce json +// @Success 0 {object} api.CleanUpMsgResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /msg/clear_msg [post] +func ClearMsg(c *gin.Context) { + params := api.CleanUpMsgReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + // + req := &rpc.ClearMsgReq{} + utils.CopyStructFields(req, ¶ms) + + var ok bool + var errInfo string + ok, req.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + " getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewChatClient(etcdConn) + RpcResp, err := client.ClearMsg(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, " CleanUpMsg failed ", err.Error(), req.String(), RpcResp.ErrMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": RpcResp.ErrMsg}) + return + } + + resp := api.CleanUpMsgResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api return ", resp) + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/chat/get_max_min_seq.go b/internal/api/chat/get_max_min_seq.go index 38379d4cc..410a6ffb0 100644 --- a/internal/api/chat/get_max_min_seq.go +++ b/internal/api/chat/get_max_min_seq.go @@ -5,7 +5,8 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" - pbMsg "Open_IM/pkg/proto/chat" + pbChat "Open_IM/pkg/proto/chat" + sdk_ws "Open_IM/pkg/proto/sdk_ws" "context" "github.com/gin-gonic/gin" "net/http" @@ -31,11 +32,18 @@ func GetSeq(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err" + err.Error()}) return } - pbData := pbMsg.GetMaxAndMinSeqReq{} + pbData := sdk_ws.GetMaxAndMinSeqReq{} pbData.UserID = params.SendID pbData.OperationID = params.OperationID - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) - msgClient := pbMsg.NewChatClient(grpcConn) + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, pbData.OperationID) + if grpcConn == nil { + errMsg := pbData.OperationID + " getcdv3.GetConn == nil" + log.NewError(pbData.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + msgClient := pbChat.NewChatClient(grpcConn) reply, err := msgClient.GetMaxAndMinSeq(context.Background(), &pbData) if err != nil { log.NewError(params.OperationID, "UserGetSeq rpc failed, ", params, err.Error()) diff --git a/internal/api/chat/pull_msg.go b/internal/api/chat/pull_msg.go index 787ae7141..3e1a2314f 100644 --- a/internal/api/chat/pull_msg.go +++ b/internal/api/chat/pull_msg.go @@ -51,7 +51,13 @@ func PullMsgBySeqList(c *gin.Context) { pbData.OperationID = params.OperationID pbData.SeqList = params.SeqList - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, pbData.OperationID) + if grpcConn == nil { + errMsg := pbData.OperationID + "getcdv3.GetConn == nil" + log.NewError(pbData.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } msgClient := pbChat.NewChatClient(grpcConn) reply, err := msgClient.PullMessageBySeqList(context.Background(), &pbData) if err != nil { diff --git a/internal/api/chat/send_msg.go b/internal/api/chat/send_msg.go index b75cd0ddd..af5bf5d7b 100644 --- a/internal/api/chat/send_msg.go +++ b/internal/api/chat/send_msg.go @@ -69,9 +69,15 @@ func SendMsg(c *gin.Context) { token := c.Request.Header.Get("token") log.NewInfo(params.OperationID, "api call success to sendMsgReq", params) pbData := newUserSendMsgReq(token, ¶ms) - log.Info("", "", "api SendMsg call start..., [data: %s]", pbData.String()) + log.Info(params.OperationID, "", "api SendMsg call start..., [data: %s]", pbData.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, params.OperationID) + if etcdConn == nil { + errMsg := params.OperationID + "getcdv3.GetConn == nil" + log.NewError(params.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbChat.NewChatClient(etcdConn) log.Info("", "", "api SendMsg call, api call rpc...") @@ -82,7 +88,7 @@ func SendMsg(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "SendMsg rpc failed, " + err.Error()}) return } - log.Info("", "", "api SendMsg call end..., [data: %s] [reply: %s]", pbData.String(), reply.String()) + log.Info(params.OperationID, "", "api SendMsg call end..., [data: %s] [reply: %s]", pbData.String(), reply.String()) c.JSON(http.StatusOK, gin.H{ "errCode": reply.ErrCode, diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index 2e1709847..2c26d4f0e 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -32,7 +32,13 @@ func SetConversation(c *gin.Context) { if err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.SetConversation(context.Background(), &reqPb) if err != nil { @@ -63,7 +69,13 @@ func ModifyConversationField(c *gin.Context) { if err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbConversation.NewConversationClient(etcdConn) respPb, err := client.ModifyConversationField(context.Background(), &reqPb) if err != nil { @@ -92,7 +104,13 @@ func BatchSetConversations(c *gin.Context) { if err := utils.CopyStructFields(&reqPb, req); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.BatchSetConversations(context.Background(), &reqPb) if err != nil { @@ -109,6 +127,18 @@ func BatchSetConversations(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 获取用户所有会话 +// @Description 获取用户所有会话 +// @Tags 会话相关 +// @ID GetAllConversations +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetAllConversationsReq true "ownerUserID为要获取的用户ID" +// @Produce json +// @Success 0 {object} api.GetAllConversationsResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /msg/get_all_conversations [post] func GetAllConversations(c *gin.Context) { var ( req api.GetAllConversationsReq @@ -124,7 +154,13 @@ func GetAllConversations(c *gin.Context) { if err := utils.CopyStructFields(&reqPb, req); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.GetAllConversations(context.Background(), &reqPb) if err != nil { @@ -141,6 +177,18 @@ func GetAllConversations(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 根据会话ID获取会话 +// @Description 根据会话ID获取会话 +// @Tags 会话相关 +// @ID GetConversation +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetConversationReq true "ownerUserID为要获取的用户ID
conversationID为要获取的会话ID" +// @Produce json +// @Success 0 {object} api.GetConversationResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /msg/get_conversation [post] func GetConversation(c *gin.Context) { var ( req api.GetConversationReq @@ -156,7 +204,13 @@ func GetConversation(c *gin.Context) { if err := utils.CopyStructFields(&reqPb, req); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.GetConversation(context.Background(), &reqPb) if err != nil { @@ -173,6 +227,18 @@ func GetConversation(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 根据会话ID列表获取会话 +// @Description 根据会话ID列表获取会话 +// @Tags 会话相关 +// @ID GetConversations +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetConversationsReq true "ownerUserID为要获取的用户ID
conversationIDs为要获取的会话ID列表" +// @Produce json +// @Success 0 {object} api.GetConversationsResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /msg/get_conversations [post] func GetConversations(c *gin.Context) { var ( req api.GetConversationsReq @@ -188,7 +254,13 @@ func GetConversations(c *gin.Context) { if err := utils.CopyStructFields(&reqPb, req); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.GetConversations(context.Background(), &reqPb) if err != nil { @@ -220,7 +292,13 @@ func SetRecvMsgOpt(c *gin.Context) { if err := utils.CopyStructFields(&reqPb, req); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.SetRecvMsgOpt(context.Background(), &reqPb) if err != nil { diff --git a/internal/api/friend/friend.go b/internal/api/friend/friend.go index 58cf37f7f..ac637275f 100644 --- a/internal/api/friend/friend.go +++ b/internal/api/friend/friend.go @@ -16,6 +16,18 @@ import ( "strings" ) +// @Summary 添加黑名单 +// @Description 添加黑名单 +// @Tags 好友相关 +// @ID AddBlack +// @Accept json +// @Param token header string true "im token" +// @Param req body api.AddBlacklistReq true "fromUserID为设置的用户
toUserID为被设置的用户" +// @Produce json +// @Success 0 {object} api.AddBlacklistResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/add_black [post] func AddBlack(c *gin.Context) { params := api.AddBlacklistReq{} if err := c.BindJSON(¶ms); err != nil { @@ -31,12 +43,12 @@ func AddBlack(c *gin.Context) { if !ok { errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.CommID.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(params.OperationID, "AddBlacklist args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.AddBlacklist(context.Background(), req) if err != nil { @@ -49,6 +61,18 @@ func AddBlack(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 批量加好友 +// @Description 批量加好友 +// @Tags 好友相关 +// @ID ImportFriend +// @Accept json +// @Param token header string true "im token" +// @Param req body api.ImportFriendReq true "fromUserID批量加好友的用户ID
friendUserIDList为" +// @Produce json +// @Success 0 {object} api.ImportFriendResp "data列表中对象的result-1为添加该用户失败
0为成功" +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/import_friend [post] func ImportFriend(c *gin.Context) { params := api.ImportFriendReq{} if err := c.BindJSON(¶ms); err != nil { @@ -64,13 +88,19 @@ func ImportFriend(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, "ImportFriend args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.ImportFriend(context.Background(), req) if err != nil { @@ -91,6 +121,18 @@ func ImportFriend(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 添加好友 +// @Description 添加好友 +// @Tags 好友相关 +// @ID AddFriend +// @Accept json +// @Param token header string true "im token" +// @Param req body api.AddFriendReq true "reqMsg为申请信息
fromUserID为申请用户
toUserID为被添加用户" +// @Produce json +// @Success 0 {object} api.AddFriendResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/add_friend [post] func AddFriend(c *gin.Context) { params := api.AddFriendReq{} if err := c.BindJSON(¶ms); err != nil { @@ -108,13 +150,19 @@ func AddFriend(c *gin.Context) { if !ok { errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.CommID.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg}) return } log.NewInfo(req.CommID.OperationID, "AddFriend args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.AddFriend(context.Background(), req) if err != nil { @@ -128,6 +176,18 @@ func AddFriend(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 同意/拒绝好友请求 +// @Description 同意/拒绝好友请求 +// @Tags 好友相关 +// @ID AddFriendResponse +// @Accept json +// @Param token header string true "im token" +// @Param req body api.AddFriendResponseReq true "fromUserID同意/拒绝的用户ID
toUserID为申请用户D
handleMsg为处理信息
flag为具体操作, 1为同意, 2为拒绝" +// @Produce json +// @Success 0 {object} api.AddFriendResponseResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/add_friend_response [post] func AddFriendResponse(c *gin.Context) { params := api.AddFriendResponseReq{} if err := c.BindJSON(¶ms); err != nil { @@ -146,14 +206,21 @@ func AddFriendResponse(c *gin.Context) { if !ok { errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.CommID.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg}) return } utils.CopyStructFields(req, ¶ms) log.NewInfo(req.CommID.OperationID, "AddFriendResponse args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.AddFriendResponse(context.Background(), req) if err != nil { @@ -167,6 +234,18 @@ func AddFriendResponse(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 删除好友 +// @Description 删除好友 +// @Tags 好友相关 +// @ID DeleteFriend +// @Accept json +// @Param token header string true "im token" +// @Param req body api.DeleteFriendReq true "fromUserID为操作用户
toUserID为被删除用户" +// @Produce json +// @Success 0 {object} api.DeleteFriendResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/delete_friend [post] func DeleteFriend(c *gin.Context) { params := api.DeleteFriendReq{} if err := c.BindJSON(¶ms); err != nil { @@ -183,13 +262,19 @@ func DeleteFriend(c *gin.Context) { if !ok { errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.CommID.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.CommID.OperationID, "DeleteFriend args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.DeleteFriend(context.Background(), req) if err != nil { @@ -203,6 +288,18 @@ func DeleteFriend(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 获取黑名单列表 +// @Description 获取黑名单列表 +// @Tags 好友相关 +// @ID GetBlacklist +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetBlackListReq true "fromUserID要获取黑名单的用户" +// @Produce json +// @Success 0 {object} api.GetBlackListResp{data=[]open_im_sdk.PublicUserInfo} +// @Failure 500 {object} api.Swagger400Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger500Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/get_black_list [post] func GetBlacklist(c *gin.Context) { params := api.GetBlackListReq{} if err := c.BindJSON(¶ms); err != nil { @@ -219,13 +316,19 @@ func GetBlacklist(c *gin.Context) { if !ok { errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.CommID.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.CommID.OperationID, "GetBlacklist args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.GetBlacklist(context.Background(), req) if err != nil { @@ -245,6 +348,18 @@ func GetBlacklist(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 设置好友备注 +// @Description 设置好友备注 +// @Tags 好友相关 +// @ID SetFriendRemark +// @Accept json +// @Param token header string true "im token" +// @Param req body api.SetFriendRemarkReq true "fromUserID为设置的用户
toUserID为被设置的用户
remark为好友备注" +// @Produce json +// @Success 0 {object} api.SetFriendRemarkResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/set_friend_remark [post] func SetFriendRemark(c *gin.Context) { params := api.SetFriendRemarkReq{} if err := c.BindJSON(¶ms); err != nil { @@ -262,13 +377,19 @@ func SetFriendRemark(c *gin.Context) { if !ok { errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.CommID.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.CommID.OperationID, "SetFriendComment args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.SetFriendRemark(context.Background(), req) if err != nil { @@ -282,6 +403,18 @@ func SetFriendRemark(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 把用户移除黑名单 +// @Description 把用户移除黑名单 +// @Tags 好友相关 +// @ID RemoveBlack +// @Accept json +// @Param token header string true "im token" +// @Param req body api.RemoveBlackListReq true "fromUserID要获取黑名单的用户" +// @Produce json +// @Success 0 {object} api.RemoveBlackListResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/remove_black [post] func RemoveBlack(c *gin.Context) { params := api.RemoveBlackListReq{} if err := c.BindJSON(¶ms); err != nil { @@ -298,12 +431,19 @@ func RemoveBlack(c *gin.Context) { if !ok { errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.CommID.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.CommID.OperationID, "RemoveBlacklist args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.RemoveBlacklist(context.Background(), req) if err != nil { @@ -316,6 +456,18 @@ func RemoveBlack(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 检查用户之间是否为好友 +// @Description 检查用户之间是否为好友 +// @Tags 好友相关 +// @ID IsFriend +// @Accept json +// @Param token header string true "im token" +// @Param req body api.IsFriendReq true "fromUserID为请求用户
toUserID为要检查的用户" +// @Produce json +// @Success 0 {object} api.IsFriendResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/is_friend [post] func IsFriend(c *gin.Context) { params := api.IsFriendReq{} if err := c.BindJSON(¶ms); err != nil { @@ -332,13 +484,19 @@ func IsFriend(c *gin.Context) { if !ok { errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.CommID.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg}) return } log.NewInfo(req.CommID.OperationID, "IsFriend args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.IsFriend(context.Background(), req) if err != nil { @@ -353,6 +511,18 @@ func IsFriend(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 获取用户的好友列表 +// @Description 获取用户的好友列表 +// @Tags 好友相关 +// @ID GetFriendList +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetFriendListReq true "fromUserID为要获取好友列表的用户ID" +// @Produce json +// @Success 0 {object} api.GetFriendListResp{data=[]open_im_sdk.FriendInfo} +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/get_friend_list [post] func GetFriendList(c *gin.Context) { params := api.GetFriendListReq{} if err := c.BindJSON(¶ms); err != nil { @@ -369,13 +539,19 @@ func GetFriendList(c *gin.Context) { if !ok { errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.CommID.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.CommID.OperationID, "GetFriendList args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.GetFriendList(context.Background(), req) if err != nil { @@ -391,6 +567,18 @@ func GetFriendList(c *gin.Context) { //c.JSON(http.StatusOK, resp) } +// @Summary 获取好友申请列表 +// @Description 删除好友 +// @Tags 好友相关 +// @ID GetFriendApplyList +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetFriendApplyListReq true "fromUserID为要获取申请列表的用户ID" +// @Produce json +// @Success 0 {object} api.GetFriendApplyListResp{data=[]open_im_sdk.FriendRequest} +// @Failure 500 {object} api.Swagger400Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/get_friend_apply_list [post] func GetFriendApplyList(c *gin.Context) { params := api.GetFriendApplyListReq{} if err := c.BindJSON(¶ms); err != nil { @@ -407,13 +595,19 @@ func GetFriendApplyList(c *gin.Context) { if !ok { errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.CommID.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.CommID.OperationID, "GetFriendApplyList args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.GetFriendApplyList(context.Background(), req) @@ -429,6 +623,18 @@ func GetFriendApplyList(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 获取自己的好友申请列表 +// @Description 获取自己的好友申请列表 +// @Tags 好友相关 +// @ID GetSelfFriendApplyList +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetSelfApplyListReq true "fromUserID为自己的用户ID" +// @Produce json +// @Success 0 {object} api.GetSelfApplyListResp{data=[]open_im_sdk.FriendRequest} +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/get_self_friend_apply_list [post] func GetSelfFriendApplyList(c *gin.Context) { params := api.GetSelfApplyListReq{} if err := c.BindJSON(¶ms); err != nil { @@ -445,13 +651,19 @@ func GetSelfFriendApplyList(c *gin.Context) { if !ok { errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.CommID.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.CommID.OperationID, "GetSelfApplyList args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.GetSelfApplyList(context.Background(), req) if err != nil { diff --git a/internal/api/group/group.go b/internal/api/group/group.go index 08ee1f274..e7696fb92 100644 --- a/internal/api/group/group.go +++ b/internal/api/group/group.go @@ -10,6 +10,7 @@ import ( open_im_sdk "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" + "github.com/golang/protobuf/ptypes/wrappers" "github.com/gin-gonic/gin" @@ -19,6 +20,18 @@ import ( jsonData "Open_IM/internal/utils" ) +// @Summary 把用户踢出群组 +// @Description 把用户踢出群组 +// @Tags 群组相关 +// @ID KickGroupMember +// @Accept json +// @Param token header string true "im token" +// @Param req body api.KickGroupMemberReq true "GroupID为要操作的群ID
kickedUserIDList为要踢出的群用户ID
reason为原因" +// @Produce json +// @Success 0 {object} api.KickGroupMemberResp "result为结果码, -1为失败, 0为成功" +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/kick_group [post] func KickGroupMember(c *gin.Context) { params := api.KickGroupMemberReq{} if err := c.BindJSON(¶ms); err != nil { @@ -36,13 +49,19 @@ func KickGroupMember(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, "KickGroupMember args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.KickGroupMember(context.Background(), req) if err != nil { @@ -65,6 +84,18 @@ func KickGroupMember(c *gin.Context) { c.JSON(http.StatusOK, memberListResp) } +// @Summary 获取群成员信息 +// @Description 获取群成员信息 +// @Tags 群组相关 +// @ID GetGroupMembersInfo +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetGroupMembersInfoReq true "groupID为要获取的群ID
memberList为要获取群成员的群ID列表" +// @Produce json +// @Success 0 {object} api.GetGroupMembersInfoResp{data=[]open_im_sdk.GroupMemberFullInfo} +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/get_group_members_info [post] func GetGroupMembersInfo(c *gin.Context) { params := api.GetGroupMembersInfoReq{} if err := c.BindJSON(¶ms); err != nil { @@ -81,13 +112,19 @@ func GetGroupMembersInfo(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, "GetGroupMembersInfo args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.GetGroupMembersInfo(context.Background(), req) @@ -119,13 +156,19 @@ func GetGroupMemberList(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, "GetGroupMemberList args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.GetGroupMemberList(context.Background(), req) @@ -142,6 +185,18 @@ func GetGroupMemberList(c *gin.Context) { c.JSON(http.StatusOK, memberListResp) } +// @Summary 获取全部群成员列表 +// @Description 获取全部群成员列表 +// @Tags 群组相关 +// @ID GetGroupAllMemberList +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetGroupAllMemberReq true "GroupID为要获取群成员的群ID" +// @Produce json +// @Success 0 {object} api.GetGroupAllMemberResp{data=[]open_im_sdk.GroupMemberFullInfo} +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/get_group_all_member_list [post] func GetGroupAllMemberList(c *gin.Context) { params := api.GetGroupAllMemberReq{} if err := c.BindJSON(¶ms); err != nil { @@ -158,13 +213,19 @@ func GetGroupAllMemberList(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, "GetGroupAllMember args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.GetGroupAllMember(context.Background(), req) if err != nil { @@ -179,6 +240,18 @@ func GetGroupAllMemberList(c *gin.Context) { c.JSON(http.StatusOK, memberListResp) } +// @Summary 获取用户加入群列表 +// @Description 获取用户加入群列表 +// @Tags 群组相关 +// @ID GetJoinedGroupList +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetJoinedGroupListReq true "fromUserID为要获取的用户ID" +// @Produce json +// @Success 0 {object} api.GetJoinedGroupListResp{data=[]open_im_sdk.GroupInfo} +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/get_joined_group_list [post] func GetJoinedGroupList(c *gin.Context) { params := api.GetJoinedGroupListReq{} if err := c.BindJSON(¶ms); err != nil { @@ -195,13 +268,19 @@ func GetJoinedGroupList(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, "GetJoinedGroupList args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.GetJoinedGroupList(context.Background(), req) if err != nil { @@ -216,6 +295,18 @@ func GetJoinedGroupList(c *gin.Context) { c.JSON(http.StatusOK, GroupListResp) } +// @Summary 将用户拉入群组 +// @Description 将用户拉入群组 +// @Tags 群组相关 +// @ID InviteUserToGroup +// @Accept json +// @Param token header string true "im token" +// @Param req body api.InviteUserToGroupReq true "groupID为要拉进的群组ID
invitedUserIDList为要获取群成员的群ID列表
reason为原因" +// @Produce json +// @Success 0 {object} api.InviteUserToGroupResp "result为结果码, -1为失败, 0为成功"" +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/invite_user_to_group [post] func InviteUserToGroup(c *gin.Context) { params := api.InviteUserToGroupReq{} if err := c.BindJSON(¶ms); err != nil { @@ -232,13 +323,19 @@ func InviteUserToGroup(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, "InviteUserToGroup args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.InviteUserToGroup(context.Background(), req) if err != nil { @@ -260,6 +357,18 @@ func InviteUserToGroup(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 创建群组 +// @Description 创建群组 +// @Tags 群组相关 +// @ID CreateGroup +// @Accept json +// @Param token header string true "im token" +// @Param req body api.CreateGroupReq true "groupType这里填0代表普通群
groupName为群名称
introduction为群介绍
notification为群公共
ownerUserID为群主ID
ex为群扩展字段
memberList中对象roleLevel为群员角色,1为普通用户 2为群主 3为管理员" +// @Produce json +// @Success 0 {object} api.CreateGroupResp{data=open_im_sdk.GroupInfo} +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/create_group [post] func CreateGroup(c *gin.Context) { params := api.CreateGroupReq{} if err := c.BindJSON(¶ms); err != nil { @@ -281,7 +390,7 @@ func CreateGroup(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg}) return } @@ -290,7 +399,13 @@ func CreateGroup(c *gin.Context) { log.NewInfo(req.OperationID, "CreateGroup args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.CreateGroup(context.Background(), req) if err != nil { @@ -308,7 +423,18 @@ func CreateGroup(c *gin.Context) { c.JSON(http.StatusOK, resp) } -// 群主或管理员收到的 +// @Summary 获取用户收到的加群信息列表 +// @Description 获取用户收到的加群信息列表 +// @Tags 群组相关 +// @ID GetRecvGroupApplicationList +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetGroupApplicationListReq true "fromUserID为要获取的用户ID" +// @Produce json +// @Success 0 {object} api.GetGroupApplicationListResp{data=[]open_im_sdk.GroupRequest} +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/get_recv_group_applicationList [post] func GetRecvGroupApplicationList(c *gin.Context) { params := api.GetGroupApplicationListReq{} if err := c.BindJSON(¶ms); err != nil { @@ -318,16 +444,24 @@ func GetRecvGroupApplicationList(c *gin.Context) { } req := &rpc.GetGroupApplicationListReq{} utils.CopyStructFields(req, params) - //var ok bool - //ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) - //if !ok { - // log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) - // c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) - // return - //} + var ok bool + var errInfo string + ok, req.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg}) + return + } log.NewInfo(req.OperationID, "GetGroupApplicationList args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.GetGroupApplicationList(context.Background(), req) if err != nil { @@ -342,6 +476,18 @@ func GetRecvGroupApplicationList(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 获取用户加群申请列表 +// @Description 获取用户加群申请列表 +// @Tags 群组相关 +// @ID GetUserReqGroupApplicationList +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetUserReqGroupApplicationListReq true "userID为要获取的用户ID" +// @Produce json +// @Success 0 {object} api.GetGroupApplicationListResp{data=[]open_im_sdk.GroupRequest} +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/get_user_req_group_applicationList [post] func GetUserReqGroupApplicationList(c *gin.Context) { var params api.GetUserReqGroupApplicationListReq if err := c.BindJSON(¶ms); err != nil { @@ -351,14 +497,23 @@ func GetUserReqGroupApplicationList(c *gin.Context) { } req := &rpc.GetUserReqApplicationListReq{} utils.CopyStructFields(req, params) - //ok, req.OpUserID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) - //if !ok { - // log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) - // c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) - // return - //} + var ok bool + var errInfo string + ok, req.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg}) + return + } log.NewInfo(req.OperationID, "GetGroupsInfo args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.GetUserReqApplicationList(context.Background(), req) if err != nil { @@ -368,11 +523,23 @@ func GetUserReqGroupApplicationList(c *gin.Context) { } log.NewInfo(req.OperationID, RpcResp) resp := api.GetGroupApplicationListResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, GroupRequestList: RpcResp.GroupRequestList} - log.NewInfo(req.OperationID, "GetGroupApplicationList api return ", resp) resp.Data = jsonData.JsonDataList(resp.GroupRequestList) + log.NewInfo(req.OperationID, "GetGroupApplicationList api return ", resp) c.JSON(http.StatusOK, resp) } +// @Summary 通过群ID列表获取群信息 +// @Description 通过群ID列表获取群信息 +// @Tags 群组相关 +// @ID GetGroupsInfo +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetGroupInfoReq true "groupIDList为群ID列表" +// @Produce json +// @Success 0 {object} api.GetGroupInfoResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/get_groups_info [post] func GetGroupsInfo(c *gin.Context) { params := api.GetGroupInfoReq{} if err := c.BindJSON(¶ms); err != nil { @@ -389,12 +556,18 @@ func GetGroupsInfo(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, "GetGroupsInfo args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.GetGroupsInfo(context.Background(), req) if err != nil { @@ -409,7 +582,33 @@ func GetGroupsInfo(c *gin.Context) { c.JSON(http.StatusOK, resp) } +//func transferGroupInfo(input []*open_im_sdk.GroupInfo) []*api.GroupInfoAlias { +// var result []*api.GroupInfoAlias +// for _, v := range input { +// t := &api.GroupInfoAlias{} +// utils.CopyStructFields(t, &v) +// if v.NeedVerification != nil { +// t.NeedVerification = v.NeedVerification.Value +// } +// result = append(result, t) +// } +// return result +//} + //process application + +// @Summary 处理加群消息 +// @Description 处理加群消息 +// @Tags 群组相关 +// @ID ApplicationGroupResponse +// @Accept json +// @Param token header string true "im token" +// @Param req body api.ApplicationGroupResponseReq true "groupID为要处理的群ID
fromUserID为要处理的用户ID
handleMsg为处理结果信息
handleResult为处理结果 1为同意加群 2为拒绝加群" +// @Produce json +// @Success 0 {object} api.ApplicationGroupResponseResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/group_application_response [post] func ApplicationGroupResponse(c *gin.Context) { params := api.ApplicationGroupResponseReq{} if err := c.BindJSON(¶ms); err != nil { @@ -426,13 +625,19 @@ func ApplicationGroupResponse(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, "ApplicationGroupResponse args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.GroupApplicationResponse(context.Background(), req) if err != nil { @@ -446,6 +651,18 @@ func ApplicationGroupResponse(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 加入群聊 +// @Description 加入群聊 +// @Tags 群组相关 +// @ID JoinGroup +// @Accept json +// @Param token header string true "im token" +// @Param req body api.JoinGroupReq true "reqMessage为申请进群信息
groupID为申请的群ID" +// @Produce json +// @Success 0 {object} api.JoinGroupResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/join_group [post] func JoinGroup(c *gin.Context) { params := api.JoinGroupReq{} if err := c.BindJSON(¶ms); err != nil { @@ -462,12 +679,18 @@ func JoinGroup(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, "JoinGroup args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.JoinGroup(context.Background(), req) @@ -481,6 +704,18 @@ func JoinGroup(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 当前用户退出群聊 +// @Description 当前用户退出群聊 +// @Tags 群组相关 +// @ID QuitGroup +// @Accept json +// @Param token header string true "im token" +// @Param req body api.QuitGroupReq true "groupID为要退出的群ID" +// @Produce json +// @Success 0 {object} api.QuitGroupResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/quit_group [post] func QuitGroup(c *gin.Context) { params := api.QuitGroupReq{} if err := c.BindJSON(¶ms); err != nil { @@ -497,13 +732,19 @@ func QuitGroup(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, "QuitGroup args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.QuitGroup(context.Background(), req) if err != nil { @@ -516,6 +757,18 @@ func QuitGroup(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 设置群信息 +// @Description 设置群信息 +// @Tags 群组相关 +// @ID SetGroupInfo +// @Accept json +// @Param token header string true "im token" +// @Param req body api.SetGroupInfoReq true "groupID为要修改的群ID
groupName为新的群名称
notification为群介绍
introduction为群公告
needVerification为加群验证 0为申请需要同意 邀请直接进 1为所有人进群需要验证,除了群主管理员邀请进群 2为直接进群" +// @Produce json +// @Success 0 {object} api.SetGroupInfoResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/set_group_info [post] func SetGroupInfo(c *gin.Context) { params := api.SetGroupInfoReq{} if err := c.BindJSON(¶ms); err != nil { @@ -523,23 +776,34 @@ func SetGroupInfo(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) return } - req := &rpc.SetGroupInfoReq{GroupInfo: &open_im_sdk.GroupInfo{}} - utils.CopyStructFields(req.GroupInfo, ¶ms) + req := &rpc.SetGroupInfoReq{GroupInfoForSet: &open_im_sdk.GroupInfoForSet{}} + utils.CopyStructFields(req.GroupInfoForSet, ¶ms) req.OperationID = params.OperationID + if params.NeedVerification != nil { + req.GroupInfoForSet.NeedVerification = &wrappers.Int32Value{Value: *params.NeedVerification} + log.NewInfo(req.OperationID, "NeedVerification ", req.GroupInfoForSet.NeedVerification) + } + var ok bool var errInfo string ok, req.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, "SetGroupInfo args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.SetGroupInfo(context.Background(), req) if err != nil { @@ -552,6 +816,18 @@ func SetGroupInfo(c *gin.Context) { log.NewInfo(req.OperationID, "SetGroupInfo api return ", resp) } +// @Summary 转让群主 +// @Description 转让群主 +// @Tags 群组相关 +// @ID TransferGroupOwner +// @Accept json +// @Param token header string true "im token" +// @Param req body api.TransferGroupOwnerReq true "GroupID为要操作的群ID
oldOwnerUserID为老群主ID
newOwnerUserID为新群主ID" +// @Produce json +// @Success 0 {object} api.TransferGroupOwnerResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/transfer_group [post] func TransferGroupOwner(c *gin.Context) { params := api.TransferGroupOwnerReq{} if err := c.BindJSON(¶ms); err != nil { @@ -568,13 +844,19 @@ func TransferGroupOwner(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, "TransferGroupOwner args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.TransferGroupOwner(context.Background(), req) if err != nil { @@ -588,6 +870,18 @@ func TransferGroupOwner(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 解散群组 +// @Description 解散群组 +// @Tags 群组相关 +// @ID DismissGroup +// @Accept json +// @Param token header string true "im token" +// @Param req body api.DismissGroupReq true "groupID为要解散的群组ID" +// @Produce json +// @Success 0 {object} api.DismissGroupResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/dismiss_group [post] func DismissGroup(c *gin.Context) { params := api.DismissGroupReq{} if err := c.BindJSON(¶ms); err != nil { @@ -604,13 +898,19 @@ func DismissGroup(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.DismissGroup(context.Background(), req) if err != nil { @@ -624,6 +924,18 @@ func DismissGroup(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 禁言群成员 +// @Description 禁言群成员 +// @Tags 群组相关 +// @ID MuteGroupMember +// @Accept json +// @Param token header string true "im token" +// @Param req body api.MuteGroupMemberReq true "groupID为群组ID
userID为要禁言的用户ID
mutedSeconds为禁言秒数" +// @Produce json +// @Success 0 {object} api.DismissGroupResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/mute_group_member [post] func MuteGroupMember(c *gin.Context) { params := api.MuteGroupMemberReq{} if err := c.BindJSON(¶ms); err != nil { @@ -640,13 +952,19 @@ func MuteGroupMember(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.MuteGroupMember(context.Background(), req) if err != nil { @@ -660,6 +978,18 @@ func MuteGroupMember(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 取消禁言群成员 +// @Description 取消禁言群成员 +// @Tags 群组相关 +// @ID CancelMuteGroupMember +// @Accept json +// @Param token header string true "im token" +// @Param req body api.CancelMuteGroupMemberReq true "groupID为群组ID
userID为要取消禁言的用户ID" +// @Produce json +// @Success 0 {object} api.CancelMuteGroupMemberResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/cancel_mute_group_member [post] func CancelMuteGroupMember(c *gin.Context) { params := api.CancelMuteGroupMemberReq{} if err := c.BindJSON(¶ms); err != nil { @@ -676,13 +1006,19 @@ func CancelMuteGroupMember(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.CancelMuteGroupMember(context.Background(), req) if err != nil { @@ -696,6 +1032,18 @@ func CancelMuteGroupMember(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 禁言群组 +// @Description 禁言群组 +// @Tags 群组相关 +// @ID MuteGroup +// @Accept json +// @Param token header string true "im token" +// @Param req body api.MuteGroupReq true "groupID为群组ID" +// @Produce json +// @Success 0 {object} api.MuteGroupResp +// @Failure 500 {object} api.MuteGroupResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.MuteGroupResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/mute_group [post] func MuteGroup(c *gin.Context) { params := api.MuteGroupReq{} if err := c.BindJSON(¶ms); err != nil { @@ -712,13 +1060,19 @@ func MuteGroup(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.MuteGroup(context.Background(), req) if err != nil { @@ -732,6 +1086,18 @@ func MuteGroup(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 取消禁言群组 +// @Description 取消禁言群组 +// @Tags 群组相关 +// @ID CancelMuteGroup +// @Accept json +// @Param token header string true "im token" +// @Param req body api.CancelMuteGroupReq true "groupID为群组ID" +// @Produce json +// @Success 0 {object} api.CancelMuteGroupResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/cancel_mute_group [post] func CancelMuteGroup(c *gin.Context) { params := api.CancelMuteGroupReq{} if err := c.BindJSON(¶ms); err != nil { @@ -748,13 +1114,19 @@ func CancelMuteGroup(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.CancelMuteGroup(context.Background(), req) if err != nil { @@ -786,13 +1158,19 @@ func SetGroupMemberNickname(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.SetGroupMemberNickname(context.Background(), req) if err != nil { @@ -806,6 +1184,74 @@ func SetGroupMemberNickname(c *gin.Context) { c.JSON(http.StatusOK, resp) } -func GetGroupMemberIDListFromCache(c *gin.Context) { +// @Summary 修改群成员信息 +// @Description 修改群成员信息 +// @Tags 群组相关 +// @ID SetGroupMemberInfo +// @Accept json +// @Param token header string true "im token" +// @Param req body api.SetGroupMemberInfoReq true "除了operationID, userID, groupID其他参数可选
ex为拓展字段
faceURL为群头像
nickName为群昵称
roleLevel为群员角色,1为普通用户 2为群主 3为管理员" +// @Produce json +// @Success 0 {object} api.SetGroupMemberInfoResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/set_group_member_info [post] +func SetGroupMemberInfo(c *gin.Context) { + var ( + req api.SetGroupMemberInfoReq + resp api.SetGroupMemberInfoResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req) + var opUserID string + ok, opUserID, errInfo := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + reqPb := &rpc.SetGroupMemberInfoReq{ + GroupID: req.GroupID, + UserID: req.UserID, + OperationID: req.OperationID, + OpUserID: opUserID, + } + if req.Nickname != nil { + reqPb.Nickname = &wrappers.StringValue{Value: *req.Nickname} + } + if req.FaceURL != nil { + reqPb.FaceURL = &wrappers.StringValue{Value: *req.FaceURL} + } + if req.Ex != nil { + reqPb.Ex = &wrappers.StringValue{Value: *req.Ex} + } + if req.RoleLevel != nil { + reqPb.RoleLevel = &wrappers.Int32Value{Value: *req.RoleLevel} + } + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewGroupClient(etcdConn) + respPb, err := client.SetGroupMemberInfo(context.Background(), reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), " failed ", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + resp.ErrMsg = respPb.CommonResp.ErrMsg + resp.ErrCode = respPb.CommonResp.ErrCode + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", resp) + c.JSON(http.StatusOK, resp) } diff --git a/internal/api/group/super_group.go b/internal/api/group/super_group.go new file mode 100644 index 000000000..30fdcbf0c --- /dev/null +++ b/internal/api/group/super_group.go @@ -0,0 +1,89 @@ +package group + +import ( + jsonData "Open_IM/internal/utils" + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + rpc "Open_IM/pkg/proto/group" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func GetJoinedSuperGroupList(c *gin.Context) { + req := api.GetJoinedSuperGroupListReq{} + if err := c.BindJSON(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, opUserID, errInfo := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + reqPb := rpc.GetJoinedSuperGroupListReq{OperationID: req.OperationID, OpUserID: opUserID, UserID: req.FromUserID} + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewGroupClient(etcdConn) + rpcResp, err := client.GetJoinedSuperGroupList(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, "InviteUserToGroup failed ", err.Error(), reqPb.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + GroupListResp := api.GetJoinedSuperGroupListResp{GetJoinedGroupListResp: api.GetJoinedGroupListResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}, GroupInfoList: rpcResp.GroupList}} + GroupListResp.Data = jsonData.JsonDataList(GroupListResp.GroupInfoList) + log.NewInfo(req.OperationID, "GetJoinedGroupList api return ", GroupListResp) + c.JSON(http.StatusOK, GroupListResp) +} + +func GetSuperGroupsInfo(c *gin.Context) { + req := api.GetSuperGroupsInfoReq{} + if err := c.BindJSON(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, opUserID, errInfo := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + reqPb := rpc.GetSuperGroupsInfoReq{OperationID: req.OperationID, OpUserID: opUserID, GroupIDList: req.GroupIDList} + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewGroupClient(etcdConn) + rpcResp, err := client.GetSuperGroupsInfo(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, "InviteUserToGroup failed ", err.Error(), reqPb.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + resp := api.GetSuperGroupsInfoResp{GetGroupInfoResp: api.GetGroupInfoResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}, GroupInfoList: rpcResp.GroupInfoList}} + resp.Data = jsonData.JsonDataList(resp.GroupInfoList) + log.NewInfo(req.OperationID, "GetGroupsInfo api return ", resp) + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/manage/management_chat.go b/internal/api/manage/management_chat.go index 5c62f9751..a70cbacf2 100644 --- a/internal/api/manage/management_chat.go +++ b/internal/api/manage/management_chat.go @@ -28,7 +28,7 @@ import ( var validate *validator.Validate -func newUserSendMsgReq(params *ManagementSendMsgReq) *pbChat.SendMsgReq { +func newUserSendMsgReq(params *api.ManagementSendMsgReq) *pbChat.SendMsgReq { var newContent string var err error switch params.ContentType { @@ -48,9 +48,8 @@ func newUserSendMsgReq(params *ManagementSendMsgReq) *pbChat.SendMsgReq { newContent = params.Content["revokeMsgClientID"].(string) default: } - var options map[string]bool + options := make(map[string]bool, 5) if params.IsOnlineOnly { - options = make(map[string]bool, 5) utils.SetSwitchFromOptions(options, constant.IsOfflinePush, false) utils.SetSwitchFromOptions(options, constant.IsHistory, false) utils.SetSwitchFromOptions(options, constant.IsPersistent, false) @@ -60,7 +59,6 @@ func newUserSendMsgReq(params *ManagementSendMsgReq) *pbChat.SendMsgReq { OperationID: params.OperationID, MsgData: &open_im_sdk.MsgData{ SendID: params.SendID, - RecvID: params.RecvID, GroupID: params.GroupID, ClientMsgID: utils.GetMsgID(params.SendID), SenderPlatformID: params.SenderPlatformID, @@ -70,6 +68,7 @@ func newUserSendMsgReq(params *ManagementSendMsgReq) *pbChat.SendMsgReq { MsgFrom: constant.SysMsgType, ContentType: params.ContentType, Content: []byte(newContent), + RecvID: params.RecvID, // ForceList: params.ForceList, CreateTime: utils.GetCurrentTimestampByMill(), Options: options, @@ -90,9 +89,23 @@ func init() { validate = validator.New() } +// @Summary 管理员发送/撤回消息 +// @Description 管理员发送/撤回消息 消息格式详细见
消息格式 +// @Tags 消息相关 +// @ID ManagementSendMsg +// @Accept json +// @Param token header string true "im token" +// @Param 管理员发送文字消息 body api.ManagementSendMsgReq{content=TextElem{}} true "该请求和消息结构体一样" +// @Param 管理员发送OA通知消息 body api.ManagementSendMsgReq{content=OANotificationElem{}} true "该请求和消息结构体一样" +// @Param 管理员撤回单聊消息 body api.ManagementSendMsgReq{content=RevokeElem{}} true "该请求和消息结构体一样" +// @Produce json +// @Success 0 {object} api.ManagementSendMsgResp "serverMsgID为服务器消息ID
clientMsgID为客户端消息ID
sendTime为发送消息时间" +// @Failure 500 {object} api.ManagementSendMsgResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.ManagementSendMsgResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /msg/manage_send_msg [post] func ManagementSendMsg(c *gin.Context) { var data interface{} - params := ManagementSendMsgReq{} + params := api.ManagementSendMsgReq{} if err := c.BindJSON(¶ms); err != nil { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) log.Error(c.PostForm("operationID"), "json unmarshal err", err.Error(), c.PostForm("content")) @@ -170,12 +183,18 @@ func ManagementSendMsg(c *gin.Context) { log.NewInfo(params.OperationID, "Ws call success to ManagementSendMsgReq", params) pbData := newUserSendMsgReq(¶ms) - log.Info(params.OperationID, "api ManagementSendMsg call start..., [data: %s]", pbData.String()) + log.Info(params.OperationID, "", "api ManagementSendMsg call start..., [data: %s]", pbData.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, params.OperationID) + if etcdConn == nil { + errMsg := params.OperationID + "getcdv3.GetConn == nil" + log.NewError(params.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbChat.NewChatClient(etcdConn) - log.Info(params.OperationID, "api ManagementSendMsg call, api call rpc...") + log.Info(params.OperationID, "", "api ManagementSendMsg call, api call rpc...") RpcResp, err := client.SendMsg(context.Background(), pbData) if err != nil { @@ -183,38 +202,126 @@ func ManagementSendMsg(c *gin.Context) { c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call UserSendMsg rpc server failed"}) return } - log.Info("", "", "api ManagementSendMsg call end..., [data: %s] [reply: %s]", pbData.String(), RpcResp.String()) + log.Info(params.OperationID, "", "api ManagementSendMsg call end..., [data: %s] [reply: %s]", pbData.String(), RpcResp.String()) resp := api.ManagementSendMsgResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, ResultList: server_api_params.UserSendMsgResp{ServerMsgID: RpcResp.ServerMsgID, ClientMsgID: RpcResp.ClientMsgID, SendTime: RpcResp.SendTime}} log.Info(params.OperationID, "ManagementSendMsg return", resp) c.JSON(http.StatusOK, resp) - } -// -//type MergeElem struct { -// Title string `json:"title"` -// AbstractList []string `json:"abstractList"` -// MultiMessage []*MsgStruct `json:"multiMessage"` -//} -// -//type QuoteElem struct { -// Text string `json:"text"` -// QuoteMessage *MsgStruct `json:"quoteMessage"` -//} -type ManagementSendMsgReq struct { - OperationID string `json:"operationID" binding:"required"` - SendID string `json:"sendID" binding:"required"` - RecvID string `json:"recvID" ` - GroupID string `json:"groupID" ` - SenderNickname string `json:"senderNickname" ` - SenderFaceURL string `json:"senderFaceURL" ` - SenderPlatformID int32 `json:"senderPlatformID"` - ForceList []string `json:"forceList" ` - Content map[string]interface{} `json:"content" binding:"required"` - ContentType int32 `json:"contentType" binding:"required"` - SessionType int32 `json:"sessionType" binding:"required"` - IsOnlineOnly bool `json:"isOnlineOnly"` - OfflinePushInfo *open_im_sdk.OfflinePushInfo `json:"offlinePushInfo"` +// @Summary 管理员批量发送群聊单聊消息 +// @Description 管理员批量发送群聊单聊消息 消息格式详细见
消息格式 +// @Tags 消息相关 +// @ID ManagementBatchSendMsg +// @Accept json +// @Param token header string true "im token" +// @Param 管理员批量发送单聊消息 body api.ManagementBatchSendMsgReq{content=TextElem{}} true "该请求和消息结构体一样
recvIDList为接受消息的用户ID列表" +// @Param 管理员批量发送OA通知 body api.ManagementSendMsgReq{content=OANotificationElem{}} true "该请求和消息结构体一样
recvIDList为接受消息的用户ID列表" +// @Produce json +// @Success 0 {object} api.ManagementBatchSendMsgReq "serverMsgID为服务器消息ID
clientMsgID为客户端消息ID
sendTime为发送消息时间" +// @Failure 500 {object} api.ManagementBatchSendMsgReq "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.ManagementBatchSendMsgReq "errCode为400 一般为参数输入错误, token未带上等" +// @Router /msg/batch_send_msg [post] +func ManagementBatchSendMsg(c *gin.Context) { + var data interface{} + params := api.ManagementBatchSendMsgReq{} + resp := api.ManagementBatchSendMsgResp{} + resp.Data.FailedIDList = make([]string, 0) + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + log.Error(c.PostForm("operationID"), "json unmarshal err", err.Error(), c.PostForm("content")) + return + } + switch params.ContentType { + case constant.Text: + data = TextElem{} + case constant.Picture: + data = PictureElem{} + case constant.Voice: + data = SoundElem{} + case constant.Video: + data = VideoElem{} + case constant.File: + data = FileElem{} + //case constant.AtText: + // data = AtElem{} + //case constant.Merger: + // data = + //case constant.Card: + //case constant.Location: + case constant.Custom: + data = CustomElem{} + case constant.Revoke: + data = RevokeElem{} + case constant.OANotification: + data = OANotificationElem{} + params.SessionType = constant.NotificationChatType + //case constant.HasReadReceipt: + //case constant.Typing: + //case constant.Quote: + default: + c.JSON(http.StatusBadRequest, gin.H{"errCode": 404, "errMsg": "contentType err"}) + log.Error(c.PostForm("operationID"), "contentType err", c.PostForm("content")) + return + } + if err := mapstructure.WeakDecode(params.Content, &data); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": err.Error()}) + log.Error(c.PostForm("operationID"), "content to Data struct err", err.Error()) + return + } else if err := validate.Struct(data); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 403, "errMsg": err.Error()}) + log.Error(c.PostForm("operationID"), "data args validate err", err.Error()) + return + } + log.NewInfo(params.OperationID, data, params) + token := c.Request.Header.Get("token") + claims, err := token_verify.ParseToken(token, params.OperationID) + if err != nil { + log.NewError(params.OperationID, "parse token failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "parse token failed", "sendTime": 0, "MsgID": ""}) + return + } + if !utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "not authorized", "sendTime": 0, "MsgID": ""}) + return + + } + log.NewInfo(params.OperationID, "Ws call success to ManagementSendMsgReq", params) + for _, recvID := range params.RecvIDList { + req := &api.ManagementSendMsgReq{ + ManagementSendMsg: params.ManagementSendMsg, + RecvID: recvID, + } + pbData := newUserSendMsgReq(req) + pbData.MsgData.RecvID = recvID + log.Info(params.OperationID, "", "api ManagementSendMsg call start..., ", pbData.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, params.OperationID) + if etcdConn == nil { + errMsg := params.OperationID + "getcdv3.GetConn == nil" + log.NewError(params.OperationID, errMsg) + resp.Data.FailedIDList = append(resp.Data.FailedIDList, recvID) + continue + } + client := pbChat.NewChatClient(etcdConn) + rpcResp, err := client.SendMsg(context.Background(), pbData) + if err != nil { + log.NewError(params.OperationID, "call delete UserSendMsg rpc server failed", err.Error()) + resp.Data.FailedIDList = append(resp.Data.FailedIDList, recvID) + continue + } + if rpcResp.ErrCode != 0 { + log.NewError(params.OperationID, utils.GetSelfFuncName(), "rpc failed", pbData, rpcResp) + resp.Data.FailedIDList = append(resp.Data.FailedIDList, recvID) + continue + } + resp.Data.ResultList = append(resp.Data.ResultList, server_api_params.UserSendMsgResp{ + ServerMsgID: rpcResp.ServerMsgID, + ClientMsgID: rpcResp.ClientMsgID, + SendTime: rpcResp.SendTime, + }) + } + + log.NewInfo(params.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) } type PictureBaseInfo struct { @@ -283,15 +390,15 @@ type RevokeElem struct { RevokeMsgClientID string `mapstructure:"revokeMsgClientID" validate:"required"` } type OANotificationElem struct { - NotificationName string `mapstructure:"notificationName" validate:"required"` - NotificationFaceURL string `mapstructure:"notificationFaceURL" validate:"required"` - NotificationType int32 `mapstructure:"notificationType" validate:"required"` - Text string `mapstructure:"text" validate:"required"` - Url string `mapstructure:"url"` - MixType int32 `mapstructure:"mixType"` - PictureElem PictureElem `mapstructure:"pictureElem"` - SoundElem SoundElem `mapstructure:"soundElem"` - VideoElem VideoElem `mapstructure:"videoElem"` - FileElem FileElem `mapstructure:"fileElem"` - Ex string `mapstructure:"ex"` + NotificationName string `mapstructure:"notificationName" json:"notificationName" validate:"required"` + NotificationFaceURL string `mapstructure:"notificationFaceURL" json:"notificationFaceURL" validate:"required"` + NotificationType int32 `mapstructure:"notificationType" json:"notificationType" validate:"required"` + Text string `mapstructure:"text" json:"text" validate:"required"` + Url string `mapstructure:"url" json:"url"` + MixType int32 `mapstructure:"mixType" json:"mixType"` + PictureElem PictureElem `mapstructure:"pictureElem" json:"pictureElem"` + SoundElem SoundElem `mapstructure:"soundElem" json:"soundElem"` + VideoElem VideoElem `mapstructure:"videoElem" json:"videoElem"` + FileElem FileElem `mapstructure:"fileElem" json:"fileElem"` + Ex string `mapstructure:"ex" json:"ex"` } diff --git a/internal/api/manage/management_user.go b/internal/api/manage/management_user.go index 6fc9d161d..3d2c89a65 100644 --- a/internal/api/manage/management_user.go +++ b/internal/api/manage/management_user.go @@ -42,7 +42,13 @@ func DeleteUser(c *gin.Context) { } log.NewInfo(params.OperationID, "DeleteUser args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewUserClient(etcdConn) RpcResp, err := client.DeleteUsers(context.Background(), req) @@ -58,6 +64,19 @@ func DeleteUser(c *gin.Context) { log.NewInfo(req.OperationID, "DeleteUser api return", resp) c.JSON(http.StatusOK, resp) } + +// @Summary 获取所有用户uid列表 +// @Description 获取所有用户uid列表 +// @Tags 用户相关 +// @ID GetAllUsersUid +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetAllUsersUidReq true "请求体" +// @Produce json +// @Success 0 {object} api.GetAllUsersUidResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /user/get_all_users_uid [post] func GetAllUsersUid(c *gin.Context) { params := api.GetAllUsersUidReq{} if err := c.BindJSON(¶ms); err != nil { @@ -73,12 +92,18 @@ func GetAllUsersUid(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(params.OperationID, "GetAllUsersUid args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewUserClient(etcdConn) RpcResp, err := client.GetAllUserID(context.Background(), req) if err != nil { @@ -94,6 +119,19 @@ func GetAllUsersUid(c *gin.Context) { c.JSON(http.StatusOK, resp) } + +// @Summary 检查列表账户注册状态,并且返回结果 +// @Description 传入UserIDList检查列表账户注册状态,并且返回结果 +// @Tags 用户相关 +// @ID AccountCheck +// @Accept json +// @Param token header string true "im token" +// @Param req body api.AccountCheckReq true "请求体" +// @Produce json +// @Success 0 {object} api.AccountCheckResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /user/account_check [post] func AccountCheck(c *gin.Context) { params := api.AccountCheckReq{} if err := c.BindJSON(¶ms); err != nil { @@ -109,12 +147,18 @@ func AccountCheck(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(params.OperationID, "AccountCheck args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewUserClient(etcdConn) RpcResp, err := client.AccountCheck(context.Background(), req) diff --git a/internal/api/office/tag.go b/internal/api/office/tag.go index 630517593..c64e736cd 100644 --- a/internal/api/office/tag.go +++ b/internal/api/office/tag.go @@ -1,7 +1,7 @@ package office import ( - apistruct "Open_IM/pkg/base_info" + api "Open_IM/pkg/base_info" "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/common/token_verify" @@ -11,14 +11,27 @@ import ( "Open_IM/pkg/utils" "context" "github.com/gin-gonic/gin" + "google.golang.org/grpc" "net/http" "strings" ) +// @Summary 获取用户标签信息 +// @Description 用户获取自己的所有的标签 +// @Tags 标签 +// @ID GetUserTags +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetUserTagsReq true "请求" +// @Produce json +// @Success 0 {object} api.GetUserTagsResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/get_user_tags [post] func GetUserTags(c *gin.Context) { var ( - req apistruct.GetUserTagsReq - resp apistruct.GetUserTagsResp + req api.GetUserTagsReq + resp api.GetUserTagsResp reqPb pbOffice.GetUserTagsReq respPb *pbOffice.GetUserTagsResp ) @@ -35,13 +48,19 @@ func GetUserTags(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } reqPb.UserID = userID reqPb.OperationID = req.OperationID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.GetUserTags(context.Background(), &reqPb) if err != nil { @@ -60,10 +79,22 @@ func GetUserTags(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 创建标签 +// @Description 创建标签 +// @Tags 标签 +// @ID CreateTag +// @Accept json +// @Param token header string true "im token" +// @Param req body api.CreateTagReq true "请求" +// @Produce json +// @Success 0 {object} api.CreateTagResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/create_tag [post] func CreateTag(c *gin.Context) { var ( - req apistruct.CreateTagReq - resp apistruct.CreateTagResp + req api.CreateTagReq + resp api.CreateTagResp reqPb pbOffice.CreateTagReq respPb *pbOffice.CreateTagResp ) @@ -83,12 +114,18 @@ func CreateTag(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } reqPb.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.CreateTag(context.Background(), &reqPb) if err != nil { @@ -102,10 +139,22 @@ func CreateTag(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 删除标签 +// @Description 根据标签ID创建标签 +// @Tags 标签 +// @ID DeleteTag +// @Accept json +// @Param token header string true "im token" +// @Param req body api.DeleteTagReq true "请求" +// @Produce json +// @Success 0 {object} api.DeleteTagResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/delete_tag [post] func DeleteTag(c *gin.Context) { var ( - req apistruct.DeleteTagReq - resp apistruct.DeleteTagResp + req api.DeleteTagReq + resp api.DeleteTagResp reqPb pbOffice.DeleteTagReq respPb *pbOffice.DeleteTagResp ) @@ -125,12 +174,18 @@ func DeleteTag(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } reqPb.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.DeleteTag(context.Background(), &reqPb) if err != nil { @@ -144,10 +199,22 @@ func DeleteTag(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 修改标签 +// @Description 根据标签ID修改标签用户列表, 名称 +// @Tags 标签 +// @ID SetTag +// @Accept json +// @Param token header string true "im token" +// @Param req body api.SetTagReq true "请求" +// @Produce json +// @Success 0 {object} api.SetTagResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/set_tag [post] func SetTag(c *gin.Context) { var ( - req apistruct.SetTagReq - resp apistruct.SetTagResp + req api.SetTagReq + resp api.SetTagResp reqPb pbOffice.SetTagReq respPb *pbOffice.SetTagResp ) @@ -172,7 +239,13 @@ func SetTag(c *gin.Context) { } reqPb.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.SetTag(context.Background(), &reqPb) if err != nil { @@ -186,10 +259,22 @@ func SetTag(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 发送标签消息 +// @Description 对标签用户发送消息 +// @Tags 标签 +// @ID SendMsg2Tag +// @Accept json +// @Param token header string true "im token" +// @Param req body api.SendMsg2TagReq true "请求" +// @Produce json +// @Success 0 {object} api.SendMsg2TagResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/send_msg_to_tag [post] func SendMsg2Tag(c *gin.Context) { var ( - req apistruct.SendMsg2TagReq - resp apistruct.SendMsg2TagResp + req api.SendMsg2TagReq + resp api.SendMsg2TagResp reqPb pbOffice.SendMsg2TagReq respPb *pbOffice.SendMsg2TagResp ) @@ -209,12 +294,18 @@ func SendMsg2Tag(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } reqPb.SendID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.SendMsg2Tag(context.Background(), &reqPb) if err != nil { @@ -228,10 +319,22 @@ func SendMsg2Tag(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 获取发送历史记录 +// @Description 分页获取发送历史记录 +// @Tags 标签 +// @ID GetTagSendLogs +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetTagSendLogsReq true "请求" +// @Produce json +// @Success 0 {object} api.GetTagSendLogsResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/get_send_tag_log [post] func GetTagSendLogs(c *gin.Context) { var ( - req apistruct.GetTagSendLogsReq - resp apistruct.GetTagSendLogsResp + req api.GetTagSendLogsReq + resp api.GetTagSendLogsResp reqPb pbOffice.GetTagSendLogsReq respPb *pbOffice.GetTagSendLogsResp ) @@ -248,7 +351,7 @@ func GetTagSendLogs(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } @@ -258,12 +361,19 @@ func GetTagSendLogs(c *gin.Context) { PageNumber: req.PageNumber, ShowNumber: req.ShowNumber, } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) - respPb, err := client.GetTagSendLogs(context.Background(), &reqPb) + maxSizeOption := grpc.MaxCallRecvMsgSize(1024 * 1024 * 20) + respPb, err := client.GetTagSendLogs(context.Background(), &reqPb, maxSizeOption) if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTags failed", err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateTag rpc server failed" + err.Error()}) + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetTagSendLogs failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetTagSendLogs rpc server failed" + err.Error()}) return } if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil { @@ -279,10 +389,22 @@ func GetTagSendLogs(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 获取该用户的标签信息 +// @Description 通过标签id获取该用户的标签信息 +// @Tags 标签 +// @ID GetUserTagByID +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetUserTagByIDReq true "请求" +// @Produce json +// @Success 0 {object} api.GetUserTagByIDResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/get_user_tag_by_id [post] func GetUserTagByID(c *gin.Context) { var ( - req apistruct.GetUserTagByIDReq - resp apistruct.GetUserTagByIDResp + req api.GetUserTagByIDReq + resp api.GetUserTagByIDResp reqPb pbOffice.GetUserTagByIDReq respPb *pbOffice.GetUserTagByIDResp ) @@ -299,14 +421,20 @@ func GetUserTagByID(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } reqPb.UserID = userID reqPb.OperationID = req.OperationID reqPb.TagID = req.TagID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.GetUserTagByID(context.Background(), &reqPb) if err != nil { diff --git a/internal/api/office/work_moments.go b/internal/api/office/work_moments.go index 82716a4f8..0c37f5b1d 100644 --- a/internal/api/office/work_moments.go +++ b/internal/api/office/work_moments.go @@ -1,7 +1,7 @@ package office import ( - apiStruct "Open_IM/pkg/base_info" + api "Open_IM/pkg/base_info" "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/common/token_verify" @@ -15,10 +15,22 @@ import ( "strings" ) +// @Summary 创建一条工作圈 +// @Description 用户创建一条工作圈 +// @Tags 工作圈 +// @ID CreateOneWorkMoment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.CreateOneWorkMomentReq true "请求 atUserList likeUserList permissionGroupList permissionUserList 字段中userName可以不填" +// @Produce json +// @Success 0 {object} api.CreateOneWorkMomentResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/create_one_work_moment [post] func CreateOneWorkMoment(c *gin.Context) { var ( - req apiStruct.CreateOneWorkMomentReq - resp apiStruct.CreateOneWorkMomentResp + req api.CreateOneWorkMomentReq + resp api.CreateOneWorkMomentResp reqPb pbOffice.CreateOneWorkMomentReq respPb *pbOffice.CreateOneWorkMomentResp ) @@ -36,7 +48,7 @@ func CreateOneWorkMoment(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } @@ -44,7 +56,14 @@ func CreateOneWorkMoment(c *gin.Context) { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } reqPb.WorkMoment.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.CreateOneWorkMoment(context.Background(), &reqPb) if err != nil { @@ -52,7 +71,7 @@ func CreateOneWorkMoment(c *gin.Context) { c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateOneWorkMoment rpc server failed" + err.Error()}) return } - resp.CommResp = apiStruct.CommResp{ + resp.CommResp = api.CommResp{ ErrCode: respPb.CommonResp.ErrCode, ErrMsg: respPb.CommonResp.ErrMsg, } @@ -60,10 +79,22 @@ func CreateOneWorkMoment(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 删除一条工作圈 +// @Description 根据用户工作圈ID删除一条工作圈 +// @Tags 工作圈 +// @ID DeleteOneWorkMoment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.DeleteOneWorkMomentReq true "请求" +// @Produce json +// @Success 0 {object} api.DeleteOneWorkMomentResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/delete_one_work_moment [post] func DeleteOneWorkMoment(c *gin.Context) { var ( - req apiStruct.DeleteOneWorkMomentReq - resp apiStruct.DeleteOneWorkMomentResp + req api.DeleteOneWorkMomentReq + resp api.DeleteOneWorkMomentResp reqPb pbOffice.DeleteOneWorkMomentReq respPb *pbOffice.DeleteOneWorkMomentResp ) @@ -81,7 +112,7 @@ func DeleteOneWorkMoment(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } @@ -89,7 +120,14 @@ func DeleteOneWorkMoment(c *gin.Context) { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } reqPb.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.DeleteOneWorkMoment(context.Background(), &reqPb) if err != nil { @@ -104,10 +142,22 @@ func DeleteOneWorkMoment(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 点赞一条工作圈 +// @Description 工作圈ID点赞一条工作圈 +// @Tags 工作圈 +// @ID LikeOneWorkMoment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.LikeOneWorkMomentReq true "请求" +// @Produce json +// @Success 0 {object} api.LikeOneWorkMomentResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/like_one_work_moment [post] func LikeOneWorkMoment(c *gin.Context) { var ( - req apiStruct.LikeOneWorkMomentReq - resp apiStruct.LikeOneWorkMomentResp + req api.LikeOneWorkMomentReq + resp api.LikeOneWorkMomentResp reqPb pbOffice.LikeOneWorkMomentReq respPb *pbOffice.LikeOneWorkMomentResp ) @@ -133,7 +183,13 @@ func LikeOneWorkMoment(c *gin.Context) { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } reqPb.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.LikeOneWorkMoment(context.Background(), &reqPb) if err != nil { @@ -148,10 +204,22 @@ func LikeOneWorkMoment(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 评论一条工作圈 +// @Description 评论一条工作圈 +// @Tags 工作圈 +// @ID CommentOneWorkMoment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.CommentOneWorkMomentReq true "请求" +// @Produce json +// @Success 0 {object} api.CommentOneWorkMomentResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/comment_one_work_moment [post] func CommentOneWorkMoment(c *gin.Context) { var ( - req apiStruct.CommentOneWorkMomentReq - resp apiStruct.CommentOneWorkMomentResp + req api.CommentOneWorkMomentReq + resp api.CommentOneWorkMomentResp reqPb pbOffice.CommentOneWorkMomentReq respPb *pbOffice.CommentOneWorkMomentResp ) @@ -177,7 +245,13 @@ func CommentOneWorkMoment(c *gin.Context) { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } reqPb.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.CommentOneWorkMoment(context.Background(), &reqPb) if err != nil { @@ -192,10 +266,22 @@ func CommentOneWorkMoment(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 删除一条评论 +// @Description 删除一条评论 +// @Tags 工作圈 +// @ID DeleteComment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.DeleteCommentReq true "请求" +// @Produce json +// @Success 0 {object} api.DeleteCommentResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/delete_comment [post] func DeleteComment(c *gin.Context) { var ( - req apiStruct.DeleteCommentReq - resp apiStruct.DeleteCommentResp + req api.DeleteCommentReq + resp api.DeleteCommentResp reqPb pbOffice.DeleteCommentReq respPb *pbOffice.DeleteCommentResp ) @@ -219,7 +305,13 @@ func DeleteComment(c *gin.Context) { return } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.DeleteComment(context.Background(), &reqPb) if err != nil { @@ -234,10 +326,22 @@ func DeleteComment(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 通过ID获取工作圈 +// @Description 通过ID获取工作圈 +// @Tags 工作圈 +// @ID GetWorkMomentByID +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetWorkMomentByIDReq true "请求" +// @Produce json +// @Success 0 {object} api.GetWorkMomentByIDResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/get_work_moment_by_id [post] func GetWorkMomentByID(c *gin.Context) { var ( - req apiStruct.GetWorkMomentByIDReq - resp apiStruct.GetWorkMomentByIDResp + req api.GetWorkMomentByIDReq + resp api.GetWorkMomentByIDResp reqPb pbOffice.GetWorkMomentByIDReq respPb *pbOffice.GetWorkMomentByIDResp ) @@ -262,7 +366,13 @@ func GetWorkMomentByID(c *gin.Context) { reqPb.OperationID = req.OperationID reqPb.OpUserID = userID reqPb.WorkMomentID = req.WorkMomentID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.GetWorkMomentByID(context.Background(), &reqPb) if err != nil { @@ -273,8 +383,8 @@ func GetWorkMomentByID(c *gin.Context) { if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - resp.Data.WorkMoment = &apiStruct.WorkMoment{LikeUserList: []*apiStruct.WorkMomentUser{}, Comments: []*apiStruct.Comment{}, - AtUserList: []*apiStruct.WorkMomentUser{}, PermissionUserList: []*apiStruct.WorkMomentUser{}} + resp.Data.WorkMoment = &api.WorkMoment{LikeUserList: []*api.WorkMomentUser{}, Comments: []*api.Comment{}, + AtUserList: []*api.WorkMomentUser{}, PermissionUserList: []*api.WorkMomentUser{}} if err := utils.CopyStructFields(&resp.Data.WorkMoment, respPb.WorkMoment); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } @@ -282,10 +392,22 @@ func GetWorkMomentByID(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 查询用户工作圈 +// @Description 查询用户工作圈 +// @Tags 工作圈 +// @ID GetUserWorkMoments +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetUserWorkMomentsReq true "请求" +// @Produce json +// @Success 0 {object} api.GetUserWorkMomentsResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/get_user_work_moments [post] func GetUserWorkMoments(c *gin.Context) { var ( - req apiStruct.GetUserWorkMomentsReq - resp apiStruct.GetUserWorkMomentsResp + req api.GetUserWorkMomentsReq + resp api.GetUserWorkMomentsResp reqPb pbOffice.GetUserWorkMomentsReq respPb *pbOffice.GetUserWorkMomentsResp ) @@ -314,7 +436,13 @@ func GetUserWorkMoments(c *gin.Context) { } reqPb.OpUserID = opUserID reqPb.UserID = req.UserID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.GetUserWorkMoments(context.Background(), &reqPb) if err != nil { @@ -322,29 +450,26 @@ func GetUserWorkMoments(c *gin.Context) { c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserWorkMoments rpc server failed" + err.Error()}) return } - resp.Data.WorkMoments = []*apiStruct.WorkMoment{} + resp.Data.WorkMoments = []*api.WorkMoment{} if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - //if err := utils.CopyStructFields(&resp.Data.WorkMoments, respPb.WorkMoments); err != nil { - // log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) - //} for _, v := range respPb.WorkMoments { - workMoment := apiStruct.WorkMoment{ + workMoment := api.WorkMoment{ WorkMomentID: v.WorkMomentID, UserID: v.UserID, Content: v.Content, FaceURL: v.FaceURL, UserName: v.UserName, CreateTime: v.CreateTime, - Comments: make([]*apiStruct.Comment, len(v.Comments)), - LikeUserList: make([]*apiStruct.WorkMomentUser, len(v.LikeUserList)), - AtUserList: make([]*apiStruct.WorkMomentUser, len(v.AtUserList)), - PermissionUserList: make([]*apiStruct.WorkMomentUser, len(v.PermissionUserList)), + Comments: make([]*api.Comment, len(v.Comments)), + LikeUserList: make([]*api.WorkMomentUser, len(v.LikeUserList)), + AtUserList: make([]*api.WorkMomentUser, len(v.AtUserList)), + PermissionUserList: make([]*api.WorkMomentUser, len(v.PermissionUserList)), Permission: v.Permission, } for i, comment := range v.Comments { - workMoment.Comments[i] = &apiStruct.Comment{ + workMoment.Comments[i] = &api.Comment{ UserID: comment.UserID, UserName: comment.UserName, ReplyUserID: comment.ReplyUserID, @@ -355,19 +480,19 @@ func GetUserWorkMoments(c *gin.Context) { } } for i, likeUser := range v.LikeUserList { - workMoment.LikeUserList[i] = &apiStruct.WorkMomentUser{ + workMoment.LikeUserList[i] = &api.WorkMomentUser{ UserID: likeUser.UserID, UserName: likeUser.UserName, } } for i, atUser := range v.AtUserList { - workMoment.AtUserList[i] = &apiStruct.WorkMomentUser{ + workMoment.AtUserList[i] = &api.WorkMomentUser{ UserID: atUser.UserID, UserName: atUser.UserName, } } for i, permissionUser := range v.PermissionUserList { - workMoment.PermissionUserList[i] = &apiStruct.WorkMomentUser{ + workMoment.PermissionUserList[i] = &api.WorkMomentUser{ UserID: permissionUser.UserID, UserName: permissionUser.UserName, } @@ -380,10 +505,22 @@ func GetUserWorkMoments(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 查询自己大工作圈页面 +// @Description 查询用户工作圈页面 +// @Tags 工作圈 +// @ID GetUserFriendWorkMoments +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetUserFriendWorkMomentsReq true "请求" +// @Produce json +// @Success 0 {object} api.GetUserFriendWorkMomentsResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/get_user_friend_work_moments [post] func GetUserFriendWorkMoments(c *gin.Context) { var ( - req apiStruct.GetUserFriendWorkMomentsReq - resp apiStruct.GetUserFriendWorkMomentsResp + req api.GetUserFriendWorkMomentsReq + resp api.GetUserFriendWorkMomentsResp reqPb pbOffice.GetUserFriendWorkMomentsReq respPb *pbOffice.GetUserFriendWorkMomentsResp ) @@ -411,7 +548,13 @@ func GetUserFriendWorkMoments(c *gin.Context) { ShowNumber: req.ShowNumber, } reqPb.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.GetUserFriendWorkMoments(context.Background(), &reqPb) if err != nil { @@ -425,23 +568,23 @@ func GetUserFriendWorkMoments(c *gin.Context) { //if err := utils.CopyStructFields(&resp.Data.WorkMoments, respPb.WorkMoments); err != nil { // log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) //} - resp.Data.WorkMoments = []*apiStruct.WorkMoment{} + resp.Data.WorkMoments = []*api.WorkMoment{} for _, v := range respPb.WorkMoments { - workMoment := apiStruct.WorkMoment{ + workMoment := api.WorkMoment{ WorkMomentID: v.WorkMomentID, UserID: v.UserID, Content: v.Content, FaceURL: v.FaceURL, UserName: v.UserName, CreateTime: v.CreateTime, - Comments: make([]*apiStruct.Comment, len(v.Comments)), - LikeUserList: make([]*apiStruct.WorkMomentUser, len(v.LikeUserList)), - AtUserList: make([]*apiStruct.WorkMomentUser, len(v.AtUserList)), - PermissionUserList: make([]*apiStruct.WorkMomentUser, len(v.PermissionUserList)), + Comments: make([]*api.Comment, len(v.Comments)), + LikeUserList: make([]*api.WorkMomentUser, len(v.LikeUserList)), + AtUserList: make([]*api.WorkMomentUser, len(v.AtUserList)), + PermissionUserList: make([]*api.WorkMomentUser, len(v.PermissionUserList)), Permission: v.Permission, } for i, comment := range v.Comments { - workMoment.Comments[i] = &apiStruct.Comment{ + workMoment.Comments[i] = &api.Comment{ UserID: comment.UserID, UserName: comment.UserName, ReplyUserID: comment.ReplyUserID, @@ -452,19 +595,19 @@ func GetUserFriendWorkMoments(c *gin.Context) { } } for i, likeUser := range v.LikeUserList { - workMoment.LikeUserList[i] = &apiStruct.WorkMomentUser{ + workMoment.LikeUserList[i] = &api.WorkMomentUser{ UserID: likeUser.UserID, UserName: likeUser.UserName, } } for i, atUser := range v.AtUserList { - workMoment.AtUserList[i] = &apiStruct.WorkMomentUser{ + workMoment.AtUserList[i] = &api.WorkMomentUser{ UserID: atUser.UserID, UserName: atUser.UserName, } } for i, permissionUser := range v.PermissionUserList { - workMoment.PermissionUserList[i] = &apiStruct.WorkMomentUser{ + workMoment.PermissionUserList[i] = &api.WorkMomentUser{ UserID: permissionUser.UserID, UserName: permissionUser.UserName, } @@ -479,8 +622,8 @@ func GetUserFriendWorkMoments(c *gin.Context) { func SetUserWorkMomentsLevel(c *gin.Context) { var ( - req apiStruct.SetUserWorkMomentsLevelReq - resp apiStruct.SetUserWorkMomentsLevelResp + req api.SetUserWorkMomentsLevelReq + resp api.SetUserWorkMomentsLevelResp reqPb pbOffice.SetUserWorkMomentsLevelReq respPb *pbOffice.SetUserWorkMomentsLevelResp ) @@ -506,7 +649,13 @@ func SetUserWorkMomentsLevel(c *gin.Context) { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } reqPb.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.SetUserWorkMomentsLevel(context.Background(), &reqPb) if err != nil { diff --git a/internal/api/organization/organization.go b/internal/api/organization/organization.go index 9d134a253..1d6542306 100644 --- a/internal/api/organization/organization.go +++ b/internal/api/organization/organization.go @@ -16,6 +16,18 @@ import ( "strings" ) +// @Summary 创建部门 +// @Description 创建部门 +// @Tags 组织架构相关 +// @ID CreateDepartment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.CreateDepartmentReq true "请求" +// @Produce json +// @Success 0 {object} api.CreateDepartmentResp{data=open_im_sdk.Department} +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /organization/create_department [post] func CreateDepartment(c *gin.Context) { params := api.CreateDepartmentReq{} if err := c.BindJSON(¶ms); err != nil { @@ -36,7 +48,14 @@ func CreateDepartment(c *gin.Context) { } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.CreateDepartment(context.Background(), req) if err != nil { @@ -52,6 +71,18 @@ func CreateDepartment(c *gin.Context) { c.JSON(http.StatusOK, apiResp) } +// @Summary 更新部门信息 +// @Description 更新部门信息 +// @Tags 组织架构相关 +// @ID UpdateDepartment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.UpdateDepartmentReq true "请求" +// @Produce json +// @Success 0 {object} api.UpdateDepartmentResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /organization/update_department [post] func UpdateDepartment(c *gin.Context) { params := api.UpdateDepartmentReq{} if err := c.BindJSON(¶ms); err != nil { @@ -72,7 +103,14 @@ func UpdateDepartment(c *gin.Context) { } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.UpdateDepartment(context.Background(), req) if err != nil { @@ -87,6 +125,18 @@ func UpdateDepartment(c *gin.Context) { c.JSON(http.StatusOK, apiResp) } +// @Summary 获取子部门列表 +// @Description 获取子部门列表 +// @Tags 组织架构相关 +// @ID GetSubDepartment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetSubDepartmentReq true "请求" +// @Produce json +// @Success 0 {object} api.GetSubDepartmentResp{data=[]open_im_sdk.Department} +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /organization/get_sub_department [post] func GetSubDepartment(c *gin.Context) { params := api.GetSubDepartmentReq{} if err := c.BindJSON(¶ms); err != nil { @@ -106,7 +156,13 @@ func GetSubDepartment(c *gin.Context) { } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.GetSubDepartment(context.Background(), req) if err != nil { @@ -126,6 +182,18 @@ func GetAllDepartment(c *gin.Context) { } +// @Summary 删除部门 +// @Description 删除部门 +// @Tags 组织架构相关 +// @ID DeleteDepartment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.DeleteDepartmentReq true "请求" +// @Produce json +// @Success 0 {object} api.DeleteDepartmentResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /organization/delete_department [post] func DeleteDepartment(c *gin.Context) { params := api.DeleteDepartmentReq{} if err := c.BindJSON(¶ms); err != nil { @@ -144,7 +212,13 @@ func DeleteDepartment(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.DeleteDepartment(context.Background(), req) if err != nil { @@ -159,6 +233,18 @@ func DeleteDepartment(c *gin.Context) { c.JSON(http.StatusOK, apiResp) } +// @Summary 组织架构导入用户 +// @Description 组织架构导入用户 +// @Tags 组织架构相关 +// @ID CreateOrganizationUser +// @Accept json +// @Param token header string true "im token" +// @Param req body api.CreateOrganizationUserReq true "请求" +// @Produce json +// @Success 0 {object} api.CreateOrganizationUserResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /organization/create_organization_user [post] func CreateOrganizationUser(c *gin.Context) { params := api.CreateOrganizationUserReq{} if err := c.BindJSON(¶ms); err != nil { @@ -180,7 +266,13 @@ func CreateOrganizationUser(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.CreateOrganizationUser(context.Background(), req) if err != nil { @@ -195,6 +287,18 @@ func CreateOrganizationUser(c *gin.Context) { c.JSON(http.StatusOK, apiResp) } +// @Summary 更新组织架构中的用户 +// @Description 更新组织架构中的用户 +// @Tags 组织架构相关 +// @ID UpdateOrganizationUser +// @Accept json +// @Param token header string true "im token" +// @Param req body api.UpdateOrganizationUserReq true "请求" +// @Produce json +// @Success 0 {object} api.UpdateOrganizationUserResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /organization/update_organization_user [post] func UpdateOrganizationUser(c *gin.Context) { params := api.UpdateOrganizationUserReq{} if err := c.BindJSON(¶ms); err != nil { @@ -215,7 +319,13 @@ func UpdateOrganizationUser(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.UpdateOrganizationUser(context.Background(), req) if err != nil { @@ -224,12 +334,23 @@ func UpdateOrganizationUser(c *gin.Context) { c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) return } - apiResp := api.UpdateOrganizationUserResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) c.JSON(http.StatusOK, apiResp) } +// @Summary 创建部门用户 +// @Description 创建部门用户 +// @Tags 组织架构相关 +// @ID CreateDepartmentMember +// @Accept json +// @Param token header string true "im token" +// @Param req body api.CreateDepartmentMemberReq true "请求" +// @Produce json +// @Success 0 {object} api.CreateDepartmentMemberResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /organization/create_department_member [post] func CreateDepartmentMember(c *gin.Context) { params := api.CreateDepartmentMemberReq{} if err := c.BindJSON(¶ms); err != nil { @@ -251,7 +372,13 @@ func CreateDepartmentMember(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.CreateDepartmentMember(context.Background(), req) if err != nil { @@ -266,6 +393,18 @@ func CreateDepartmentMember(c *gin.Context) { c.JSON(http.StatusOK, apiResp) } +// @Summary 获取部门中的所有用户 +// @Description 获取部门中的所有用户 +// @Tags 组织架构相关 +// @ID GetUserInDepartment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetUserInDepartmentReq true "请求" +// @Produce json +// @Success 0 {object} api.GetUserInDepartmentResp{data=open_im_sdk.UserInDepartment} +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /organization/get_user_in_department [post] func GetUserInDepartment(c *gin.Context) { params := api.GetUserInDepartmentReq{} if err := c.BindJSON(¶ms); err != nil { @@ -286,7 +425,13 @@ func GetUserInDepartment(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.GetUserInDepartment(context.Background(), req) if err != nil { @@ -302,6 +447,18 @@ func GetUserInDepartment(c *gin.Context) { c.JSON(http.StatusOK, apiResp) } +// @Summary 更新部门中某个用户 +// @Description 更新部门中某个用户 +// @Tags 组织架构相关 +// @ID UpdateUserInDepartment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.UpdateUserInDepartmentReq true "请求" +// @Produce json +// @Success 0 {object} api.UpdateUserInDepartmentResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /organization/update_user_in_department [post] func UpdateUserInDepartment(c *gin.Context) { params := api.UpdateUserInDepartmentReq{} if err := c.BindJSON(¶ms); err != nil { @@ -322,7 +479,13 @@ func UpdateUserInDepartment(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.UpdateUserInDepartment(context.Background(), req) if err != nil { @@ -337,6 +500,18 @@ func UpdateUserInDepartment(c *gin.Context) { c.JSON(http.StatusOK, apiResp) } +// @Summary 删除组织架构中某个用户 +// @Description 删除组织架构中某个用户 +// @Tags 组织架构相关 +// @ID DeleteOrganizationUser +// @Accept json +// @Param token header string true "im token" +// @Param req body api.DeleteOrganizationUserReq true "请求" +// @Produce json +// @Success 0 {object} api.DeleteOrganizationUserResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /organization/delete_organization_user [post] func DeleteOrganizationUser(c *gin.Context) { params := api.DeleteOrganizationUserReq{} if err := c.BindJSON(¶ms); err != nil { @@ -357,7 +532,13 @@ func DeleteOrganizationUser(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.DeleteOrganizationUser(context.Background(), req) if err != nil { @@ -372,6 +553,18 @@ func DeleteOrganizationUser(c *gin.Context) { c.JSON(http.StatusOK, apiResp) } +// @Summary 获取部门中所有成员 +// @Description 获取部门中所有成员 +// @Tags 组织架构相关 +// @ID GetDepartmentMember +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetDepartmentMemberReq true "请求" +// @Produce json +// @Success 0 {object} api.GetDepartmentMemberResp{data=[]open_im_sdk.UserDepartmentMember} +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /organization/get_department_member [post] func GetDepartmentMember(c *gin.Context) { params := api.GetDepartmentMemberReq{} if err := c.BindJSON(¶ms); err != nil { @@ -379,7 +572,6 @@ func GetDepartmentMember(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) return } - req := &rpc.GetDepartmentMemberReq{} utils.CopyStructFields(req, ¶ms) @@ -392,7 +584,13 @@ func GetDepartmentMember(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.GetDepartmentMember(context.Background(), req) if err != nil { @@ -408,6 +606,18 @@ func GetDepartmentMember(c *gin.Context) { c.JSON(http.StatusOK, apiResp) } +// @Summary 删除部门中某个用户 +// @Description 删除部门中某个用户 +// @Tags 组织架构相关 +// @ID DeleteUserInDepartment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.DeleteUserInDepartmentReq true "请求" +// @Produce json +// @Success 0 {object} api.DeleteUserInDepartmentResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /organization/delete_user_in_department [post] func DeleteUserInDepartment(c *gin.Context) { params := api.DeleteUserInDepartmentReq{} if err := c.BindJSON(¶ms); err != nil { @@ -427,7 +637,13 @@ func DeleteUserInDepartment(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.DeleteUserInDepartment(context.Background(), req) if err != nil { diff --git a/internal/api/third/minio_init.go b/internal/api/third/minio_init.go index a93ad9bb7..393122858 100644 --- a/internal/api/third/minio_init.go +++ b/internal/api/third/minio_init.go @@ -5,6 +5,7 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/utils" "context" + "fmt" "github.com/minio/minio-go/v7" "github.com/minio/minio-go/v7/pkg/credentials" url2 "net/url" @@ -50,39 +51,45 @@ func MinioInit() { } err = MinioClient.MakeBucket(context.Background(), config.Config.Credential.Minio.Bucket, opt) if err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), "MakeBucket failed ", err.Error()) + log.NewInfo(operationID, utils.GetSelfFuncName(), "MakeBucket failed ", err.Error()) exists, err := MinioClient.BucketExists(context.Background(), config.Config.Credential.Minio.Bucket) if err == nil && exists { - log.NewWarn(operationID, utils.GetSelfFuncName(), "We already own ", config.Config.Credential.Minio.Bucket) + log.NewInfo(operationID, utils.GetSelfFuncName(), "We already own ", config.Config.Credential.Minio.Bucket) } else { if err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), err.Error()) + log.NewInfo(operationID, utils.GetSelfFuncName(), err.Error()) } - log.NewError(operationID, utils.GetSelfFuncName(), "create bucket failed and bucket not exists") + log.NewInfo(operationID, utils.GetSelfFuncName(), "create bucket failed and bucket not exists") return } } // make app bucket err = MinioClient.MakeBucket(context.Background(), config.Config.Credential.Minio.AppBucket, opt) if err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), "MakeBucket failed ", err.Error()) + log.NewInfo(operationID, utils.GetSelfFuncName(), "MakeBucket failed ", err.Error()) exists, err := MinioClient.BucketExists(context.Background(), config.Config.Credential.Minio.Bucket) if err == nil && exists { - log.NewWarn(operationID, utils.GetSelfFuncName(), "We already own ", config.Config.Credential.Minio.Bucket) + log.NewInfo(operationID, utils.GetSelfFuncName(), "We already own ", config.Config.Credential.Minio.Bucket) } else { if err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), err.Error()) + log.NewInfo(operationID, utils.GetSelfFuncName(), err.Error()) } - log.NewError(operationID, utils.GetSelfFuncName(), "create bucket failed and bucket not exists") + log.NewInfo(operationID, utils.GetSelfFuncName(), "create bucket failed and bucket not exists") return } } // 自动化桶public的代码 - //err = MinioClient.SetBucketPolicy(context.Background(), config.Config.Credential.Minio.Bucket, policy.BucketPolicyReadWrite) - //err = MinioClient.SetBucketPolicy(context.Background(), config.Config.Credential.Minio.AppBucket, policy.BucketPolicyReadWrite) - //if err != nil { - // log.NewDebug("", utils.GetSelfFuncName(), "SetBucketPolicy failed please set in web", err.Error()) - // return - //} + policyJsonString := fmt.Sprintf(`{"Version": "2012-10-17","Statement": [{"Action": ["s3:GetObject","s3:PutObject"], + "Effect": "Allow","Principal": {"AWS": ["*"]},"Resource": ["arn:aws:s3:::%s/*"],"Sid": ""}]}`, config.Config.Credential.Minio.Bucket) + err = MinioClient.SetBucketPolicy(context.Background(), config.Config.Credential.Minio.Bucket, policyJsonString) + if err != nil { + log.NewInfo("", utils.GetSelfFuncName(), "SetBucketPolicy failed please set in web", err.Error()) + } + policyJsonString = fmt.Sprintf(`{"Version": "2012-10-17","Statement": [{"Action": ["s3:GetObject","s3:PutObject"], + "Effect": "Allow","Principal": {"AWS": ["*"]},"Resource": ["arn:aws:s3:::%s/*"],"Sid": ""}]}`, config.Config.Credential.Minio.AppBucket) + err = MinioClient.SetBucketPolicy(context.Background(), config.Config.Credential.Minio.AppBucket, policyJsonString) + if err != nil { + log.NewInfo("", utils.GetSelfFuncName(), "SetBucketPolicy failed please set in web", err.Error()) + } log.NewInfo(operationID, utils.GetSelfFuncName(), "minio create and set policy success") } diff --git a/internal/api/third/minio_storage_credential.go b/internal/api/third/minio_storage_credential.go index f294d6ba3..e21550044 100644 --- a/internal/api/third/minio_storage_credential.go +++ b/internal/api/third/minio_storage_credential.go @@ -1,7 +1,7 @@ package apiThird import ( - apiStruct "Open_IM/pkg/base_info" + api "Open_IM/pkg/base_info" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" @@ -17,10 +17,24 @@ import ( "net/http" ) +// @Summary minio上传文件(web api) +// @Description minio上传文件(web api), 请注意本api请求为form并非json +// @Tags 第三方服务相关 +// @ID MinioUploadFile +// @Accept json +// @Param token header string true "im token" +// @Param file formData file true "要上传的文件文件" +// @Param fileType formData int true "文件类型" +// @Param operationID formData string true "操作唯一ID" +// @Produce json +// @Success 0 {object} api.MinioUploadFileResp "" +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /third/minio_upload [post] func MinioUploadFile(c *gin.Context) { var ( - req apiStruct.MinioUploadFileReq - resp apiStruct.MinioUploadFileResp + req api.MinioUploadFileReq + resp api.MinioUploadFile ) defer func() { if r := recover(); r != nil { @@ -41,7 +55,7 @@ func MinioUploadFile(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } @@ -87,7 +101,7 @@ func MinioUploadFile(c *gin.Context) { log.Debug(req.OperationID, utils.GetSelfFuncName(), config.Config.Credential.Minio.Bucket, newName, fileObj, file.Size, newType, MinioClient.EndpointURL()) _, err = MinioClient.PutObject(context.Background(), config.Config.Credential.Minio.Bucket, newName, fileObj, file.Size, minio.PutObjectOptions{ContentType: newType}) if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "upload file error") + log.NewError(req.OperationID, utils.GetSelfFuncName(), "upload file error", err.Error()) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "upload file error" + err.Error()}) return } @@ -100,8 +114,8 @@ func MinioUploadFile(c *gin.Context) { func MinioStorageCredential(c *gin.Context) { var ( - req apiStruct.MinioStorageCredentialReq - resp apiStruct.MiniostorageCredentialResp + req api.MinioStorageCredentialReq + resp api.MiniostorageCredentialResp ) if err := c.BindJSON(&req); err != nil { log.NewError("0", utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) @@ -151,8 +165,8 @@ func MinioStorageCredential(c *gin.Context) { func UploadUpdateApp(c *gin.Context) { var ( - req apiStruct.UploadUpdateAppReq - resp apiStruct.UploadUpdateAppResp + req api.UploadUpdateAppReq + resp api.UploadUpdateAppResp ) if err := c.Bind(&req); err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) @@ -204,8 +218,8 @@ func UploadUpdateApp(c *gin.Context) { func GetDownloadURL(c *gin.Context) { var ( - req apiStruct.GetDownloadURLReq - resp apiStruct.GetDownloadURLResp + req api.GetDownloadURLReq + resp api.GetDownloadURLResp ) defer func() { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) diff --git a/internal/api/third/rtc.go b/internal/api/third/rtc.go new file mode 100644 index 000000000..576e32892 --- /dev/null +++ b/internal/api/third/rtc.go @@ -0,0 +1,96 @@ +package apiThird + +import ( + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/utils" + "github.com/gin-gonic/gin" + "net/http" +) + +func GetRTCInvitationInfo(c *gin.Context) { + var ( + req api.GetRTCInvitationInfoReq + resp api.GetRTCInvitationInfoResp + ) + if err := c.Bind(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID, errInfo := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + var err error + invitationInfo, err := db.DB.GetSignalInfoFromCacheByClientMsgID(req.ClientMsgID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSignalInfoFromCache", err.Error(), req) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + if err := db.DB.DelUserSignalList(userID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelUserSignalList result:", err.Error()) + } + + resp.Data.OpUserID = invitationInfo.OpUserID + resp.Data.Invitation.RoomID = invitationInfo.Invitation.RoomID + resp.Data.Invitation.SessionType = invitationInfo.Invitation.SessionType + resp.Data.Invitation.GroupID = invitationInfo.Invitation.GroupID + resp.Data.Invitation.InviterUserID = invitationInfo.Invitation.InviterUserID + resp.Data.Invitation.InviteeUserIDList = invitationInfo.Invitation.InviteeUserIDList + resp.Data.Invitation.MediaType = invitationInfo.Invitation.MediaType + resp.Data.Invitation.Timeout = invitationInfo.Invitation.Timeout + resp.Data.Invitation.InitiateTime = invitationInfo.Invitation.InitiateTime + resp.Data.Invitation.PlatformID = invitationInfo.Invitation.PlatformID + resp.Data.Invitation.CustomData = invitationInfo.Invitation.CustomData + c.JSON(http.StatusOK, resp) +} + +func GetRTCInvitationInfoStartApp(c *gin.Context) { + var ( + req api.GetRTCInvitationInfoStartAppReq + resp api.GetRTCInvitationInfoStartAppResp + ) + if err := c.Bind(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + var ok bool + var errInfo string + ok, userID, errInfo := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + invitationInfo, err := db.DB.GetAvailableSignalInvitationInfo(userID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSignalInfoFromCache", err.Error(), req) + c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": err.Error(), "data": struct{}{}}) + return + } + resp.Data.OpUserID = invitationInfo.OpUserID + resp.Data.Invitation.RoomID = invitationInfo.Invitation.RoomID + resp.Data.Invitation.SessionType = invitationInfo.Invitation.SessionType + resp.Data.Invitation.GroupID = invitationInfo.Invitation.GroupID + resp.Data.Invitation.InviterUserID = invitationInfo.Invitation.InviterUserID + resp.Data.Invitation.InviteeUserIDList = invitationInfo.Invitation.InviteeUserIDList + resp.Data.Invitation.MediaType = invitationInfo.Invitation.MediaType + resp.Data.Invitation.Timeout = invitationInfo.Invitation.Timeout + resp.Data.Invitation.InitiateTime = invitationInfo.Invitation.InitiateTime + resp.Data.Invitation.PlatformID = invitationInfo.Invitation.PlatformID + resp.Data.Invitation.CustomData = invitationInfo.Invitation.CustomData + c.JSON(http.StatusOK, resp) + +} diff --git a/internal/api/third/tencent_cloud_storage_credential.go b/internal/api/third/tencent_cloud_storage_credential.go index 871d92ae0..4f641f1aa 100644 --- a/internal/api/third/tencent_cloud_storage_credential.go +++ b/internal/api/third/tencent_cloud_storage_credential.go @@ -30,7 +30,7 @@ func TencentCloudStorageCredential(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg}) return } diff --git a/internal/api/user/user.go b/internal/api/user/user.go index 6be7ed710..3047dce46 100644 --- a/internal/api/user/user.go +++ b/internal/api/user/user.go @@ -35,10 +35,16 @@ func GetUsersInfoFromCache(c *gin.Context) { if !ok { errMsg := "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) return } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) client := rpc.NewUserClient(etcdConn) RpcResp, err := client.GetUserInfo(context.Background(), req) if err != nil { @@ -80,7 +86,13 @@ func GetFriendIDListFromCache(c *gin.Context) { c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) return } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := cacheRpc.NewCacheClient(etcdConn) respPb, err := client.GetFriendIDListFromCache(context.Background(), &reqPb) if err != nil { @@ -116,7 +128,13 @@ func GetBlackIDListFromCache(c *gin.Context) { c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) return } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := cacheRpc.NewCacheClient(etcdConn) respPb, err := client.GetBlackIDListFromCache(context.Background(), &reqPb) if err != nil { @@ -129,6 +147,18 @@ func GetBlackIDListFromCache(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 获取用户信息 +// @Description 根据用户列表批量获取用户信息 +// @Tags 用户相关 +// @ID GetUsersInfo +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetUsersInfoReq true "请求体" +// @Produce json +// @Success 0 {object} api.GetUsersInfoResp{Data=[]open_im_sdk.PublicUserInfo} +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /user/get_users_info [post] func GetUsersInfo(c *gin.Context) { params := api.GetUsersInfoReq{} if err := c.BindJSON(¶ms); err != nil { @@ -145,13 +175,19 @@ func GetUsersInfo(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(params.OperationID, "GetUserInfo args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewUserClient(etcdConn) RpcResp, err := client.GetUserInfo(context.Background(), req) if err != nil { @@ -171,6 +207,18 @@ func GetUsersInfo(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 修改用户信息 +// @Description 修改用户信息 userID faceURL等 +// @Tags 用户相关 +// @ID UpdateUserInfo +// @Accept json +// @Param token header string true "im token" +// @Param req body api.UpdateSelfUserInfoReq true "请求体" +// @Produce json +// @Success 0 {object} api.UpdateUserInfoResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /user/update_user_info [post] func UpdateUserInfo(c *gin.Context) { params := api.UpdateSelfUserInfoReq{} if err := c.BindJSON(¶ms); err != nil { @@ -187,12 +235,17 @@ func UpdateUserInfo(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(params.OperationID, "UpdateUserInfo args ", req.String()) - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewUserClient(etcdConn) RpcResp, err := client.UpdateUserInfo(context.Background(), req) if err != nil { @@ -205,6 +258,69 @@ func UpdateUserInfo(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 设置全局免打扰 +// @Description 设置全局免打扰 +// @Tags 用户相关 +// @ID SetGlobalRecvMessageOpt +// @Accept json +// @Param token header string true "im token" +// @Param req body api.SetGlobalRecvMessageOptReq true "globalRecvMsgOpt为全局免打扰设置0为关闭 1为开启" +// @Produce json +// @Success 0 {object} api.SetGlobalRecvMessageOptResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /user/set_global_msg_recv_opt [post] +func SetGlobalRecvMessageOpt(c *gin.Context) { + params := api.SetGlobalRecvMessageOptReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.SetGlobalRecvMessageOptReq{} + utils.CopyStructFields(req, ¶ms) + req.OperationID = params.OperationID + var ok bool + var errInfo string + ok, req.UserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + log.NewInfo(params.OperationID, "SetGlobalRecvMessageOpt args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewUserClient(etcdConn) + RpcResp, err := client.SetGlobalRecvMessageOpt(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "SetGlobalRecvMessageOpt failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + log.NewInfo(req.OperationID, "SetGlobalRecvMessageOpt api return ", resp) + c.JSON(http.StatusOK, resp) +} + +// @Summary 获取自己的信息 +// @Description 传入ID获取自己的信息 +// @Tags 用户相关 +// @ID GetSelfUserInfo +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetSelfUserInfoReq true "请求体" +// @Produce json +// @Success 0 {object} api.GetSelfUserInfoResp{data=open_im_sdk.UserInfo} +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /user/get_self_user_info [post] func GetSelfUserInfo(c *gin.Context) { params := api.GetSelfUserInfoReq{} if err := c.BindJSON(¶ms); err != nil { @@ -222,14 +338,20 @@ func GetSelfUserInfo(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } req.UserIDList = append(req.UserIDList, req.OpUserID) log.NewInfo(params.OperationID, "GetUserInfo args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewUserClient(etcdConn) RpcResp, err := client.GetUserInfo(context.Background(), req) if err != nil { @@ -250,6 +372,18 @@ func GetSelfUserInfo(c *gin.Context) { } +// @Summary 获取用户在线状态 +// @Description 获取用户在线状态 +// @Tags 用户相关 +// @ID GetUsersOnlineStatus +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetUsersOnlineStatusReq true "请求体" +// @Produce json +// @Success 0 {object} api.GetUsersOnlineStatusResp +// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /user/get_users_online_status [post] func GetUsersOnlineStatus(c *gin.Context) { params := api.GetUsersOnlineStatusReq{} if err := c.BindJSON(¶ms); err != nil { @@ -265,7 +399,7 @@ func GetUsersOnlineStatus(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } diff --git a/internal/cms_api/admin/admin.go b/internal/cms_api/admin/admin.go index ff8882369..a741c8016 100644 --- a/internal/cms_api/admin/admin.go +++ b/internal/cms_api/admin/admin.go @@ -12,6 +12,7 @@ import ( "context" "github.com/minio/minio-go/v7" "github.com/minio/minio-go/v7/pkg/credentials" + "net/http" "strings" "github.com/gin-gonic/gin" @@ -68,7 +69,14 @@ func AdminLogin(c *gin.Context) { } reqPb.Secret = req.Secret reqPb.AdminID = req.AdminName - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAdminCMSName) + reqPb.OperationID = utils.OperationIDGenerator() + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAdminCMSName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbAdmin.NewAdminCMSClient(etcdConn) respPb, err := client.AdminLogin(context.Background(), &reqPb) if err != nil { diff --git a/internal/cms_api/group/group.go b/internal/cms_api/group/group.go index 69b9e32fc..54b6f64fe 100644 --- a/internal/cms_api/group/group.go +++ b/internal/cms_api/group/group.go @@ -10,6 +10,7 @@ import ( commonPb "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" + "net/http" "strings" pbGroup "Open_IM/pkg/proto/group" @@ -28,9 +29,16 @@ func GetGroupById(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.GroupId = req.GroupId - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) respPb, err := client.GetGroupById(context.Background(), &reqPb) if err != nil { @@ -60,10 +68,17 @@ func GetGroups(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.Pagination = &commonPb.RequestPagination{} utils.CopyStructFields(&reqPb.Pagination, req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) respPb, err := client.GetGroups(context.Background(), &reqPb) if err != nil { @@ -101,11 +116,18 @@ func GetGroupByName(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.GroupName = req.GroupName reqPb.Pagination = &commonPb.RequestPagination{} utils.CopyStructFields(&reqPb.Pagination, req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) respPb, err := client.GetGroup(context.Background(), &reqPb) if err != nil { @@ -143,7 +165,8 @@ func CreateGroup(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.GroupInfo = &commonPb.GroupInfo{} reqPb.GroupInfo.GroupName = req.GroupName reqPb.GroupInfo.CreatorUserID = req.GroupMasterId @@ -155,7 +178,13 @@ func CreateGroup(c *gin.Context) { RoleLevel: 1, }) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) _, err := client.CreateGroup(context.Background(), &reqPb) if err != nil { @@ -176,10 +205,18 @@ func BanGroupChat(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.GroupId = req.GroupId reqPb.Status = constant.GroupBanChat - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := pbGroup.NewGroupClient(etcdConn) _, err := client.OperateGroupStatus(context.Background(), &reqPb) if err != nil { @@ -201,10 +238,17 @@ func BanPrivateChat(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.GroupId = req.GroupId reqPb.Status = constant.GroupBanPrivateChat - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) _, err := client.OperateGroupStatus(context.Background(), &reqPb) if err != nil { @@ -225,10 +269,17 @@ func OpenGroupChat(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.GroupId = req.GroupId reqPb.Status = constant.GroupOk - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) _, err := client.OperateGroupStatus(context.Background(), &reqPb) if err != nil { @@ -249,10 +300,18 @@ func OpenPrivateChat(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.GroupId = req.GroupId reqPb.Status = constant.GroupOk - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := pbGroup.NewGroupClient(etcdConn) _, err := client.OperateGroupStatus(context.Background(), &reqPb) if err != nil { @@ -274,14 +333,21 @@ func GetGroupMembers(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.Pagination = &commonPb.RequestPagination{ PageNumber: int32(req.PageNumber), ShowNumber: int32(req.ShowNumber), } reqPb.GroupId = req.GroupId reqPb.UserName = req.UserName - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) respPb, err := client.GetGroupMembersCMS(context.Background(), &reqPb) if err != nil { @@ -317,10 +383,17 @@ func AddGroupMembers(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } + reqPb.OperationId = utils.OperationIDGenerator() log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) reqPb.UserIds = req.Members reqPb.GroupId = req.GroupId - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationId) + if etcdConn == nil { + errMsg := reqPb.OperationId + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationId, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) respPb, err := client.AddGroupMembersCMS(context.Background(), &reqPb) if err != nil { @@ -345,10 +418,17 @@ func RemoveGroupMembers(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.UserIds = req.Members reqPb.GroupId = req.GroupId - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) respPb, err := client.RemoveGroupMembersCMS(context.Background(), &reqPb) if err != nil { @@ -373,9 +453,16 @@ func DeleteGroup(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.GroupId = req.GroupId - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) _, err := client.DeleteGroup(context.Background(), &reqPb) if err != nil { @@ -397,11 +484,18 @@ func SetGroupMaster(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.GroupId = req.GroupId reqPb.UserId = req.UserId reqPb.RoleLevel = constant.GroupOwner - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) _, err := client.OperateUserRole(context.Background(), &reqPb) if err != nil { @@ -423,11 +517,18 @@ func SetGroupOrdinaryUsers(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.GroupId = req.GroupId reqPb.UserId = req.UserId reqPb.RoleLevel = constant.GroupOrdinaryUsers - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) _, err := client.OperateUserRole(context.Background(), &reqPb) if err != nil { @@ -444,22 +545,29 @@ func AlterGroupInfo(c *gin.Context) { _ cms_api_struct.SetGroupMasterResponse reqPb pbGroup.SetGroupInfoReq ) - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) if err := c.BindJSON(&req); err != nil { log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } reqPb.OpUserID = c.MustGet("userID").(string) - reqPb.GroupInfo = &commonPb.GroupInfo{ + reqPb.GroupInfoForSet = &commonPb.GroupInfoForSet{ GroupID: req.GroupID, GroupName: req.GroupName, Introduction: req.Introduction, Notification: req.Notification, FaceURL: req.ProfilePhoto, - GroupType: int32(req.GroupType), + // GroupType: int32(req.GroupType), + } + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) client := pbGroup.NewGroupClient(etcdConn) _, err := client.SetGroupInfo(context.Background(), &reqPb) if err != nil { diff --git a/internal/cms_api/message_cms/message.go b/internal/cms_api/message_cms/message.go index 0a56bb99a..bd5949771 100644 --- a/internal/cms_api/message_cms/message.go +++ b/internal/cms_api/message_cms/message.go @@ -10,6 +10,7 @@ import ( pbCommon "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" + "net/http" "strings" "Open_IM/pkg/common/constant" @@ -21,7 +22,14 @@ func BroadcastMessage(c *gin.Context) { var ( reqPb pbMessage.BoradcastMessageReq ) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName) + reqPb.OperationID = utils.OperationIDGenerator() + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbMessage.NewMessageCMSClient(etcdConn) _, err := client.BoradcastMessage(context.Background(), &reqPb) if err != nil { @@ -36,7 +44,14 @@ func MassSendMassage(c *gin.Context) { var ( reqPb pbMessage.MassSendMessageReq ) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName) + reqPb.OperationID = utils.OperationIDGenerator() + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbMessage.NewMessageCMSClient(etcdConn) _, err := client.MassSendMessage(context.Background(), &reqPb) if err != nil { @@ -51,7 +66,14 @@ func WithdrawMessage(c *gin.Context) { var ( reqPb pbMessage.WithdrawMessageReq ) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName) + reqPb.OperationID = utils.OperationIDGenerator() + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbMessage.NewMessageCMSClient(etcdConn) _, err := client.WithdrawMessage(context.Background(), &reqPb) if err != nil { @@ -78,8 +100,14 @@ func GetChatLogs(c *gin.Context) { ShowNumber: int32(req.ShowNumber), } utils.CopyStructFields(&reqPb, &req) - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbMessage.NewMessageCMSClient(etcdConn) respPb, err := client.GetChatLogs(context.Background(), &reqPb) if err != nil { @@ -106,6 +134,6 @@ func GetChatLogs(c *gin.Context) { resp.ShowNumber = int(respPb.Pagination.ShowNumber) resp.CurrentPage = int(respPb.Pagination.CurrentPage) resp.ChatLogsNum = int(respPb.ChatLogsNum) - log.NewInfo("", utils.GetSelfFuncName(), "resp", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } diff --git a/internal/cms_api/statistics/statistics.go b/internal/cms_api/statistics/statistics.go index 89fb6056b..b33bdee12 100644 --- a/internal/cms_api/statistics/statistics.go +++ b/internal/cms_api/statistics/statistics.go @@ -10,6 +10,7 @@ import ( pb "Open_IM/pkg/proto/statistics" "Open_IM/pkg/utils" "context" + "net/http" "strings" "github.com/gin-gonic/gin" @@ -27,9 +28,16 @@ func GetMessagesStatistics(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb.StatisticsReq, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetMessageStatistics(context.Background(), &reqPb) if err != nil { @@ -58,7 +66,7 @@ func GetMessagesStatistics(c *gin.Context) { MessageNum: int(v.Num), }) } - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -74,13 +82,20 @@ func GetUserStatistics(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb.StatisticsReq, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetUserStatistics(context.Background(), &reqPb) if err != nil { - log.NewError("0", utils.GetSelfFuncName(), "GetUserStatistics failed", err.Error()) + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetUserStatistics failed", err.Error()) openIMHttp.RespHttp200(c, err, nil) return } @@ -115,7 +130,7 @@ func GetUserStatistics(c *gin.Context) { TotalUserNum: int(v.Num), }) } - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -131,9 +146,16 @@ func GetGroupStatistics(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb.StatisticsReq, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetGroupStatistics(context.Background(), &reqPb) if err != nil { @@ -165,7 +187,7 @@ func GetGroupStatistics(c *gin.Context) { }) } - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -181,9 +203,16 @@ func GetActiveUser(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb.StatisticsReq, req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetActiveUser(context.Background(), &reqPb) if err != nil { @@ -192,7 +221,7 @@ func GetActiveUser(c *gin.Context) { return } utils.CopyStructFields(&resp.ActiveUserList, respPb.Users) - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -208,13 +237,20 @@ func GetActiveGroup(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb.StatisticsReq, req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetActiveGroup(context.Background(), &reqPb) if err != nil { - log.NewError("0", utils.GetSelfFuncName(), "GetActiveGroup failed ", err.Error()) + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetActiveGroup failed ", err.Error()) openIMHttp.RespHttp200(c, err, nil) return } @@ -229,6 +265,6 @@ func GetActiveGroup(c *gin.Context) { MessageNum: int(group.MessageNum), }) } - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } diff --git a/internal/cms_api/user/user.go b/internal/cms_api/user/user.go index f8d96e35e..09513a98e 100644 --- a/internal/cms_api/user/user.go +++ b/internal/cms_api/user/user.go @@ -29,9 +29,17 @@ func GetUserById(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := pb.NewUserClient(etcdConn) respPb, err := client.GetUserById(context.Background(), &reqPb) if err != nil { @@ -44,7 +52,7 @@ func GetUserById(c *gin.Context) { return } utils.CopyStructFields(&resp, respPb.User) - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -54,7 +62,8 @@ func GetUsersByName(c *gin.Context) { resp cms_api_struct.GetUsersByNameResponse reqPb pb.GetUsersByNameReq ) - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) if err := c.ShouldBindQuery(&req); err != nil { log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed", err.Error()) openIMHttp.RespHttp200(c, constant.ErrArgs, nil) @@ -65,7 +74,13 @@ func GetUsersByName(c *gin.Context) { PageNumber: int32(req.PageNumber), ShowNumber: int32(req.ShowNumber), } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetUsersByName(context.Background(), &reqPb) if err != nil { @@ -77,7 +92,7 @@ func GetUsersByName(c *gin.Context) { resp.ShowNumber = int(respPb.Pagination.ShowNumber) resp.CurrentPage = int(respPb.Pagination.CurrentPage) resp.UserNums = respPb.UserNums - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -93,9 +108,16 @@ func GetUsers(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb.Pagination, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetUsers(context.Background(), &reqPb) if err != nil { @@ -106,7 +128,7 @@ func GetUsers(c *gin.Context) { resp.ShowNumber = int(respPb.Pagination.ShowNumber) resp.CurrentPage = int(respPb.Pagination.CurrentPage) resp.UserNums = respPb.UserNums - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -122,15 +144,22 @@ func ResignUser(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": http.StatusBadRequest, "errMsg": err.Error()}) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) _, err := client.ResignUser(context.Background(), &reqPb) if err != nil { openIMHttp.RespHttp200(c, err, resp) } - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -145,13 +174,20 @@ func AlterUser(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, resp) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) _, err := client.AlterUser(context.Background(), &reqPb) if err != nil { - log.NewError("0", "microserver failed ", err.Error()) + log.NewError(reqPb.OperationID, "microserver failed ", err.Error()) openIMHttp.RespHttp200(c, err, nil) } openIMHttp.RespHttp200(c, constant.OK, nil) @@ -167,9 +203,16 @@ func AddUser(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) _, err := client.AddUser(context.Background(), &reqPb) if err != nil { @@ -191,9 +234,16 @@ func BlockUser(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, resp) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) fmt.Println(reqPb) _, err := client.BlockUser(context.Background(), &reqPb) @@ -215,16 +265,23 @@ func UnblockUser(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, resp) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) _, err := client.UnBlockUser(context.Background(), &reqPb) if err != nil { openIMHttp.RespHttp200(c, err, resp) return } - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -241,10 +298,17 @@ func GetBlockUsers(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, resp) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb.Pagination, &req) log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "blockUsers", reqPb.Pagination, req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetBlockUsers(context.Background(), &reqPb) if err != nil { @@ -268,7 +332,7 @@ func GetBlockUsers(c *gin.Context) { resp.ShowNumber = int(respPb.Pagination.ShowNumber) resp.CurrentPage = int(respPb.Pagination.CurrentPage) resp.UserNums = respPb.UserNums - log.NewInfo("", utils.GetSelfFuncName(), "req: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -283,20 +347,27 @@ func GetBlockUserById(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.UserId = req.UserId - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetBlockUserById(context.Background(), &reqPb) if err != nil { - log.NewError("0", "GetBlockUserById rpc failed ", err.Error()) + log.NewError(reqPb.OperationID, "GetBlockUserById rpc failed ", err.Error()) openIMHttp.RespHttp200(c, err, nil) return } resp.EndDisableTime = respPb.BlockUser.EndDisableTime resp.BeginDisableTime = respPb.BlockUser.BeginDisableTime utils.CopyStructFields(&resp, respPb.BlockUser.User) - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -310,13 +381,20 @@ func DeleteUser(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.UserId = req.UserId - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) _, err := client.DeleteUser(context.Background(), &reqPb) if err != nil { - log.NewError("0", "DeleteUser rpc failed ", err.Error()) + log.NewError(reqPb.OperationID, "DeleteUser rpc failed ", err.Error()) openIMHttp.RespHttp200(c, err, nil) return } diff --git a/internal/demo/register/CreateTencentSMSClient_test.go b/internal/demo/register/CreateTencentSMSClient_test.go new file mode 100644 index 000000000..7c3a06fd7 --- /dev/null +++ b/internal/demo/register/CreateTencentSMSClient_test.go @@ -0,0 +1,14 @@ +package register + +import ( + "fmt" + "github.com/stretchr/testify/assert" + "testing" +) + +func Test_CreateTencentSMSClient(t *testing.T) { + result, err := CreateTencentSMSClient() + assert.Nil(t, err) + fmt.Println("return result is ", result) + +} diff --git a/internal/demo/register/ali_sms.go b/internal/demo/register/ali_sms.go new file mode 100644 index 000000000..b43e2813a --- /dev/null +++ b/internal/demo/register/ali_sms.go @@ -0,0 +1,59 @@ +package register + +import ( + "Open_IM/pkg/common/config" + "errors" + "fmt" + openapi "github.com/alibabacloud-go/darabonba-openapi/client" + dysmsapi20170525 "github.com/alibabacloud-go/dysmsapi-20170525/v2/client" + "github.com/alibabacloud-go/tea/tea" +) + +type AliSMS struct { + client *dysmsapi20170525.Client +} + +func (a AliSMS) SendSms(code int, phoneNumber string) (resp interface{}, err error) { + sendSmsRequest := &dysmsapi20170525.SendSmsRequest{ + PhoneNumbers: tea.String(phoneNumber), + SignName: tea.String(config.Config.Demo.AliSMSVerify.SignName), + TemplateCode: tea.String(config.Config.Demo.AliSMSVerify.VerificationCodeTemplateCode), + TemplateParam: tea.String(fmt.Sprintf("{\"code\":\"%d\"}", code)), + } + response, err := a.client.SendSms(sendSmsRequest) + if err != nil { + //log.NewError(params.OperationID, "sendSms error", account, "err", err.Error()) + //c.JSON(http.StatusOK, gin.H{"errCode": constant.SmsSendCodeErr, "errMsg": "Enter the superCode directly in the verification code box, SuperCode can be configured in config.xml"}) + return resp, err + } + if *response.Body.Code != "OK" { + //log.NewError(params.OperationID, "alibabacloud sendSms error", account, "err", response.Body.Code, response.Body.Message) + //c.JSON(http.StatusOK, gin.H{"errCode": constant.SmsSendCodeErr, "errMsg": "Enter the superCode directly in the verification code box, SuperCode can be configured in config.xml"}) + //return + return resp, errors.New("alibabacloud sendSms error") + } + return resp, nil +} + +func NewAliSMS() (*AliSMS, error) { + var a AliSMS + client, err := createClient(tea.String(config.Config.Demo.AliSMSVerify.AccessKeyID), tea.String(config.Config.Demo.AliSMSVerify.AccessKeySecret)) + if err != nil { + return &a, err + } + a.client = client + return &a, nil +} +func createClient(accessKeyId *string, accessKeySecret *string) (result *dysmsapi20170525.Client, err error) { + c := &openapi.Config{ + // 您的AccessKey ID + AccessKeyId: accessKeyId, + // 您的AccessKey Secret + AccessKeySecret: accessKeySecret, + } + // 访问的域名 + c.Endpoint = tea.String("dysmsapi.aliyuncs.com") + result = &dysmsapi20170525.Client{} + result, err = dysmsapi20170525.NewClient(c) + return result, err +} diff --git a/internal/demo/register/login.go b/internal/demo/register/login.go index b5d587844..4c475f57d 100644 --- a/internal/demo/register/login.go +++ b/internal/demo/register/login.go @@ -20,6 +20,7 @@ type ParamsLogin struct { Password string `json:"password"` Platform int32 `json:"platform"` OperationID string `json:"operationID" binding:"required"` + AreaCode string `json:"areaCode"` } func Login(c *gin.Context) { @@ -35,7 +36,7 @@ func Login(c *gin.Context) { account = params.PhoneNumber } - r, err := im_mysql_model.GetRegister(account) + r, err := im_mysql_model.GetRegister(account, params.AreaCode) if err != nil { log.NewError(params.OperationID, "user have not register", params.Password, account, err.Error()) c.JSON(http.StatusOK, gin.H{"errCode": constant.NotRegistered, "errMsg": "Mobile phone number is not registered"}) @@ -46,12 +47,18 @@ func Login(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"errCode": constant.PasswordErr, "errMsg": "password err"}) return } + var userID string + if r.UserID != "" { + userID = r.UserID + } else { + userID = r.Account + } url := fmt.Sprintf("http://%s:%d/auth/user_token", utils.ServerIP, config.Config.Api.GinPort[0]) openIMGetUserToken := api.UserTokenReq{} openIMGetUserToken.OperationID = params.OperationID openIMGetUserToken.Platform = params.Platform openIMGetUserToken.Secret = config.Config.Secret - openIMGetUserToken.UserID = account + openIMGetUserToken.UserID = userID openIMGetUserTokenResp := api.UserTokenResp{} bMsg, err := http2.Post(url, openIMGetUserToken, 2) if err != nil { diff --git a/internal/demo/register/onboarding_process.go b/internal/demo/register/onboarding_process.go index 28d4d9140..38a0d44e9 100644 --- a/internal/demo/register/onboarding_process.go +++ b/internal/demo/register/onboarding_process.go @@ -1,9 +1,11 @@ package register import ( + "Open_IM/internal/api/manage" "Open_IM/internal/rpc/msg" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" groupRpc "Open_IM/pkg/proto/group" @@ -19,27 +21,41 @@ import ( "time" ) -func onboardingProcess(operationID, userID, userName string) { - if err := createOrganizationUser(operationID, userID, userName); err != nil { +func onboardingProcess(operationID, userID, userName, faceURL, phoneNumber, email string) { + log.NewInfo(operationID, utils.GetSelfFuncName(), userName, userID, faceURL) + if err := createOrganizationUser(operationID, userID, userName, phoneNumber, email); err != nil { log.NewError(operationID, utils.GetSelfFuncName(), "createOrganizationUser failed", err.Error()) } - departmentID := config.Config.Demo.TestDepartMentID + departmentID, err := imdb.GetRandomDepartmentID() + if err := joinTestDepartment(operationID, userID, departmentID); err != nil { log.NewError(operationID, utils.GetSelfFuncName(), "joinTestDepartment failed", err.Error()) } + log.NewInfo(operationID, utils.GetSelfFuncName(), "random departmentID", departmentID) + if err != nil { + log.NewError(utils.GetSelfFuncName(), "GetRandomDepartmentID failed", err.Error()) + return + } groupIDList, err := GetDepartmentGroupIDList(operationID, departmentID) if err != nil { log.NewError(operationID, utils.GetSelfFuncName(), err.Error()) } - joinGroups(operationID, userID, userName, groupIDList) + joinGroups(operationID, userID, userName, faceURL, groupIDList) log.NewInfo(operationID, utils.GetSelfFuncName(), "fineshed") + oaNotification(operationID, userID) } -func createOrganizationUser(operationID, userID, userName string) error { +func createOrganizationUser(operationID, userID, userName, phoneNumber, email string) error { defer func() { log.NewInfo(operationID, utils.GetSelfFuncName(), userID) }() - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + log.NewInfo(operationID, utils.GetSelfFuncName(), "start createOrganizationUser") + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, operationID) + if etcdConn == nil { + errMsg := operationID + "getcdv3.GetConn == nil" + log.NewError(operationID, errMsg) + return errors.New(errMsg) + } client := organizationRpc.NewOrganizationClient(etcdConn) req := &organizationRpc.CreateOrganizationUserReq{ OrganizationUser: &commonPb.OrganizationUser{ @@ -48,15 +64,15 @@ func createOrganizationUser(operationID, userID, userName string) error { EnglishName: randomEnglishName(), Gender: constant.Male, CreateTime: uint32(time.Now().Unix()), + Telephone: phoneNumber, + Mobile: phoneNumber, + Email: email, }, OperationID: operationID, - OpUserID: userID, - } - if strings.Contains("@", userID) { - req.OrganizationUser.Email = userID - } else { - req.OrganizationUser.Telephone = userID + OpUserID: config.Config.Manager.AppManagerUid[0], + IsRegister: false, } + resp, err := client.CreateOrganizationUser(context.Background(), req) if err != nil { log.NewError(operationID, utils.GetSelfFuncName(), err.Error()) @@ -73,7 +89,12 @@ func joinTestDepartment(operationID, userID, departmentID string) error { defer func() { log.NewInfo(operationID, utils.GetSelfFuncName(), userID) }() - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, operationID) + if etcdConn == nil { + errMsg := operationID + "getcdv3.GetConn == nil" + log.NewError(operationID, errMsg) + return errors.New(errMsg) + } client := organizationRpc.NewOrganizationClient(etcdConn) req := &organizationRpc.CreateDepartmentMemberReq{ DepartmentMember: &commonPb.DepartmentMember{ @@ -97,7 +118,15 @@ func joinTestDepartment(operationID, userID, departmentID string) error { } func GetDepartmentGroupIDList(operationID, departmentID string) ([]string, error) { - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + defer func() { + log.NewInfo(operationID, utils.GetSelfFuncName(), departmentID) + }() + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, operationID) + if etcdConn == nil { + errMsg := operationID + "getcdv3.GetConn == nil" + log.NewError(operationID, errMsg) + return nil, errors.New(errMsg) + } client := organizationRpc.NewOrganizationClient(etcdConn) req := organizationRpc.GetDepartmentParentIDListReq{ DepartmentID: departmentID, @@ -127,11 +156,16 @@ func GetDepartmentGroupIDList(operationID, departmentID string) ([]string, error return getDepartmentParentIDListResp.GroupIDList, nil } -func joinGroups(operationID, userID, userName string, groupIDList []string) { +func joinGroups(operationID, userID, userName, faceURL string, groupIDList []string) { defer func() { log.NewInfo(operationID, utils.GetSelfFuncName(), userID, groupIDList) }() - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, operationID) + if etcdConn == nil { + errMsg := operationID + "getcdv3.GetConn == nil" + log.NewError(operationID, errMsg) + return + } client := groupRpc.NewGroupClient(etcdConn) for _, groupID := range groupIDList { req := &groupRpc.InviteUserToGroupReq{ @@ -139,7 +173,7 @@ func joinGroups(operationID, userID, userName string, groupIDList []string) { GroupID: groupID, Reason: "register auto join", InvitedUserIDList: []string{userID}, - OpUserID: userID, + OpUserID: config.Config.Manager.AppManagerUid[1], } resp, err := client.InviteUserToGroup(context.Background(), req) if err != nil { @@ -150,33 +184,73 @@ func joinGroups(operationID, userID, userName string, groupIDList []string) { log.NewError(req.OperationID, utils.GetSelfFuncName(), resp) continue } - onboardingProcessNotification(operationID, userID, groupID) + onboardingProcessNotification(operationID, userID, groupID, userName, faceURL) } } // welcome user join department notification -func onboardingProcessNotification(operationID, userID, groupID string) { +func onboardingProcessNotification(operationID, userID, groupID, userName, faceURL string) { defer func() { log.NewInfo(operationID, utils.GetSelfFuncName(), userID, groupID) }() - var tips commonPb.TipsComm - tips.DefaultTips = config.Config.Notification.JoinDepartmentNotification.DefaultTips.Tips - content, err := proto.Marshal(&tips) - if err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), "proto marshal failed") - return - } + //var tips commonPb.TipsComm + //tips.DefaultTips = config.Config.Notification.JoinDepartmentNotification.DefaultTips.Tips + //tips.JsonDetail = "" + //content, err := proto.Marshal(&tips) + //if err != nil { + // log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), "proto marshal failed") + // return + //} + welcomeString := fmt.Sprintf("欢迎%s加入部门", userName) notification := &msg.NotificationMsg{ - SendID: userID, - RecvID: groupID, - Content: content, - MsgFrom: constant.UserMsgType, - ContentType: constant.Text, - SessionType: constant.SingleChatType, - OperationID: operationID, + SendID: userID, + RecvID: groupID, + Content: []byte(welcomeString), + MsgFrom: constant.UserMsgType, + ContentType: constant.Text, + SessionType: constant.GroupChatType, + OperationID: operationID, + SenderNickname: userName, + SenderFaceURL: faceURL, } + // notification user join group msg.Notification(notification) + +} + +func oaNotification(operationID, userID string) { + var err error + elem := manage.OANotificationElem{ + NotificationName: "入职通知", + NotificationFaceURL: "", + NotificationType: 1, + Text: "欢迎你入职公司", + Url: "", + MixType: 0, + PictureElem: manage.PictureElem{}, + SoundElem: manage.SoundElem{}, + VideoElem: manage.VideoElem{}, + FileElem: manage.FileElem{}, + Ex: "", + } + sysNotification := &msg.NotificationMsg{ + SendID: config.Config.Manager.AppManagerUid[0], + RecvID: userID, + MsgFrom: constant.SysMsgType, + ContentType: constant.OANotification, + SessionType: constant.NotificationChatType, + OperationID: operationID, + } + var tips commonPb.TipsComm + tips.JsonDetail = utils.StructToJsonString(elem) + sysNotification.Content, err = proto.Marshal(&tips) + if err != nil { + log.NewError(operationID, utils.GetSelfFuncName(), "elem: ", elem, err.Error()) + return + } + + msg.Notification(sysNotification) } func randomEnglishName() string { @@ -184,14 +258,12 @@ func randomEnglishName() string { "feudal", "adverse", "exploit", "occupy", "solve", "amazing", "fantasy", "orchid", "spiky", "approve", "flap"} rand.Seed(time.Now().UnixNano()) index := rand.Intn(len(l) - 1) - fmt.Println(index) return l[index] } func randomPosition() string { - l := []string{"Golang工程师", "前端工程师", "后端工程师", "产品经理", "测试开发工程师", "运维开发工程师"} + l := []string{"后端工程师", "前端工程师", "设计师"} rand.Seed(time.Now().UnixNano()) index := rand.Intn(len(l) - 1) - fmt.Println(index) return l[index] } diff --git a/internal/demo/register/reset_password.go b/internal/demo/register/reset_password.go index b668f4f62..dc5f9a6ca 100644 --- a/internal/demo/register/reset_password.go +++ b/internal/demo/register/reset_password.go @@ -15,8 +15,9 @@ type resetPasswordRequest struct { VerificationCode string `json:"verificationCode" binding:"required"` Email string `json:"email"` PhoneNumber string `json:"phoneNumber"` - NewPassword string `json:"newPassword" binding:"required"` - OperationID string `json:"operationID"` + NewPassword string `json:"newPassword" binding:"required"` + AreaCode string `json:"areaCode"` + OperationID string `json:"operationID"` } func ResetPassword(c *gin.Context) { @@ -34,7 +35,7 @@ func ResetPassword(c *gin.Context) { account = req.PhoneNumber } if req.VerificationCode != config.Config.Demo.SuperCode { - accountKey := account + "_" + constant.VerificationCodeForResetSuffix + accountKey := req.AreaCode + account + "_" + constant.VerificationCodeForResetSuffix v, err := db.DB.GetAccountCode(accountKey) if err != nil || v != req.VerificationCode { log.NewError(req.OperationID, "password Verification code error", account, req.VerificationCode, v) @@ -42,14 +43,16 @@ func ResetPassword(c *gin.Context) { return } } - user, err := im_mysql_model.GetRegister(account) + user, err := im_mysql_model.GetRegister(account, req.AreaCode) if err != nil || user.Account == "" { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "get register error", err.Error()) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "get register error", err.Error()) + } c.JSON(http.StatusOK, gin.H{"errCode": constant.NotRegistered, "errMsg": "user not register!"}) return } if err := im_mysql_model.ResetPassword(account, req.NewPassword); err != nil { - c.JSON(http.StatusOK, gin.H{"errCode": constant.ResetPasswordFailed, "errMsg": "reset password failed: "+err.Error()}) + c.JSON(http.StatusOK, gin.H{"errCode": constant.ResetPasswordFailed, "errMsg": "reset password failed: " + err.Error()}) return } c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "reset password success"}) diff --git a/internal/demo/register/send_code.go b/internal/demo/register/send_code.go index 089a55800..6bb41f153 100644 --- a/internal/demo/register/send_code.go +++ b/internal/demo/register/send_code.go @@ -6,59 +6,88 @@ import ( "Open_IM/pkg/common/db" "Open_IM/pkg/common/db/mysql_model/im_mysql_model" "Open_IM/pkg/common/log" + "Open_IM/pkg/common/utils" "fmt" - openapi "github.com/alibabacloud-go/darabonba-openapi/client" - dysmsapi20170525 "github.com/alibabacloud-go/dysmsapi-20170525/v2/client" - "github.com/alibabacloud-go/tea/tea" "github.com/gin-gonic/gin" "gopkg.in/gomail.v2" "math/rand" "net/http" + "time" ) +var sms SMS + +func init() { + var err error + if config.Config.Demo.AliSMSVerify.Enable { + sms, err = NewAliSMS() + if err != nil { + panic(err) + } + } else { + sms, err = NewTencentSMS() + if err != nil { + panic(err) + } + } +} + type paramsVerificationCode struct { Email string `json:"email"` PhoneNumber string `json:"phoneNumber"` OperationID string `json:"operationID" binding:"required"` UsedFor int `json:"usedFor"` + AreaCode string `json:"areaCode"` } func SendVerificationCode(c *gin.Context) { params := paramsVerificationCode{} + if err := c.BindJSON(¶ms); err != nil { log.NewError("", "BindJSON failed", "err:", err.Error(), "phoneNumber", params.PhoneNumber, "email", params.Email) c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) return } + operationID := params.OperationID + if operationID == "" { + operationID = utils.OperationIDGenerator() + } + log.Info(operationID, "SendVerificationCode args: ", "area code: ", params.AreaCode, "Phone Number: ", params.PhoneNumber) var account string if params.Email != "" { account = params.Email } else { account = params.PhoneNumber } - var accountKey string + var accountKey = params.AreaCode + account if params.UsedFor == 0 { params.UsedFor = constant.VerificationCodeForRegister } switch params.UsedFor { case constant.VerificationCodeForRegister: - _, err := im_mysql_model.GetRegister(account) + _, err := im_mysql_model.GetRegister(account, params.AreaCode) if err == nil { log.NewError(params.OperationID, "The phone number has been registered", params) c.JSON(http.StatusOK, gin.H{"errCode": constant.HasRegistered, "errMsg": "The phone number has been registered"}) return } - ok, err := db.DB.JudgeAccountEXISTS(account) + accountKey = accountKey + "_" + constant.VerificationCodeForRegisterSuffix + ok, err := db.DB.JudgeAccountEXISTS(accountKey) if ok || err != nil { - log.NewError(params.OperationID, "The phone number has been registered", params) - c.JSON(http.StatusOK, gin.H{"errCode": constant.RepeatSendCode, "errMsg": "The phone number has been registered"}) + log.NewError(params.OperationID, "Repeat send code", params, accountKey) + c.JSON(http.StatusOK, gin.H{"errCode": constant.RepeatSendCode, "errMsg": "Repeat send code"}) return } - accountKey = account + "_" + constant.VerificationCodeForRegisterSuffix case constant.VerificationCodeForReset: - accountKey = account + "_" + constant.VerificationCodeForResetSuffix + accountKey = accountKey + "_" + constant.VerificationCodeForResetSuffix + ok, err := db.DB.JudgeAccountEXISTS(accountKey) + if ok || err != nil { + log.NewError(params.OperationID, "Repeat send code", params, accountKey) + c.JSON(http.StatusOK, gin.H{"errCode": constant.RepeatSendCode, "errMsg": "Repeat send code"}) + return + } } rand.Seed(time.Now().UnixNano()) code := 100000 + rand.Intn(900000) @@ -69,7 +98,7 @@ func SendVerificationCode(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"errCode": constant.SmsSendCodeErr, "errMsg": "Enter the superCode directly in the verification code box, SuperCode can be configured in config.xml"}) return } - log.NewDebug("", config.Config.Demo) + log.NewDebug(params.OperationID, config.Config.Demo) if params.Email != "" { m := gomail.NewMessage() m.SetHeader(`From`, config.Config.Demo.Mail.SenderMail) @@ -82,49 +111,75 @@ func SendVerificationCode(c *gin.Context) { return } } else { - client, err := CreateClient(tea.String(config.Config.Demo.AliSMSVerify.AccessKeyID), tea.String(config.Config.Demo.AliSMSVerify.AccessKeySecret)) - if err != nil { - log.NewError(params.OperationID, "create sendSms client err", "err", err.Error()) - c.JSON(http.StatusOK, gin.H{"errCode": constant.SmsSendCodeErr, "errMsg": "Enter the superCode directly in the verification code box, SuperCode can be configured in config.xml"}) - return - } + //client, err := CreateClient(tea.String(config.Config.Demo.AliSMSVerify.AccessKeyID), tea.String(config.Config.Demo.AliSMSVerify.AccessKeySecret)) + //if err != nil { + // log.NewError(params.OperationID, "create sendSms client err", "err", err.Error()) + // c.JSON(http.StatusOK, gin.H{"errCode": constant.SmsSendCodeErr, "errMsg": "Enter the superCode directly in the verification code box, SuperCode can be configured in config.xml"}) + // return + //} - sendSmsRequest := &dysmsapi20170525.SendSmsRequest{ - PhoneNumbers: tea.String(account), - SignName: tea.String(config.Config.Demo.AliSMSVerify.SignName), - TemplateCode: tea.String(config.Config.Demo.AliSMSVerify.VerificationCodeTemplateCode), - TemplateParam: tea.String(fmt.Sprintf("{\"code\":\"%d\"}", code)), - } - - response, err := client.SendSms(sendSmsRequest) + //sendSmsRequest := &dysmsapi20170525.SendSmsRequest{ + // PhoneNumbers: tea.String(accountKey), + // SignName: tea.String(config.Config.Demo.AliSMSVerify.SignName), + // TemplateCode: tea.String(config.Config.Demo.AliSMSVerify.VerificationCodeTemplateCode), + // TemplateParam: tea.String(fmt.Sprintf("{\"code\":\"%d\"}", code)), + //} + response, err := sms.SendSms(code, params.AreaCode+params.PhoneNumber) + //response, err := client.SendSms(sendSmsRequest) if err != nil { - log.NewError(params.OperationID, "sendSms error", account, "err", err.Error()) - c.JSON(http.StatusOK, gin.H{"errCode": constant.SmsSendCodeErr, "errMsg": "Enter the superCode directly in the verification code box, SuperCode can be configured in config.xml"}) - return - } - if *response.Body.Code != "OK" { - log.NewError(params.OperationID, "alibabacloud sendSms error", account, "err", response.Body.Code, response.Body.Message) + log.NewError(params.OperationID, "sendSms error", account, "err", err.Error(), response) c.JSON(http.StatusOK, gin.H{"errCode": constant.SmsSendCodeErr, "errMsg": "Enter the superCode directly in the verification code box, SuperCode can be configured in config.xml"}) return } } - + log.Debug(params.OperationID, "send sms success", code, accountKey) data := make(map[string]interface{}) data["account"] = account c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "Verification code has been set!", "data": data}) } -func CreateClient(accessKeyId *string, accessKeySecret *string) (result *dysmsapi20170525.Client, err error) { - c := &openapi.Config{ - // 您的AccessKey ID - AccessKeyId: accessKeyId, - // 您的AccessKey Secret - AccessKeySecret: accessKeySecret, - } - - // 访问的域名 - c.Endpoint = tea.String("dysmsapi.aliyuncs.com") - result = &dysmsapi20170525.Client{} - result, err = dysmsapi20170525.NewClient(c) - return result, err -} +//func CreateClient(accessKeyId *string, accessKeySecret *string) (result *dysmsapi20170525.Client, err error) { +// c := &openapi.Config{ +// // 您的AccessKey ID +// AccessKeyId: accessKeyId, +// // 您的AccessKey Secret +// AccessKeySecret: accessKeySecret, +// } +// +// // 访问的域名 +// c.Endpoint = tea.String("dysmsapi.aliyuncs.com") +// result = &dysmsapi20170525.Client{} +// result, err = dysmsapi20170525.NewClient(c) +// return result, err +//} +//func CreateTencentSMSClient() (string, error) { +// credential := common.NewCredential( +// config.Config.Demo.TencentSMS.SecretID, +// config.Config.Demo.TencentSMS.SecretKey, +// ) +// cpf := profile.NewClientProfile() +// client, err := sms.NewClient(credential, config.Config.Demo.TencentSMS.Region, cpf) +// if err != nil { +// return "", err +// } +// request := sms.NewSendSmsRequest() +// request.SmsSdkAppId = common.StringPtr(config.Config.Demo.TencentSMS.AppID) +// request.SignName = common.StringPtr(config.Config.Demo.TencentSMS.SignName) +// request.TemplateId = common.StringPtr(config.Config.Demo.TencentSMS.VerificationCodeTemplateCode) +// request.TemplateParamSet = common.StringPtrs([]string{"666666"}) +// request.PhoneNumberSet = common.StringPtrs([]string{"+971588232183"}) +// // 通过client对象调用想要访问的接口,需要传入请求对象 +// response, err := client.SendSms(request) +// // 非SDK异常,直接失败。实际代码中可以加入其他的处理。 +// if err != nil { +// log.Error("test", "send code to tencent err", err.Error()) +// } +// // 处理异常 +// if _, ok := err.(*errors.TencentCloudSDKError); ok { +// log.Error("test", "An API error has returned:", err.Error()) +// return "", err +// } +// +// b, _ := json.Marshal(response.Response) +// return string(b), nil +//} diff --git a/internal/demo/register/set_password.go b/internal/demo/register/set_password.go index 2b1bbbee1..c2498e653 100644 --- a/internal/demo/register/set_password.go +++ b/internal/demo/register/set_password.go @@ -10,20 +10,24 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/utils" "encoding/json" - "fmt" "github.com/gin-gonic/gin" + "math/big" "net/http" + "strconv" + "time" ) type ParamsSetPassword struct { Email string `json:"email"` - Name string `json:"name"` + Nickname string `json:"nickname"` PhoneNumber string `json:"phoneNumber"` - Password string `json:"password"` + Password string `json:"password" binding:"required"` VerificationCode string `json:"verificationCode"` Platform int32 `json:"platform" binding:"required,min=1,max=7"` Ex string `json:"ex"` + FaceURL string `json:"faceURL"` OperationID string `json:"operationID" binding:"required"` + AreaCode string `json:"areaCode"` } func SetPassword(c *gin.Context) { @@ -39,11 +43,11 @@ func SetPassword(c *gin.Context) { } else { account = params.PhoneNumber } - if params.Name == "" { - params.Name = account + if params.Nickname == "" { + params.Nickname = account } if params.VerificationCode != config.Config.Demo.SuperCode { - accountKey := account + "_" + constant.VerificationCodeForRegisterSuffix + accountKey := params.AreaCode + account + "_" + constant.VerificationCodeForRegisterSuffix v, err := db.DB.GetAccountCode(accountKey) if err != nil || v != params.VerificationCode { log.NewError(params.OperationID, "password Verification code error", account, params.VerificationCode) @@ -53,13 +57,21 @@ func SetPassword(c *gin.Context) { return } } - url := fmt.Sprintf("http://%s:%d/auth/user_register", utils.ServerIP, config.Config.Api.GinPort[0]) + //userID := utils.Base64Encode(account) + + userID := utils.Md5(params.OperationID + strconv.FormatInt(time.Now().UnixNano(), 10)) + bi := big.NewInt(0) + bi.SetString(userID[0:8], 16) + userID = bi.String() + + url := config.Config.Demo.ImAPIURL + "/auth/user_register" openIMRegisterReq := api.UserRegisterReq{} openIMRegisterReq.OperationID = params.OperationID openIMRegisterReq.Platform = params.Platform - openIMRegisterReq.UserID = account - openIMRegisterReq.Nickname = params.Name + openIMRegisterReq.UserID = userID + openIMRegisterReq.Nickname = params.Nickname openIMRegisterReq.Secret = config.Config.Secret + openIMRegisterReq.FaceURL = params.FaceURL openIMRegisterResp := api.UserRegisterResp{} bMsg, err := http2.Post(url, openIMRegisterReq, 2) if err != nil { @@ -76,8 +88,8 @@ func SetPassword(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"errCode": constant.RegisterFailed, "errMsg": "register failed: " + openIMRegisterResp.ErrMsg}) return } - log.Info(params.OperationID, "begin store mysql", account, params.Password) - err = im_mysql_model.SetPassword(account, params.Password, params.Ex) + log.Info(params.OperationID, "begin store mysql", account, params.Password, "info", params.FaceURL, params.Nickname) + err = im_mysql_model.SetPassword(account, params.Password, params.Ex, userID, params.AreaCode) if err != nil { log.NewError(params.OperationID, "set phone number password error", account, "err", err.Error()) c.JSON(http.StatusOK, gin.H{"errCode": constant.RegisterFailed, "errMsg": err.Error()}) @@ -85,7 +97,7 @@ func SetPassword(c *gin.Context) { } log.Info(params.OperationID, "end setPassword", account, params.Password) // demo onboarding - onboardingProcess(params.OperationID, account, params.Name) + onboardingProcess(params.OperationID, userID, params.Nickname, params.FaceURL, params.AreaCode+params.PhoneNumber, params.Email) c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "", "data": openIMRegisterResp.UserToken}) return } diff --git a/internal/demo/register/sms_interface.go b/internal/demo/register/sms_interface.go new file mode 100644 index 000000000..6830cc7ae --- /dev/null +++ b/internal/demo/register/sms_interface.go @@ -0,0 +1,5 @@ +package register + +type SMS interface { + SendSms(code int, phoneNumber string) (resp interface{}, err error) +} diff --git a/internal/demo/register/tencent_sms.go b/internal/demo/register/tencent_sms.go new file mode 100644 index 000000000..d83e4b724 --- /dev/null +++ b/internal/demo/register/tencent_sms.go @@ -0,0 +1,54 @@ +package register + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "encoding/json" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile" + v20210111 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms/v20210111" +) + +type TencentSMS struct { + client *v20210111.Client +} + +func (t TencentSMS) SendSms(code int, phoneNumber string) (resp interface{}, err error) { + request := v20210111.NewSendSmsRequest() + request.SmsSdkAppId = common.StringPtr(config.Config.Demo.TencentSMS.AppID) + request.SignName = common.StringPtr(config.Config.Demo.TencentSMS.SignName) + request.TemplateId = common.StringPtr(config.Config.Demo.TencentSMS.VerificationCodeTemplateCode) + request.TemplateParamSet = common.StringPtrs([]string{utils.IntToString(code)}) + request.PhoneNumberSet = common.StringPtrs([]string{phoneNumber}) + // 通过client对象调用想要访问的接口,需要传入请求对象 + response, err := t.client.SendSms(request) + // 非SDK异常,直接失败。实际代码中可以加入其他的处理。 + if err != nil { + return response, err + } + // 处理异常 + if _, ok := err.(*errors.TencentCloudSDKError); ok { + return response, err + } + b, _ := json.Marshal(response.Response) + log.Debug("tencent send message is ", code, phoneNumber, string(b)) + return response, nil +} + +func NewTencentSMS() (*TencentSMS, error) { + var a TencentSMS + credential := common.NewCredential( + config.Config.Demo.TencentSMS.SecretID, + config.Config.Demo.TencentSMS.SecretKey, + ) + cpf := profile.NewClientProfile() + client, err := v20210111.NewClient(credential, config.Config.Demo.TencentSMS.Region, cpf) + if err != nil { + return &a, err + } + a.client = client + return &a, nil + +} diff --git a/internal/demo/register/verify.go b/internal/demo/register/verify.go index fd16223e0..7777e6ec7 100644 --- a/internal/demo/register/verify.go +++ b/internal/demo/register/verify.go @@ -5,7 +5,7 @@ import ( "Open_IM/pkg/common/constant" "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" - + "Open_IM/pkg/common/utils" "github.com/gin-gonic/gin" "net/http" ) @@ -16,22 +16,28 @@ type paramsCertification struct { VerificationCode string `json:"verificationCode"` OperationID string `json:"operationID" binding:"required"` UsedFor int `json:"usedFor"` + AreaCode string `json:"areaCode"` } func Verify(c *gin.Context) { params := paramsCertification{} + operationID := params.OperationID + if err := c.BindJSON(¶ms); err != nil { - log.NewError("", "request params json parsing failed", "", "err", err.Error()) + log.NewError(operationID, "request params json parsing failed", "", "err", err.Error()) c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) return } - log.NewInfo("recv req: ", params) + if operationID == "" { + operationID = utils.OperationIDGenerator() + } + log.NewInfo(operationID, "recv req: ", params) var account string if params.Email != "" { account = params.Email } else { - account = params.PhoneNumber + account = params.AreaCode + params.PhoneNumber } if params.VerificationCode == config.Config.Demo.SuperCode { @@ -56,7 +62,7 @@ func Verify(c *gin.Context) { } code, err := db.DB.GetAccountCode(accountKey) - log.NewInfo(params.OperationID, "redis phone number and verificating Code", accountKey, code, params) + log.NewInfo(params.OperationID, "redis phone number and verificating Code", "key: ", accountKey, "code: ", code, "params: ", params) if err != nil { log.NewError(params.OperationID, "Verification code expired", accountKey, "err", err.Error()) data := make(map[string]interface{}) diff --git a/internal/msg_gateway/gate/batch_push.go b/internal/msg_gateway/gate/batch_push.go new file mode 100644 index 000000000..76055d23b --- /dev/null +++ b/internal/msg_gateway/gate/batch_push.go @@ -0,0 +1,117 @@ +package gate + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbChat "Open_IM/pkg/proto/chat" + sdk_ws "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "strings" +) + +var MaxPullMsgNum = 100 + +func (r *RPCServer) GenPullSeqList(currentSeq uint32, operationID string, userID string) ([]uint32, error) { + maxSeq, err := db.DB.GetUserMaxSeq(userID) + if err != nil { + log.Error(operationID, "GetUserMaxSeq failed ", userID, err.Error()) + return nil, utils.Wrap(err, "") + } + + var seqList []uint32 + num := 0 + for i := currentSeq + 1; i < uint32(maxSeq); i++ { + seqList = append(seqList, i) + num++ + if num == MaxPullMsgNum { + break + } + } + log.Info(operationID, "GenPullSeqList ", seqList, "current seq", currentSeq) + return seqList, nil +} + +func (r *RPCServer) GetSingleUserMsgForPushPlatforms(operationID string, msgData *sdk_ws.MsgData, pushToUserID string, platformIDList []int) map[int]*sdk_ws.MsgDataList { + user2PushMsg := make(map[int]*sdk_ws.MsgDataList, 0) + for _, v := range platformIDList { + user2PushMsg[v] = r.GetSingleUserMsgForPush(operationID, msgData, pushToUserID, v) + //log.Info(operationID, "GetSingleUserMsgForPush", msgData.Seq, pushToUserID, v, "len:", len(user2PushMsg[v])) + } + return user2PushMsg +} + +func (r *RPCServer) GetSingleUserMsgForPush(operationID string, msgData *sdk_ws.MsgData, pushToUserID string, platformID int) *sdk_ws.MsgDataList { + //msgData.MsgDataList = nil + return &sdk_ws.MsgDataList{MsgDataList: []*sdk_ws.MsgData{msgData}} + + //userConn := ws.getUserConn(pushToUserID, platformID) + //if userConn == nil { + // log.Debug(operationID, "userConn == nil") + // return []*sdk_ws.MsgData{msgData} + //} + // + //if msgData.Seq <= userConn.PushedMaxSeq { + // log.Debug(operationID, "msgData.Seq <= userConn.PushedMaxSeq", msgData.Seq, userConn.PushedMaxSeq) + // return nil + //} + // + //msgList := r.GetSingleUserMsg(operationID, msgData.Seq, pushToUserID) + //if msgList == nil { + // log.Debug(operationID, "GetSingleUserMsg msgList == nil", msgData.Seq, userConn.PushedMaxSeq) + // userConn.PushedMaxSeq = msgData.Seq + // return []*sdk_ws.MsgData{msgData} + //} + //msgList = append(msgList, msgData) + // + //for _, v := range msgList { + // if v.Seq > userConn.PushedMaxSeq { + // userConn.PushedMaxSeq = v.Seq + // } + //} + //log.Debug(operationID, "GetSingleUserMsg msgList len ", len(msgList), userConn.PushedMaxSeq) + //return msgList +} + +func (r *RPCServer) GetSingleUserMsg(operationID string, currentMsgSeq uint32, userID string) []*sdk_ws.MsgData { + seqList, err := r.GenPullSeqList(currentMsgSeq, operationID, userID) + if err != nil { + log.Error(operationID, "GenPullSeqList failed ", err.Error(), currentMsgSeq, userID) + return nil + } + if len(seqList) == 0 { + log.Error(operationID, "GenPullSeqList len == 0 ", currentMsgSeq, userID) + return nil + } + rpcReq := sdk_ws.PullMessageBySeqListReq{} + rpcReq.SeqList = seqList + rpcReq.UserID = userID + rpcReq.OperationID = operationID + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, rpcReq.OperationID) + if grpcConn == nil { + errMsg := "getcdv3.GetConn == nil" + log.NewError(rpcReq.OperationID, errMsg) + return nil + } + + msgClient := pbChat.NewChatClient(grpcConn) + reply, err := msgClient.PullMessageBySeqList(context.Background(), &rpcReq) + if err != nil { + log.Error(operationID, "PullMessageBySeqList failed ", err.Error(), rpcReq.String()) + return nil + } + if len(reply.List) == 0 { + return nil + } + return reply.List +} + +//func (r *RPCServer) GetBatchUserMsgForPush(operationID string, msgData *sdk_ws.MsgData, pushToUserIDList []string, platformID int) map[string][]*sdk_ws.MsgData { +// user2PushMsg := make(map[string][]*sdk_ws.MsgData, 0) +// for _, v := range pushToUserIDList { +// user2PushMsg[v] = r.GetSingleUserMsgForPush(operationID, msgData, v, platformID) +// } +// return user2PushMsg +//} diff --git a/internal/msg_gateway/gate/callback.go b/internal/msg_gateway/gate/callback.go new file mode 100644 index 000000000..02b771a97 --- /dev/null +++ b/internal/msg_gateway/gate/callback.go @@ -0,0 +1,57 @@ +package gate + +import ( + cbApi "Open_IM/pkg/call_back_struct" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/http" + http2 "net/http" + "time" +) + +func callbackUserOnline(operationID, userID string, platformID int, token string) cbApi.CommonCallbackResp { + callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} + if !config.Config.Callback.CallbackUserOnline.Enable { + return callbackResp + } + callbackUserOnlineReq := cbApi.CallbackUserOnlineReq{ + Token: token, + UserStatusCallbackReq: cbApi.UserStatusCallbackReq{ + CallbackCommand: constant.CallbackUserOnlineCommand, + OperationID: operationID, + UserID: userID, + PlatformID: int32(platformID), + Platform: constant.PlatformIDToName(platformID), + }, + Seq: int(time.Now().UnixNano() / 1e6), + } + callbackUserOnlineResp := &cbApi.CallbackUserOnlineResp{CommonCallbackResp: callbackResp} + if err := http.PostReturn(config.Config.Callback.CallbackUrl, callbackUserOnlineReq, callbackUserOnlineResp, config.Config.Callback.CallbackUserOnline.CallbackTimeOut); err != nil { + callbackResp.ErrCode = http2.StatusInternalServerError + callbackResp.ErrMsg = err.Error() + } + return callbackResp +} + +func callbackUserOffline(operationID, userID string, platformID int) cbApi.CommonCallbackResp { + callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} + if !config.Config.Callback.CallbackUserOffline.Enable { + return callbackResp + } + callbackOfflineReq := cbApi.CallbackUserOfflineReq{ + UserStatusCallbackReq: cbApi.UserStatusCallbackReq{ + CallbackCommand: constant.CallbackUserOfflineCommand, + OperationID: operationID, + UserID: userID, + PlatformID: int32(platformID), + Platform: constant.PlatformIDToName(platformID), + }, + Seq: int(time.Now().UnixNano() / 1e6), + } + callbackUserOfflineResp := &cbApi.CallbackUserOfflineResp{CommonCallbackResp: callbackResp} + if err := http.PostReturn(config.Config.Callback.CallbackUrl, callbackOfflineReq, callbackUserOfflineResp, config.Config.Callback.CallbackUserOffline.CallbackTimeOut); err != nil { + callbackResp.ErrCode = http2.StatusInternalServerError + callbackResp.ErrMsg = err.Error() + } + return callbackResp +} diff --git a/internal/msg_gateway/gate/init.go b/internal/msg_gateway/gate/init.go index 5cf682b84..60c97f1de 100644 --- a/internal/msg_gateway/gate/init.go +++ b/internal/msg_gateway/gate/init.go @@ -19,6 +19,8 @@ var ( sendMsgFailedCount uint64 sendMsgSuccessCount uint64 userCount uint64 + + sendMsgAllCountLock sync.RWMutex ) func Init(rpcPort, wsPort int) { diff --git a/internal/msg_gateway/gate/logic.go b/internal/msg_gateway/gate/logic.go index 51955f0fe..60ba0ab2c 100644 --- a/internal/msg_gateway/gate/logic.go +++ b/internal/msg_gateway/gate/logic.go @@ -3,6 +3,7 @@ package gate import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" pbChat "Open_IM/pkg/proto/chat" @@ -19,19 +20,12 @@ import ( ) func (ws *WServer) msgParse(conn *UserConn, binaryMsg []byte) { - //ws online debug data - //{"ReqIdentifier":1001,"Token":"123","SendID":"c4ca4238a0b923820dcc509a6f75849b","Time":"123","OperationID":"123","MsgIncr":0} - //{"ReqIdentifier":1002,"Token":"123","SendID":"c4ca4238a0b923820dcc509a6f75849b","Time":"123","OperationID":"123","MsgIncr":0,"SeqBegin":1,"SeqEnd":6} - //{"ReqIdentifier":1003,"Token":"123","SendID":"c4ca4238a0b923820dcc509a6f75849b", - //"RecvID":"a87ff679a2f3e71d9181a67b7542122c","ClientMsgID":"2343","Time":"147878787","OperationID": - //"123","MsgIncr":0,"SubMsgType":101,"MsgType":100,"MsgFrom":1,"Content":"sdfsdf"} b := bytes.NewBuffer(binaryMsg) m := Req{} dec := gob.NewDecoder(b) err := dec.Decode(&m) if err != nil { log.NewError("", "ws Decode err", err.Error()) - ws.sendErrMsg(conn, 200, err.Error(), constant.WSDataError, "", "") err = conn.Close() if err != nil { log.NewError("", "ws close err", err.Error()) @@ -43,49 +37,69 @@ func (ws *WServer) msgParse(conn *UserConn, binaryMsg []byte) { ws.sendErrMsg(conn, 201, err.Error(), m.ReqIdentifier, m.MsgIncr, m.OperationID) return } - //if !utils.VerifyToken(m.Token, m.SendID) { - // ws.sendErrMsg(conn, 202, "token validate err", m.ReqIdentifier, m.MsgIncr,m.OperationID) - // return - //} - log.NewInfo(m.OperationID, "Basic Info Authentication Success", m) + log.NewInfo(m.OperationID, "Basic Info Authentication Success", m.SendID, m.MsgIncr, m.ReqIdentifier) switch m.ReqIdentifier { case constant.WSGetNewestSeq: + log.NewInfo(m.OperationID, "getSeqReq ", m.SendID, m.MsgIncr, m.ReqIdentifier) ws.getSeqReq(conn, &m) case constant.WSSendMsg: + log.NewInfo(m.OperationID, "sendMsgReq ", m.SendID, m.MsgIncr, m.ReqIdentifier) ws.sendMsgReq(conn, &m) case constant.WSSendSignalMsg: + log.NewInfo(m.OperationID, "sendSignalMsgReq ", m.SendID, m.MsgIncr, m.ReqIdentifier) ws.sendSignalMsgReq(conn, &m) case constant.WSPullMsgBySeqList: + log.NewInfo(m.OperationID, "pullMsgBySeqListReq ", m.SendID, m.MsgIncr, m.ReqIdentifier) ws.pullMsgBySeqListReq(conn, &m) default: + log.Error(m.OperationID, "ReqIdentifier failed ", m.SendID, m.MsgIncr, m.ReqIdentifier) } log.NewInfo(m.OperationID, "goroutine num is ", runtime.NumGoroutine()) } + func (ws *WServer) getSeqReq(conn *UserConn, m *Req) { - log.NewInfo(m.OperationID, "Ws call success to getNewSeq", m.MsgIncr, m.SendID, m.ReqIdentifier, m.Data) - rpcReq := pbChat.GetMaxAndMinSeqReq{} - nReply := new(pbChat.GetMaxAndMinSeqResp) - rpcReq.UserID = m.SendID - rpcReq.OperationID = m.OperationID - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) - msgClient := pbChat.NewChatClient(grpcConn) - rpcReply, err := msgClient.GetMaxAndMinSeq(context.Background(), &rpcReq) - if err != nil { - log.Error(rpcReq.OperationID, "rpc call failed to getSeqReq", err, rpcReq.String()) - nReply.ErrCode = 500 - nReply.ErrMsg = err.Error() - ws.getSeqResp(conn, m, nReply) + log.NewInfo(m.OperationID, "Ws call success to getNewSeq", m.MsgIncr, m.SendID, m.ReqIdentifier) + nReply := new(sdk_ws.GetMaxAndMinSeqResp) + isPass, errCode, errMsg, data := ws.argsValidate(m, constant.WSGetNewestSeq, m.OperationID) + log.Info(m.OperationID, "argsValidate ", isPass, errCode, errMsg) + if isPass { + rpcReq := sdk_ws.GetMaxAndMinSeqReq{} + rpcReq.GroupIDList = data.(sdk_ws.GetMaxAndMinSeqReq).GroupIDList + rpcReq.UserID = m.SendID + rpcReq.OperationID = m.OperationID + log.Debug(m.OperationID, "Ws call success to getMaxAndMinSeq", m.SendID, m.ReqIdentifier, m.MsgIncr, data.(sdk_ws.GetMaxAndMinSeqReq).GroupIDList) + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, rpcReq.OperationID) + if grpcConn == nil { + errMsg := rpcReq.OperationID + "getcdv3.GetConn == nil" + nReply.ErrCode = 500 + nReply.ErrMsg = errMsg + log.NewError(rpcReq.OperationID, errMsg) + ws.getSeqResp(conn, m, nReply) + return + } + msgClient := pbChat.NewChatClient(grpcConn) + rpcReply, err := msgClient.GetMaxAndMinSeq(context.Background(), &rpcReq) + if err != nil { + nReply.ErrCode = 500 + nReply.ErrMsg = err.Error() + log.Error(rpcReq.OperationID, "rpc call failed to GetMaxAndMinSeq ", nReply.String()) + ws.getSeqResp(conn, m, nReply) + } else { + log.NewInfo(rpcReq.OperationID, "rpc call success to getSeqReq", rpcReply.String()) + ws.getSeqResp(conn, m, rpcReply) + } } else { - log.NewInfo(rpcReq.OperationID, "rpc call success to getSeqReq", rpcReply.String()) - ws.getSeqResp(conn, m, rpcReply) + nReply.ErrCode = errCode + nReply.ErrMsg = errMsg + log.Error(m.OperationID, "argsValidate failed send resp: ", nReply.String()) + ws.getSeqResp(conn, m, nReply) } } -func (ws *WServer) getSeqResp(conn *UserConn, m *Req, pb *pbChat.GetMaxAndMinSeqResp) { - var mReplyData sdk_ws.GetMaxAndMinSeqResp - mReplyData.MaxSeq = pb.GetMaxSeq() - mReplyData.MinSeq = pb.GetMinSeq() - b, _ := proto.Marshal(&mReplyData) + +func (ws *WServer) getSeqResp(conn *UserConn, m *Req, pb *sdk_ws.GetMaxAndMinSeqResp) { + + b, _ := proto.Marshal(pb) mReply := Resp{ ReqIdentifier: m.ReqIdentifier, MsgIncr: m.MsgIncr, @@ -94,20 +108,31 @@ func (ws *WServer) getSeqResp(conn *UserConn, m *Req, pb *pbChat.GetMaxAndMinSeq OperationID: m.OperationID, Data: b, } + log.Debug(m.OperationID, "getSeqResp come here req: ", pb.String(), "send resp: ", + mReply.ReqIdentifier, mReply.MsgIncr, mReply.ErrCode, mReply.ErrMsg) ws.sendMsg(conn, mReply) } func (ws *WServer) pullMsgBySeqListReq(conn *UserConn, m *Req) { - log.NewInfo(m.OperationID, "Ws call success to pullMsgBySeqListReq start", m.SendID, m.ReqIdentifier, m.MsgIncr, m.Data) + log.NewInfo(m.OperationID, "Ws call success to pullMsgBySeqListReq start", m.SendID, m.ReqIdentifier, m.MsgIncr, string(m.Data)) nReply := new(sdk_ws.PullMessageBySeqListResp) - isPass, errCode, errMsg, data := ws.argsValidate(m, constant.WSPullMsgBySeqList) + isPass, errCode, errMsg, data := ws.argsValidate(m, constant.WSPullMsgBySeqList, m.OperationID) if isPass { rpcReq := sdk_ws.PullMessageBySeqListReq{} rpcReq.SeqList = data.(sdk_ws.PullMessageBySeqListReq).SeqList rpcReq.UserID = m.SendID rpcReq.OperationID = m.OperationID + rpcReq.GroupSeqList = data.(sdk_ws.PullMessageBySeqListReq).GroupSeqList log.NewInfo(m.OperationID, "Ws call success to pullMsgBySeqListReq middle", m.SendID, m.ReqIdentifier, m.MsgIncr, data.(sdk_ws.PullMessageBySeqListReq).SeqList) - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, m.OperationID) + if grpcConn == nil { + errMsg := rpcReq.OperationID + "getcdv3.GetConn == nil" + nReply.ErrCode = 500 + nReply.ErrMsg = errMsg + log.NewError(rpcReq.OperationID, errMsg) + ws.pullMsgBySeqListResp(conn, m, nReply) + return + } msgClient := pbChat.NewChatClient(grpcConn) reply, err := msgClient.PullMessageBySeqList(context.Background(), &rpcReq) if err != nil { @@ -143,10 +168,13 @@ func (ws *WServer) pullMsgBySeqListResp(conn *UserConn, m *Req, pb *sdk_ws.PullM } func (ws *WServer) sendMsgReq(conn *UserConn, m *Req) { + sendMsgAllCountLock.Lock() sendMsgAllCount++ - log.NewInfo(m.OperationID, "Ws call success to sendMsgReq start", m.MsgIncr, m.ReqIdentifier, m.SendID, m.Data) + sendMsgAllCountLock.Unlock() + log.NewInfo(m.OperationID, "Ws call success to sendMsgReq start", m.MsgIncr, m.ReqIdentifier, m.SendID) + nReply := new(pbChat.SendMsgResp) - isPass, errCode, errMsg, pData := ws.argsValidate(m, constant.WSSendMsg) + isPass, errCode, errMsg, pData := ws.argsValidate(m, constant.WSSendMsg, m.OperationID) if isPass { data := pData.(sdk_ws.MsgData) pbData := pbChat.SendMsgReq{ @@ -154,8 +182,16 @@ func (ws *WServer) sendMsgReq(conn *UserConn, m *Req) { OperationID: m.OperationID, MsgData: &data, } - log.NewInfo(m.OperationID, "Ws call success to sendMsgReq middle", m.ReqIdentifier, m.SendID, m.MsgIncr, data) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + log.NewInfo(m.OperationID, "Ws call success to sendMsgReq middle", m.ReqIdentifier, m.SendID, m.MsgIncr, data.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, m.OperationID) + if etcdConn == nil { + errMsg := m.OperationID + "getcdv3.GetConn == nil" + nReply.ErrCode = 500 + nReply.ErrMsg = errMsg + log.NewError(m.OperationID, errMsg) + ws.sendMsgResp(conn, m, nReply) + return + } client := pbChat.NewChatClient(etcdConn) reply, err := client.SendMsg(context.Background(), &pbData) if err != nil { @@ -176,8 +212,6 @@ func (ws *WServer) sendMsgReq(conn *UserConn, m *Req) { } func (ws *WServer) sendMsgResp(conn *UserConn, m *Req, pb *pbChat.SendMsgResp) { - // := make(map[string]interface{}) - var mReplyData sdk_ws.UserSendMsgResp mReplyData.ClientMsgID = pb.GetClientMsgID() mReplyData.ServerMsgID = pb.GetServerMsgID() @@ -195,12 +229,18 @@ func (ws *WServer) sendMsgResp(conn *UserConn, m *Req, pb *pbChat.SendMsgResp) { } func (ws *WServer) sendSignalMsgReq(conn *UserConn, m *Req) { - log.NewInfo(m.OperationID, "Ws call success to sendSignalMsgReq start", m.MsgIncr, m.ReqIdentifier, m.SendID, m.Data) + log.NewInfo(m.OperationID, "Ws call success to sendSignalMsgReq start", m.MsgIncr, m.ReqIdentifier, m.SendID, string(m.Data)) nReply := new(pbChat.SendMsgResp) - isPass, errCode, errMsg, pData := ws.argsValidate(m, constant.WSSendSignalMsg) + isPass, errCode, errMsg, pData := ws.argsValidate(m, constant.WSSendSignalMsg, m.OperationID) if isPass { signalResp := pbRtc.SignalResp{} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImRealTimeCommName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImRealTimeCommName, m.OperationID) + if etcdConn == nil { + errMsg := m.OperationID + "getcdv3.GetConn == nil" + log.NewError(m.OperationID, errMsg) + ws.sendSignalMsgResp(conn, 204, errMsg, m, &signalResp) + return + } rtcClient := pbRtc.NewRtcServiceClient(etcdConn) req := &pbRtc.SignalMessageAssembleReq{ SignalReq: pData.(*pbRtc.SignalReq), @@ -224,7 +264,13 @@ func (ws *WServer) sendSignalMsgReq(conn *UserConn, m *Req) { } log.NewInfo(m.OperationID, utils.GetSelfFuncName(), "pbData: ", pbData) log.NewInfo(m.OperationID, "Ws call success to sendSignalMsgReq middle", m.ReqIdentifier, m.SendID, m.MsgIncr, msgData) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, m.OperationID) + if etcdConn == nil { + errMsg := m.OperationID + "getcdv3.GetConn == nil" + log.NewError(m.OperationID, errMsg) + ws.sendSignalMsgResp(conn, 200, errMsg, m, &signalResp) + return + } client := pbChat.NewChatClient(etcdConn) reply, err := client.SendMsg(context.Background(), &pbData) if err != nil { @@ -233,7 +279,7 @@ func (ws *WServer) sendSignalMsgReq(conn *UserConn, m *Req) { nReply.ErrMsg = err.Error() ws.sendSignalMsgResp(conn, 200, err.Error(), m, &signalResp) } else { - log.NewInfo(pbData.OperationID, "rpc call success to sendMsgReq", reply.String()) + log.NewInfo(pbData.OperationID, "rpc call success to sendMsgReq", reply.String(), signalResp.String(), m) ws.sendSignalMsgResp(conn, 0, "", m, &signalResp) } } else { @@ -247,7 +293,7 @@ func (ws *WServer) sendSignalMsgReq(conn *UserConn, m *Req) { } func (ws *WServer) sendSignalMsgResp(conn *UserConn, errCode int32, errMsg string, m *Req, pb *pbRtc.SignalResp) { // := make(map[string]interface{}) - log.Debug(m.OperationID, "SignalMsgResp is", pb.String()) + log.Debug(m.OperationID, "sendSignalMsgResp is", pb.String()) b, _ := proto.Marshal(pb) mReply := Resp{ ReqIdentifier: m.ReqIdentifier, @@ -264,14 +310,16 @@ func (ws *WServer) sendMsg(conn *UserConn, mReply interface{}) { enc := gob.NewEncoder(&b) err := enc.Encode(mReply) if err != nil { - uid, platform := ws.getUserUid(conn) - log.NewError(mReply.(Resp).OperationID, mReply.(Resp).ReqIdentifier, mReply.(Resp).ErrCode, mReply.(Resp).ErrMsg, "Encode Msg error", conn.RemoteAddr().String(), uid, platform, err.Error()) + // uid, platform := ws.getUserUid(conn) + log.NewError(mReply.(Resp).OperationID, mReply.(Resp).ReqIdentifier, mReply.(Resp).ErrCode, mReply.(Resp).ErrMsg, "Encode Msg error", conn.RemoteAddr().String(), err.Error()) return } err = ws.writeMsg(conn, websocket.BinaryMessage, b.Bytes()) if err != nil { - uid, platform := ws.getUserUid(conn) - log.NewError(mReply.(Resp).OperationID, mReply.(Resp).ReqIdentifier, mReply.(Resp).ErrCode, mReply.(Resp).ErrMsg, "WS WriteMsg error", conn.RemoteAddr().String(), uid, platform, err.Error()) + // uid, platform := ws.getUserUid(conn) + log.NewError(mReply.(Resp).OperationID, mReply.(Resp).ReqIdentifier, mReply.(Resp).ErrCode, mReply.(Resp).ErrMsg, "ws writeMsg error", conn.RemoteAddr().String(), err.Error()) + } else { + log.Debug(mReply.(Resp).OperationID, mReply.(Resp).ReqIdentifier, mReply.(Resp).ErrCode, mReply.(Resp).ErrMsg, "ws write response success") } } func (ws *WServer) sendErrMsg(conn *UserConn, errCode int32, errMsg string, reqIdentifier int32, msgIncr string, operationID string) { @@ -284,3 +332,19 @@ func (ws *WServer) sendErrMsg(conn *UserConn, errCode int32, errMsg string, reqI } ws.sendMsg(conn, mReply) } + +func SetTokenKicked(userID string, platformID int, operationID string) { + m, err := db.DB.GetTokenMapByUidPid(userID, constant.PlatformIDToName(platformID)) + if err != nil { + log.Error(operationID, "GetTokenMapByUidPid failed ", err.Error(), userID, constant.PlatformIDToName(platformID)) + return + } + for k, _ := range m { + m[k] = constant.KickedToken + } + err = db.DB.SetTokenMapByUidPid(userID, platformID, m) + if err != nil { + log.Error(operationID, "SetTokenMapByUidPid failed ", err.Error(), userID, constant.PlatformIDToName(platformID)) + return + } +} diff --git a/internal/msg_gateway/gate/rpc_server.go b/internal/msg_gateway/gate/rpc_server.go index 555015bb7..c8eb15538 100644 --- a/internal/msg_gateway/gate/rpc_server.go +++ b/internal/msg_gateway/gate/rpc_server.go @@ -7,6 +7,7 @@ import ( "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" pbRelay "Open_IM/pkg/proto/relay" + sdk_ws "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "bytes" "context" @@ -25,6 +26,8 @@ type RPCServer struct { rpcRegisterName string etcdSchema string etcdAddr []string + platformList []int + pushTerminal []int } func (r *RPCServer) onInit(rpcPort int) { @@ -32,6 +35,8 @@ func (r *RPCServer) onInit(rpcPort int) { r.rpcRegisterName = config.Config.RpcRegisterName.OpenImOnlineMessageRelayName r.etcdSchema = config.Config.Etcd.EtcdSchema r.etcdAddr = config.Config.Etcd.EtcdAddr + r.platformList = genPlatformArray() + r.pushTerminal = []int{constant.IOSPlatformID, constant.AndroidPlatformID} } func (r *RPCServer) run() { listenIP := "" @@ -50,7 +55,7 @@ func (r *RPCServer) run() { defer srv.GracefulStop() pbRelay.RegisterOnlineMessageRelayServiceServer(srv, r) - rpcRegisterIP := "" + rpcRegisterIP := config.Config.RpcRegisterIP if config.Config.RpcRegisterIP == "" { rpcRegisterIP, err = utils.GetLocalIP() if err != nil { @@ -69,7 +74,7 @@ func (r *RPCServer) run() { } func (r *RPCServer) OnlinePushMsg(_ context.Context, in *pbRelay.OnlinePushMsgReq) (*pbRelay.OnlinePushMsgResp, error) { log.NewInfo(in.OperationID, "PushMsgToUser is arriving", in.String()) - var resp []*pbRelay.SingleMsgToUser + var resp []*pbRelay.SingleMsgToUserPlatform msgBytes, _ := proto.Marshal(in.MsgData) mReply := Resp{ ReqIdentifier: constant.WSPushMsg, @@ -84,22 +89,21 @@ func (r *RPCServer) OnlinePushMsg(_ context.Context, in *pbRelay.OnlinePushMsgRe } var tag bool recvID := in.PushToUserID - platformList := genPlatformArray() - for _, v := range platformList { + for _, v := range r.platformList { if conn := ws.getUserConn(recvID, v); conn != nil { tag = true resultCode := sendMsgToUser(conn, replyBytes.Bytes(), in, v, recvID) - temp := &pbRelay.SingleMsgToUser{ + temp := &pbRelay.SingleMsgToUserPlatform{ ResultCode: resultCode, RecvID: recvID, - RecvPlatFormID: constant.PlatformNameToID(v), + RecvPlatFormID: int32(v), } resp = append(resp, temp) } else { - temp := &pbRelay.SingleMsgToUser{ + temp := &pbRelay.SingleMsgToUserPlatform{ ResultCode: -1, RecvID: recvID, - RecvPlatFormID: constant.PlatformNameToID(v), + RecvPlatFormID: int32(v), } resp = append(resp, temp) } @@ -119,19 +123,19 @@ func (r *RPCServer) GetUsersOnlineStatus(_ context.Context, req *pbRelay.GetUser } var resp pbRelay.GetUsersOnlineStatusResp for _, userID := range req.UserIDList { - platformList := genPlatformArray() temp := new(pbRelay.GetUsersOnlineStatusResp_SuccessResult) temp.UserID = userID - for _, platform := range platformList { - if conn := ws.getUserConn(userID, platform); conn != nil { + userConnMap := ws.getUserAllCons(userID) + for platform, userConn := range userConnMap { + if userConn != nil { ps := new(pbRelay.GetUsersOnlineStatusResp_SuccessDetail) - ps.Platform = platform + ps.Platform = constant.PlatformIDToName(platform) ps.Status = constant.OnlineStatus temp.Status = constant.OnlineStatus temp.DetailPlatformStatus = append(temp.DetailPlatformStatus, ps) - } } + if temp.Status == constant.OnlineStatus { resp.SuccessResult = append(resp.SuccessResult, temp) } @@ -139,11 +143,169 @@ func (r *RPCServer) GetUsersOnlineStatus(_ context.Context, req *pbRelay.GetUser log.NewInfo(req.OperationID, "GetUsersOnlineStatus rpc return ", resp.String()) return &resp, nil } -func sendMsgToUser(conn *UserConn, bMsg []byte, in *pbRelay.OnlinePushMsgReq, RecvPlatForm, RecvID string) (ResultCode int64) { + +func (r *RPCServer) SuperGroupOnlineBatchPushOneMsg(_ context.Context, req *pbRelay.OnlineBatchPushOneMsgReq) (*pbRelay.OnlineBatchPushOneMsgResp, error) { + log.NewInfo(req.OperationID, "BatchPushMsgToUser is arriving", req.String()) + var singleUserResult []*pbRelay.SingelMsgToUserResultList + //r.GetBatchMsgForPush(req.OperationID,req.MsgData,req.PushToUserIDList,) + msgBytes, _ := proto.Marshal(req.MsgData) + mReply := Resp{ + ReqIdentifier: constant.WSPushMsg, + OperationID: req.OperationID, + Data: msgBytes, + } + var replyBytes bytes.Buffer + enc := gob.NewEncoder(&replyBytes) + err := enc.Encode(mReply) + if err != nil { + log.NewError(req.OperationID, "data encode err", err.Error()) + } + for _, v := range req.PushToUserIDList { + var resp []*pbRelay.SingleMsgToUserPlatform + tempT := &pbRelay.SingelMsgToUserResultList{ + UserID: v, + } + userConnMap := ws.getUserAllCons(v) + for platform, userConn := range userConnMap { + if userConn != nil { + resultCode := sendMsgBatchToUser(userConn, replyBytes.Bytes(), req, platform, v) + if resultCode == 0 && utils.IsContainInt(platform, r.pushTerminal) { + tempT.OnlinePush = true + log.Info(req.OperationID, "PushSuperMsgToUser is success By Ws", "args", req.String(), "recvPlatForm", constant.PlatformIDToName(platform), "recvID", v) + temp := &pbRelay.SingleMsgToUserPlatform{ + ResultCode: resultCode, + RecvID: v, + RecvPlatFormID: int32(platform), + } + resp = append(resp, temp) + } + + } + } + tempT.Resp = resp + singleUserResult = append(singleUserResult, tempT) + + } + + return &pbRelay.OnlineBatchPushOneMsgResp{ + SinglePushResult: singleUserResult, + }, nil +} +func (r *RPCServer) OnlineBatchPushOneMsg(_ context.Context, req *pbRelay.OnlineBatchPushOneMsgReq) (*pbRelay.OnlineBatchPushOneMsgResp, error) { + log.NewInfo(req.OperationID, "BatchPushMsgToUser is arriving", req.String()) + var singleUserResult []*pbRelay.SingelMsgToUserResultList + + for _, v := range req.PushToUserIDList { + var resp []*pbRelay.SingleMsgToUserPlatform + tempT := &pbRelay.SingelMsgToUserResultList{ + UserID: v, + } + userConnMap := ws.getUserAllCons(v) + var platformList []int + for k, _ := range userConnMap { + platformList = append(platformList, k) + } + log.Debug(req.OperationID, "GetSingleUserMsgForPushPlatforms begin", req.MsgData.Seq, v, platformList, req.MsgData.String()) + needPushMapList := r.GetSingleUserMsgForPushPlatforms(req.OperationID, req.MsgData, v, platformList) + log.Debug(req.OperationID, "GetSingleUserMsgForPushPlatforms end", req.MsgData.Seq, v, platformList, len(needPushMapList)) + for platform, list := range needPushMapList { + if list != nil { + log.Debug(req.OperationID, "needPushMapList ", "userID: ", v, "platform: ", platform, "push msg num:") + //for _, v := range list { + // log.Debug(req.OperationID, "req.MsgData.MsgDataList begin", "len: ", len(req.MsgData.MsgDataList), v.String()) + // req.MsgData.MsgDataList = append(req.MsgData.MsgDataList, v) + // log.Debug(req.OperationID, "req.MsgData.MsgDataList end", "len: ", len(req.MsgData.MsgDataList)) + //} + msgBytes, err := proto.Marshal(list) + if err != nil { + log.Error(req.OperationID, "proto marshal err", err.Error()) + continue + } + req.MsgData.MsgDataList = msgBytes + //req.MsgData.MsgDataList = append(req.MsgData.MsgDataList, v) + log.Debug(req.OperationID, "r.encodeWsData no string") + //log.Debug(req.OperationID, "r.encodeWsData data0 list ", req.MsgData.MsgDataList[0].String()) + + log.Debug(req.OperationID, "r.encodeWsData ", req.MsgData.String()) + replyBytes, err := r.encodeWsData(req.MsgData, req.OperationID) + if err != nil { + log.Error(req.OperationID, "encodeWsData failed ", req.MsgData.String()) + continue + } + log.Debug(req.OperationID, "encodeWsData", "len: ", replyBytes.Len()) + resultCode := sendMsgBatchToUser(userConnMap[platform], replyBytes.Bytes(), req, platform, v) + if resultCode == 0 && utils.IsContainInt(platform, r.pushTerminal) { + tempT.OnlinePush = true + log.Info(req.OperationID, "PushSuperMsgToUser is success By Ws", "args", req.String(), "recv PlatForm", constant.PlatformIDToName(platform), "recvID", v) + temp := &pbRelay.SingleMsgToUserPlatform{ + ResultCode: resultCode, + RecvID: v, + RecvPlatFormID: int32(platform), + } + resp = append(resp, temp) + } + } else { + if utils.IsContainInt(platform, r.pushTerminal) { + tempT.OnlinePush = true + temp := &pbRelay.SingleMsgToUserPlatform{ + ResultCode: 0, + RecvID: v, + RecvPlatFormID: int32(platform), + } + resp = append(resp, temp) + } + } + } + tempT.Resp = resp + singleUserResult = append(singleUserResult, tempT) + } + return &pbRelay.OnlineBatchPushOneMsgResp{ + SinglePushResult: singleUserResult, + }, nil +} +func (r *RPCServer) encodeWsData(wsData *sdk_ws.MsgData, operationID string) (bytes.Buffer, error) { + log.Debug(operationID, "encodeWsData begin", wsData.String()) + msgBytes, err := proto.Marshal(wsData) + if err != nil { + log.NewError(operationID, "Marshal", err.Error()) + return bytes.Buffer{}, utils.Wrap(err, "") + } + log.Debug(operationID, "encodeWsData begin", wsData.String()) + mReply := Resp{ + ReqIdentifier: constant.WSPushMsg, + OperationID: operationID, + Data: msgBytes, + } + var replyBytes bytes.Buffer + enc := gob.NewEncoder(&replyBytes) + err = enc.Encode(mReply) + if err != nil { + log.NewError(operationID, "data encode err", err.Error()) + return bytes.Buffer{}, utils.Wrap(err, "") + } + return replyBytes, nil +} + +func (r *RPCServer) KickUserOffline(_ context.Context, req *pbRelay.KickUserOfflineReq) (*pbRelay.KickUserOfflineResp, error) { + log.NewInfo(req.OperationID, "KickUserOffline is arriving", req.String()) + for _, v := range req.KickUserIDList { + oldConnMap := ws.getUserAllCons(v) + if conn, ok := oldConnMap[int(req.PlatformID)]; ok { // user->map[platform->conn] + log.NewWarn(req.OperationID, "send kick msg, close connection ", req.PlatformID, v) + ws.sendKickMsg(conn, &UserConn{}) + conn.Close() + } + log.NewWarn(req.OperationID, "SetTokenKicked ", v, req.PlatformID, req.OperationID) + SetTokenKicked(v, int(req.PlatformID), req.OperationID) + } + return &pbRelay.KickUserOfflineResp{}, nil +} + +func sendMsgToUser(conn *UserConn, bMsg []byte, in *pbRelay.OnlinePushMsgReq, RecvPlatForm int, RecvID string) (ResultCode int64) { err := ws.writeMsg(conn, websocket.BinaryMessage, bMsg) if err != nil { log.NewError(in.OperationID, "PushMsgToUser is failed By Ws", "Addr", conn.RemoteAddr().String(), - "error", err, "senderPlatform", constant.PlatformIDToName(in.MsgData.SenderPlatformID), "recvPlatform", RecvPlatForm, "args", in.String(), "recvID", RecvID) + "error", err, "senderPlatform", constant.PlatformIDToName(int(in.MsgData.SenderPlatformID)), "recvPlatform", RecvPlatForm, "args", in.String(), "recvID", RecvID) ResultCode = -2 return ResultCode } else { @@ -153,9 +315,23 @@ func sendMsgToUser(conn *UserConn, bMsg []byte, in *pbRelay.OnlinePushMsgReq, Re } } -func genPlatformArray() (array []string) { +func sendMsgBatchToUser(conn *UserConn, bMsg []byte, in *pbRelay.OnlineBatchPushOneMsgReq, RecvPlatForm int, RecvID string) (ResultCode int64) { + err := ws.writeMsg(conn, websocket.BinaryMessage, bMsg) + if err != nil { + log.NewError(in.OperationID, "PushMsgToUser is failed By Ws", "Addr", conn.RemoteAddr().String(), + "error", err, "senderPlatform", constant.PlatformIDToName(int(in.MsgData.SenderPlatformID)), "recv Platform", RecvPlatForm, "args", in.String(), "recvID", RecvID) + ResultCode = -2 + return ResultCode + } else { + log.NewDebug(in.OperationID, "PushMsgToUser is success By Ws", "args", in.String(), "recv PlatForm", RecvPlatForm, "recvID", RecvID) + ResultCode = 0 + return ResultCode + } + +} +func genPlatformArray() (array []int) { for i := 1; i <= constant.LinuxPlatformID; i++ { - array = append(array, constant.PlatformIDToName(int32(i))) + array = append(array, i) } return array } diff --git a/internal/msg_gateway/gate/validate.go b/internal/msg_gateway/gate/validate.go index 31198a918..9a5558528 100644 --- a/internal/msg_gateway/gate/validate.go +++ b/internal/msg_gateway/gate/validate.go @@ -57,16 +57,28 @@ type SeqListData struct { SeqList []int64 `mapstructure:"seqList" validate:"required"` } -func (ws *WServer) argsValidate(m *Req, r int32) (isPass bool, errCode int32, errMsg string, returnData interface{}) { +func (ws *WServer) argsValidate(m *Req, r int32, operationID string) (isPass bool, errCode int32, errMsg string, returnData interface{}) { switch r { - case constant.WSSendMsg: - data := open_im_sdk.MsgData{} + case constant.WSGetNewestSeq: + data := open_im_sdk.GetMaxAndMinSeqReq{} if err := proto.Unmarshal(m.Data, &data); err != nil { - log.Error("", "Decode Data struct err", err.Error(), r) + log.Error(operationID, "Decode Data struct err", err.Error(), r) return false, 203, err.Error(), nil } if err := validate.Struct(data); err != nil { - log.Error("", "data args validate err", err.Error(), r) + log.Error(operationID, "data args validate err", err.Error(), r) + return false, 204, err.Error(), nil + + } + return true, 0, "", data + case constant.WSSendMsg: + data := open_im_sdk.MsgData{} + if err := proto.Unmarshal(m.Data, &data); err != nil { + log.Error(operationID, "Decode Data struct err", err.Error(), r) + return false, 203, err.Error(), nil + } + if err := validate.Struct(data); err != nil { + log.Error(operationID, "data args validate err", err.Error(), r) return false, 204, err.Error(), nil } @@ -74,11 +86,11 @@ func (ws *WServer) argsValidate(m *Req, r int32) (isPass bool, errCode int32, er case constant.WSSendSignalMsg: data := pbRtc.SignalReq{} if err := proto.Unmarshal(m.Data, &data); err != nil { - log.Error("", "Decode Data struct err", err.Error(), r) + log.Error(operationID, "Decode Data struct err", err.Error(), r) return false, 203, err.Error(), nil } if err := validate.Struct(data); err != nil { - log.Error("", "data args validate err", err.Error(), r) + log.Error(operationID, "data args validate err", err.Error(), r) return false, 204, err.Error(), nil } @@ -86,31 +98,16 @@ func (ws *WServer) argsValidate(m *Req, r int32) (isPass bool, errCode int32, er case constant.WSPullMsgBySeqList: data := open_im_sdk.PullMessageBySeqListReq{} if err := proto.Unmarshal(m.Data, &data); err != nil { - log.Error("", "Decode Data struct err", err.Error(), r) + log.Error(operationID, "Decode Data struct err", err.Error(), r) return false, 203, err.Error(), nil } if err := validate.Struct(data); err != nil { - log.Error("", "data args validate err", err.Error(), r) + log.Error(operationID, "data args validate err", err.Error(), r) return false, 204, err.Error(), nil } return true, 0, "", data - default: } - return false, 204, "args err", nil - - //b := bytes.NewBuffer(m.Data) - //dec := gob.NewDecoder(b) - //err := dec.Decode(&data) - //if err != nil { - // log.ErrorByKv("Decode Data struct err", "", "err", err.Error(), "reqIdentifier", r) - // return false, 203, err.Error(), nil - //} - //if err := mapstructure.WeakDecode(m.Data, &data); err != nil { - // log.ErrorByKv("map to Data struct err", "", "err", err.Error(), "reqIdentifier", r) - // return false, 203, err.Error(), nil - //} else - } diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index c14277c9c..6f51ca993 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -9,7 +9,10 @@ import ( "Open_IM/pkg/utils" "bytes" "encoding/gob" - "github.com/garyburd/redigo/redis" + go_redis "github.com/go-redis/redis/v8" + "github.com/pkg/errors" + + //"gopkg.in/errgo.v2/errors" "net/http" "sync" "time" @@ -19,21 +22,22 @@ import ( type UserConn struct { *websocket.Conn - w *sync.Mutex + w *sync.Mutex + PushedMaxSeq uint32 } type WServer struct { wsAddr string wsMaxConnNum int wsUpGrader *websocket.Upgrader - wsConnToUser map[*UserConn]map[string]string - wsUserToConn map[string]map[string]*UserConn + wsConnToUser map[*UserConn]map[int]string + wsUserToConn map[string]map[int]*UserConn } func (ws *WServer) onInit(wsPort int) { ws.wsAddr = ":" + utils.IntToString(wsPort) ws.wsMaxConnNum = config.Config.LongConnSvr.WebsocketMaxConnNum - ws.wsConnToUser = make(map[*UserConn]map[string]string) - ws.wsUserToConn = make(map[string]map[string]*UserConn) + ws.wsConnToUser = make(map[*UserConn]map[int]string) + ws.wsUserToConn = make(map[string]map[int]*UserConn) ws.wsUpGrader = &websocket.Upgrader{ HandshakeTimeout: time.Duration(config.Config.LongConnSvr.WebsocketTimeOut) * time.Second, ReadBufferSize: config.Config.LongConnSvr.WebsocketMaxMsgLen, @@ -50,22 +54,27 @@ func (ws *WServer) run() { } func (ws *WServer) wsHandler(w http.ResponseWriter, r *http.Request) { - if ws.headerCheck(w, r) { - query := r.URL.Query() + query := r.URL.Query() + operationID := "" + if len(query["operationID"]) != 0 { + operationID = query["operationID"][0] + } else { + operationID = utils.OperationIDGenerator() + } + log.Debug(operationID, utils.GetSelfFuncName(), " args: ", query) + if ws.headerCheck(w, r, operationID) { conn, err := ws.wsUpGrader.Upgrade(w, r, nil) //Conn is obtained through the upgraded escalator if err != nil { - log.Error("", "upgrade http conn err", err, query) + log.Error(operationID, "upgrade http conn err", err.Error(), query) return } else { - //Connection mapping relationship, - //userID+" "+platformID->conn - - //Initialize a lock for each user - newConn := &UserConn{conn, new(sync.Mutex)} + newConn := &UserConn{conn, new(sync.Mutex), 0} userCount++ - ws.addUserConn(query["sendID"][0], int32(utils.StringToInt64(query["platformID"][0])), newConn, query["token"][0]) + ws.addUserConn(query["sendID"][0], utils.StringToInt(query["platformID"][0]), newConn, query["token"][0], operationID) go ws.readMsg(newConn) } + } else { + log.Error(operationID, "headerCheck failed ") } } @@ -76,54 +85,65 @@ func (ws *WServer) readMsg(conn *UserConn) { log.NewInfo("", "this is a pingMessage") } if err != nil { - uid, platform := ws.getUserUid(conn) - log.Error("", "WS ReadMsg error", "userIP", conn.RemoteAddr().String(), "userUid", uid, "platform", platform, "error", err.Error()) + log.Error("", "WS ReadMsg error ", " userIP", conn.RemoteAddr().String(), "userUid", "platform", "error", err.Error()) userCount-- ws.delUserConn(conn) return - } else { - //log.ErrorByKv("test", "", "msgType", msgType, "userIP", conn.RemoteAddr().String(), "userUid", ws.getUserUid(conn)) } ws.msgParse(conn, msg) - //ws.writeMsg(conn, 1, chat) } - } + +func (ws *WServer) SetWriteTimeout(conn *UserConn, timeout int) { + conn.w.Lock() + defer conn.w.Unlock() + conn.SetWriteDeadline(time.Now().Add(time.Duration(timeout) * time.Second)) +} + func (ws *WServer) writeMsg(conn *UserConn, a int, msg []byte) error { conn.w.Lock() defer conn.w.Unlock() + conn.SetWriteDeadline(time.Now().Add(time.Duration(60) * time.Second)) return conn.WriteMessage(a, msg) - } -func (ws *WServer) MultiTerminalLoginChecker(uid string, platformID int32, newConn *UserConn, token string, operationID string) { + +func (ws *WServer) SetWriteTimeoutWriteMsg(conn *UserConn, a int, msg []byte, timeout int) error { + conn.w.Lock() + defer conn.w.Unlock() + conn.SetWriteDeadline(time.Now().Add(time.Duration(timeout) * time.Second)) + return conn.WriteMessage(a, msg) +} +func (ws *WServer) MultiTerminalLoginChecker(uid string, platformID int, newConn *UserConn, token string, operationID string) { switch config.Config.MultiLoginPolicy { case constant.AllLoginButSameTermKick: if oldConnMap, ok := ws.wsUserToConn[uid]; ok { // user->map[platform->conn] - if oldConn, ok := oldConnMap[constant.PlatformIDToName(platformID)]; ok { + if oldConn, ok := oldConnMap[platformID]; ok { log.NewDebug(operationID, uid, platformID, "kick old conn") - ws.sendKickMsg(oldConn, newConn) + // ws.sendKickMsg(oldConn, newConn) m, err := db.DB.GetTokenMapByUidPid(uid, constant.PlatformIDToName(platformID)) - if err != nil && err != redis.ErrNil { - log.NewError(operationID, "get token from redis err", err.Error()) + if err != nil && err != go_redis.Nil { + log.NewError(operationID, "get token from redis err", err.Error(), uid, constant.PlatformIDToName(platformID)) return } if m == nil { - log.NewError(operationID, "get token from redis err", "m is nil") + log.NewError(operationID, "get token from redis err", "m is nil", uid, constant.PlatformIDToName(platformID)) return } + log.NewDebug(operationID, "get token map is ", m, uid, constant.PlatformIDToName(platformID)) + for k, _ := range m { if k != token { m[k] = constant.KickedToken } } - log.NewDebug(operationID, "get map is ", m) + log.NewDebug(operationID, "set token map is ", m, uid, constant.PlatformIDToName(platformID)) err = db.DB.SetTokenMapByUidPid(uid, platformID, m) if err != nil { - log.NewError(operationID, "SetTokenMapByUidPid err", err.Error()) + log.NewError(operationID, "SetTokenMapByUidPid err", err.Error(), uid, platformID, m) return } err = oldConn.Close() - delete(oldConnMap, constant.PlatformIDToName(platformID)) + delete(oldConnMap, platformID) ws.wsUserToConn[uid] = oldConnMap if len(oldConnMap) == 0 { delete(ws.wsUserToConn, uid) @@ -132,9 +152,8 @@ func (ws *WServer) MultiTerminalLoginChecker(uid string, platformID int32, newCo if err != nil { log.NewError(operationID, "conn close err", err.Error(), uid, platformID) } - } else { - log.NewWarn(operationID, "abnormal uid-conn ", uid, platformID, oldConnMap[constant.PlatformIDToName(platformID)]) + log.NewWarn(operationID, "abnormal uid-conn ", uid, platformID, oldConnMap[platformID]) } } else { @@ -160,30 +179,35 @@ func (ws *WServer) sendKickMsg(oldConn, newConn *UserConn) { } err = ws.writeMsg(oldConn, websocket.BinaryMessage, b.Bytes()) if err != nil { - log.NewError(mReply.OperationID, mReply.ReqIdentifier, mReply.ErrCode, mReply.ErrMsg, "WS WriteMsg error", oldConn.RemoteAddr().String(), newConn.RemoteAddr().String(), err.Error()) + log.NewError(mReply.OperationID, mReply.ReqIdentifier, mReply.ErrCode, mReply.ErrMsg, "sendKickMsg WS WriteMsg error", oldConn.RemoteAddr().String(), newConn.RemoteAddr().String(), err.Error()) } } -func (ws *WServer) addUserConn(uid string, platformID int32, conn *UserConn, token string) { + +func (ws *WServer) addUserConn(uid string, platformID int, conn *UserConn, token string, operationID string) { rwLock.Lock() defer rwLock.Unlock() - operationID := utils.OperationIDGenerator() + log.Info(operationID, utils.GetSelfFuncName(), " args: ", uid, platformID, conn, token) + callbackResp := callbackUserOnline(operationID, uid, platformID, token) + if callbackResp.ErrCode != 0 { + log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOnline resp:", callbackResp) + } ws.MultiTerminalLoginChecker(uid, platformID, conn, token, operationID) if oldConnMap, ok := ws.wsUserToConn[uid]; ok { - oldConnMap[constant.PlatformIDToName(platformID)] = conn + oldConnMap[platformID] = conn ws.wsUserToConn[uid] = oldConnMap log.Debug(operationID, "user not first come in, add conn ", uid, platformID, conn, oldConnMap) } else { - i := make(map[string]*UserConn) - i[constant.PlatformIDToName(platformID)] = conn + i := make(map[int]*UserConn) + i[platformID] = conn ws.wsUserToConn[uid] = i log.Debug(operationID, "user first come in, new user, conn", uid, platformID, conn, ws.wsUserToConn[uid]) } if oldStringMap, ok := ws.wsConnToUser[conn]; ok { - oldStringMap[constant.PlatformIDToName(platformID)] = uid + oldStringMap[platformID] = uid ws.wsConnToUser[conn] = oldStringMap } else { - i := make(map[string]string) - i[constant.PlatformIDToName(platformID)] = uid + i := make(map[int]string) + i[platformID] = uid ws.wsConnToUser[conn] = i } count := 0 @@ -191,14 +215,14 @@ func (ws *WServer) addUserConn(uid string, platformID int32, conn *UserConn, tok count = count + len(v) } log.Debug(operationID, "WS Add operation", "", "wsUser added", ws.wsUserToConn, "connection_uid", uid, "connection_platform", constant.PlatformIDToName(platformID), "online_user_num", len(ws.wsUserToConn), "online_conn_num", count) - } func (ws *WServer) delUserConn(conn *UserConn) { rwLock.Lock() defer rwLock.Unlock() operationID := utils.OperationIDGenerator() - var platform, uid string + var uid string + var platform int if oldStringMap, ok := ws.wsConnToUser[conn]; ok { for k, v := range oldStringMap { platform = k @@ -225,10 +249,13 @@ func (ws *WServer) delUserConn(conn *UserConn) { if err != nil { log.Error(operationID, " close err", "", "uid", uid, "platform", platform) } - + callbackResp := callbackUserOffline(operationID, uid, platform) + if callbackResp.ErrCode != 0 { + log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp) + } } -func (ws *WServer) getUserConn(uid string, platform string) *UserConn { +func (ws *WServer) getUserConn(uid string, platform int) *UserConn { rwLock.RLock() defer rwLock.RUnlock() if connMap, ok := ws.wsUserToConn[uid]; ok { @@ -238,7 +265,7 @@ func (ws *WServer) getUserConn(uid string, platform string) *UserConn { } return nil } -func (ws *WServer) getSingleUserAllConn(uid string) map[string]*UserConn { +func (ws *WServer) getUserAllCons(uid string) map[int]*UserConn { rwLock.RLock() defer rwLock.RUnlock() if connMap, ok := ws.wsUserToConn[uid]; ok { @@ -246,46 +273,84 @@ func (ws *WServer) getSingleUserAllConn(uid string) map[string]*UserConn { } return nil } -func (ws *WServer) getUserUid(conn *UserConn) (uid, platform string) { - rwLock.RLock() - defer rwLock.RUnlock() - if stringMap, ok := ws.wsConnToUser[conn]; ok { - for k, v := range stringMap { - platform = k - uid = v - } - return uid, platform - } - return "", "" -} -func (ws *WServer) headerCheck(w http.ResponseWriter, r *http.Request) bool { +//func (ws *WServer) getUserUid(conn *UserConn) (uid string, platform int) { +// rwLock.RLock() +// defer rwLock.RUnlock() +// +// if stringMap, ok := ws.wsConnToUser[conn]; ok { +// for k, v := range stringMap { +// platform = k +// uid = v +// } +// return uid, platform +// } +// return "", 0 +//} +func (ws *WServer) headerCheck(w http.ResponseWriter, r *http.Request, operationID string) bool { status := http.StatusUnauthorized query := r.URL.Query() - operationID := "" - if len(query["operationID"]) != 0 { - operationID = query["operationID"][0] - } if len(query["token"]) != 0 && len(query["sendID"]) != 0 && len(query["platformID"]) != 0 { if ok, err, msg := token_verify.WsVerifyToken(query["token"][0], query["sendID"][0], query["platformID"][0], operationID); !ok { - // e := err.(*constant.ErrInfo) - log.Error(operationID, "Token verify failed ", "query ", query, msg, err.Error()) + if errors.Is(err, constant.ErrTokenExpired) { + status = int(constant.ErrTokenExpired.ErrCode) + } + if errors.Is(err, constant.ErrTokenInvalid) { + status = int(constant.ErrTokenInvalid.ErrCode) + } + if errors.Is(err, constant.ErrTokenMalformed) { + status = int(constant.ErrTokenMalformed.ErrCode) + } + if errors.Is(err, constant.ErrTokenNotValidYet) { + status = int(constant.ErrTokenNotValidYet.ErrCode) + } + if errors.Is(err, constant.ErrTokenUnknown) { + status = int(constant.ErrTokenUnknown.ErrCode) + } + if errors.Is(err, constant.ErrTokenKicked) { + status = int(constant.ErrTokenKicked.ErrCode) + } + if errors.Is(err, constant.ErrTokenDifferentPlatformID) { + status = int(constant.ErrTokenDifferentPlatformID.ErrCode) + } + if errors.Is(err, constant.ErrTokenDifferentUserID) { + status = int(constant.ErrTokenDifferentUserID.ErrCode) + } + //switch errors.Cause(err) { + //case constant.ErrTokenExpired: + // status = int(constant.ErrTokenExpired.ErrCode) + //case constant.ErrTokenInvalid: + // status = int(constant.ErrTokenInvalid.ErrCode) + //case constant.ErrTokenMalformed: + // status = int(constant.ErrTokenMalformed.ErrCode) + //case constant.ErrTokenNotValidYet: + // status = int(constant.ErrTokenNotValidYet.ErrCode) + //case constant.ErrTokenUnknown: + // status = int(constant.ErrTokenUnknown.ErrCode) + //case constant.ErrTokenKicked: + // status = int(constant.ErrTokenKicked.ErrCode) + //case constant.ErrTokenDifferentPlatformID: + // status = int(constant.ErrTokenDifferentPlatformID.ErrCode) + //case constant.ErrTokenDifferentUserID: + // status = int(constant.ErrTokenDifferentUserID.ErrCode) + //} + + log.Error(operationID, "Token verify failed ", "query ", query, msg, err.Error(), "status: ", status) w.Header().Set("Sec-Websocket-Version", "13") w.Header().Set("ws_err_msg", err.Error()) http.Error(w, err.Error(), status) return false } else { - log.Info(operationID, "Connection Authentication Success", "", "token", query["token"][0], "userID", query["sendID"][0]) + log.Info(operationID, "Connection Authentication Success", "", "token ", query["token"][0], "userID ", query["sendID"][0], "platformID ", query["platformID"][0]) return true } } else { - log.Error(operationID, "Args err", "query", query) + status = int(constant.ErrArgs.ErrCode) + log.Error(operationID, "Args err ", "query ", query) w.Header().Set("Sec-Websocket-Version", "13") - w.Header().Set("ws_err_msg", "args err, need token, sendID, platformID") - http.Error(w, http.StatusText(status), status) + errMsg := "args err, need token, sendID, platformID" + w.Header().Set("ws_err_msg", errMsg) + http.Error(w, errMsg, status) return false } } -func genMapKey(uid string, platformID int32) string { - return uid + " " + constant.PlatformIDToName(platformID) -} diff --git a/internal/msg_transfer/logic/db.go b/internal/msg_transfer/logic/db.go index 806b782c0..579cdedf3 100644 --- a/internal/msg_transfer/logic/db.go +++ b/internal/msg_transfer/logic/db.go @@ -19,5 +19,11 @@ func saveUserChat(uid string, msg *pbMsg.MsgDataToMQ) error { pbSaveData.MsgData = msg.MsgData log.NewInfo(msg.OperationID, "IncrUserSeq cost time", utils.GetCurrentTimestampByMill()-time) return db.DB.SaveUserChatMongo2(uid, pbSaveData.MsgData.SendTime, &pbSaveData) -// return db.DB.SaveUserChatMongo2(uid, pbSaveData.MsgData.SendTime, &pbSaveData) + // return db.DB.SaveUserChatMongo2(uid, pbSaveData.MsgData.SendTime, &pbSaveData) +} + +func saveUserChatList(userID string, msgList []*pbMsg.MsgDataToMQ, operationID string) (error, uint64) { + log.Info(operationID, utils.GetSelfFuncName(), "args ", userID, len(msgList)) + //return db.DB.BatchInsertChat(userID, msgList, operationID) + return db.DB.BatchInsertChat2Cache(userID, msgList, operationID) } diff --git a/internal/msg_transfer/logic/init.go b/internal/msg_transfer/logic/init.go index c382de7f0..38d0e5b66 100644 --- a/internal/msg_transfer/logic/init.go +++ b/internal/msg_transfer/logic/init.go @@ -4,7 +4,6 @@ import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/kafka" - "Open_IM/pkg/common/log" "Open_IM/pkg/statistics" "fmt" "sync" @@ -12,18 +11,26 @@ import ( const OnlineTopicBusy = 1 const OnlineTopicVacancy = 0 +const Msg = 2 +const ConsumerMsgs = 3 +const AggregationMessages = 4 +const MongoMessages = 5 +const ChannelNum = 100 var ( persistentCH PersistentConsumerHandler - historyCH OnlineHistoryConsumerHandler - offlineHistoryCH OfflineHistoryConsumerHandler + historyCH OnlineHistoryRedisConsumerHandler + historyMongoCH OnlineHistoryMongoConsumerHandler producer *kafka.Producer + producerToMongo *kafka.Producer cmdCh chan Cmd2Value onlineTopicStatus int w *sync.Mutex singleMsgSuccessCount uint64 groupMsgCount uint64 singleMsgFailedCount uint64 + + singleMsgSuccessCountMutex sync.Mutex ) func Init() { @@ -31,12 +38,13 @@ func Init() { w = new(sync.Mutex) persistentCH.Init() historyCH.Init(cmdCh) + historyMongoCH.Init() onlineTopicStatus = OnlineTopicVacancy - log.Debug("come msg transfer ts", config.Config.Kafka.ConsumerGroupID.MsgToMongoOffline, config.Config.Kafka.Ws2mschatOffline.Topic) - offlineHistoryCH.Init(cmdCh) + //offlineHistoryCH.Init(cmdCh) statistics.NewStatistics(&singleMsgSuccessCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second singleMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval) statistics.NewStatistics(&groupMsgCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second groupMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval) producer = kafka.NewKafkaProducer(config.Config.Kafka.Ms2pschat.Addr, config.Config.Kafka.Ms2pschat.Topic) + producerToMongo = kafka.NewKafkaProducer(config.Config.Kafka.MsgToMongo.Addr, config.Config.Kafka.MsgToMongo.Topic) } func Run() { //register mysqlConsumerHandler to @@ -46,7 +54,8 @@ func Run() { fmt.Println("not start mysql consumer") } go historyCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyCH) - go offlineHistoryCH.historyConsumerGroup.RegisterHandleAndConsumer(&offlineHistoryCH) + go historyMongoCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyMongoCH) + //go offlineHistoryCH.historyConsumerGroup.RegisterHandleAndConsumer(&offlineHistoryCH) } func SetOnlineTopicStatus(status int) { w.Lock() diff --git a/internal/msg_transfer/logic/offline_history_msg_handler.go b/internal/msg_transfer/logic/offline_history_msg_handler.go deleted file mode 100644 index 13d168ddb..000000000 --- a/internal/msg_transfer/logic/offline_history_msg_handler.go +++ /dev/null @@ -1,126 +0,0 @@ -package logic - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" - kfk "Open_IM/pkg/common/kafka" - "Open_IM/pkg/common/log" - pbMsg "Open_IM/pkg/proto/chat" - "Open_IM/pkg/utils" - "github.com/Shopify/sarama" - "github.com/golang/protobuf/proto" - "time" -) - -type OfflineHistoryConsumerHandler struct { - msgHandle map[string]fcb - cmdCh chan Cmd2Value - historyConsumerGroup *kfk.MConsumerGroup -} - -func (mc *OfflineHistoryConsumerHandler) Init(cmdCh chan Cmd2Value) { - mc.msgHandle = make(map[string]fcb) - mc.cmdCh = cmdCh - mc.msgHandle[config.Config.Kafka.Ws2mschatOffline.Topic] = mc.handleChatWs2Mongo - mc.historyConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V0_10_2_0, - OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false}, []string{config.Config.Kafka.Ws2mschatOffline.Topic}, - config.Config.Kafka.Ws2mschatOffline.Addr, config.Config.Kafka.ConsumerGroupID.MsgToMongoOffline) - -} - -func (mc *OfflineHistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey string) { - now := time.Now() - msgFromMQ := pbMsg.MsgDataToMQ{} - err := proto.Unmarshal(msg, &msgFromMQ) - if err != nil { - log.Error("msg_transfer Unmarshal msg err", "", "msg", string(msg), "err", err.Error()) - return - } - operationID := msgFromMQ.OperationID - log.NewInfo(operationID, "msg come mongo!!!", "", "msg", string(msg)) - //Control whether to store offline messages (mongo) - isHistory := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsHistory) - //Control whether to store history messages (mysql) - isPersist := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsPersistent) - isSenderSync := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsSenderSync) - switch msgFromMQ.MsgData.SessionType { - case constant.SingleChatType: - log.NewDebug(msgFromMQ.OperationID, "msg_transfer msg type = SingleChatType", isHistory, isPersist) - if isHistory { - err := saveUserChat(msgKey, &msgFromMQ) - if err != nil { - singleMsgFailedCount++ - log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.String()) - return - } - singleMsgSuccessCount++ - log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", time.Since(now)) - } - if !isSenderSync && msgKey == msgFromMQ.MsgData.SendID { - } else { - go sendMessageToPush(&msgFromMQ, msgKey) - } - log.NewDebug(operationID, "saveSingleMsg cost time ", time.Since(now)) - case constant.GroupChatType: - log.NewDebug(msgFromMQ.OperationID, "msg_transfer msg type = GroupChatType", isHistory, isPersist) - if isHistory { - err := saveUserChat(msgFromMQ.MsgData.RecvID, &msgFromMQ) - if err != nil { - log.NewError(operationID, "group data insert to mongo err", msgFromMQ.String(), msgFromMQ.MsgData.RecvID, err.Error()) - return - } - groupMsgCount++ - } - go sendMessageToPush(&msgFromMQ, msgFromMQ.MsgData.RecvID) - log.NewDebug(operationID, "saveGroupMsg cost time ", time.Since(now)) - - case constant.NotificationChatType: - log.NewDebug(msgFromMQ.OperationID, "msg_transfer msg type = NotificationChatType", isHistory, isPersist) - if isHistory { - err := saveUserChat(msgKey, &msgFromMQ) - if err != nil { - log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.String()) - return - } - log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", time.Since(now)) - } - if !isSenderSync && msgKey == msgFromMQ.MsgData.SendID { - } else { - go sendMessageToPush(&msgFromMQ, msgKey) - } - log.NewDebug(operationID, "saveUserChat cost time ", time.Since(now)) - default: - log.NewError(msgFromMQ.OperationID, "SessionType error", msgFromMQ.String()) - return - } - log.NewDebug(msgFromMQ.OperationID, "msg_transfer handle topic data to database success...", msgFromMQ.String()) -} - -func (OfflineHistoryConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } -func (OfflineHistoryConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } -func (mc *OfflineHistoryConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, - claim sarama.ConsumerGroupClaim) error { // a instance in the consumer group - //log.NewDebug("", "offline new session msg come", claim.HighWaterMarkOffset(), claim.Topic(), claim.Partition()) - //for msg := range claim.Messages() { - // log.NewDebug("", "kafka get info to delay mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "offline") - // //mc.msgHandle[msg.Topic](msg.Value, string(msg.Key)) - //} - for msg := range claim.Messages() { - if GetOnlineTopicStatus() == OnlineTopicVacancy { - log.NewDebug("", "vacancy offline kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value)) - mc.msgHandle[msg.Topic](msg.Value, string(msg.Key)) - sess.MarkMessage(msg, "") - } else { - select { - case <-mc.cmdCh: - log.NewDebug("", "cmd offline kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value)) - case <-time.After(time.Millisecond * time.Duration(100)): - log.NewDebug("", "timeout offline kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value)) - } - mc.msgHandle[msg.Topic](msg.Value, string(msg.Key)) - sess.MarkMessage(msg, "") - } - } - - return nil -} diff --git a/internal/msg_transfer/logic/online_history_msg_handler.go b/internal/msg_transfer/logic/online_history_msg_handler.go index 43bd240c4..908d28b27 100644 --- a/internal/msg_transfer/logic/online_history_msg_handler.go +++ b/internal/msg_transfer/logic/online_history_msg_handler.go @@ -3,6 +3,7 @@ package logic import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" kfk "Open_IM/pkg/common/kafka" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" @@ -10,58 +11,218 @@ import ( pbPush "Open_IM/pkg/proto/push" "Open_IM/pkg/utils" "context" - "errors" "github.com/Shopify/sarama" "github.com/golang/protobuf/proto" + "hash/crc32" "strings" + "sync" "time" ) -type fcb func(msg []byte, msgKey string) +type MsgChannelValue struct { + aggregationID string //maybe userID or super groupID + triggerID string + msgList []*pbMsg.MsgDataToMQ + lastSeq uint64 +} +type TriggerChannelValue struct { + triggerID string + cmsgList []*sarama.ConsumerMessage +} +type fcb func(cMsg *sarama.ConsumerMessage, msgKey string, sess sarama.ConsumerGroupSession) type Cmd2Value struct { Cmd int Value interface{} } -type OnlineHistoryConsumerHandler struct { +type OnlineHistoryRedisConsumerHandler struct { msgHandle map[string]fcb historyConsumerGroup *kfk.MConsumerGroup - cmdCh chan Cmd2Value + chArrays [ChannelNum]chan Cmd2Value + msgDistributionCh chan Cmd2Value } -func (och *OnlineHistoryConsumerHandler) Init(cmdCh chan Cmd2Value) { +func (och *OnlineHistoryRedisConsumerHandler) Init(cmdCh chan Cmd2Value) { och.msgHandle = make(map[string]fcb) - och.cmdCh = cmdCh - och.msgHandle[config.Config.Kafka.Ws2mschat.Topic] = och.handleChatWs2Mongo - och.historyConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V0_10_2_0, - OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false}, []string{config.Config.Kafka.Ws2mschat.Topic}, - config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.ConsumerGroupID.MsgToMongo) - -} -func (och *OnlineHistoryConsumerHandler) TriggerCmd(status int) { - operationID := utils.OperationIDGenerator() - err := sendCmd(och.cmdCh, Cmd2Value{Cmd: status, Value: ""}, 1) - if err != nil { - log.Error(operationID, "TriggerCmd failed ", err.Error(), status) - return + och.msgDistributionCh = make(chan Cmd2Value) //no buffer channel + go och.MessagesDistributionHandle() + for i := 0; i < ChannelNum; i++ { + och.chArrays[i] = make(chan Cmd2Value, 50) + go och.Run(i) } - log.Debug(operationID, "TriggerCmd success", status) - -} -func sendCmd(ch chan Cmd2Value, value Cmd2Value, timeout int64) error { - var flag = 0 - select { - case ch <- value: - flag = 1 - case <-time.After(time.Second * time.Duration(timeout)): - flag = 2 - } - if flag == 1 { - return nil + if config.Config.ReliableStorage { + och.msgHandle[config.Config.Kafka.Ws2mschat.Topic] = och.handleChatWs2Mongo } else { - return errors.New("send cmd timeout") + och.msgHandle[config.Config.Kafka.Ws2mschat.Topic] = och.handleChatWs2MongoLowReliability + + } + och.historyConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V2_0_0_0, + OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false}, []string{config.Config.Kafka.Ws2mschat.Topic}, + config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.ConsumerGroupID.MsgToRedis) + +} +func (och *OnlineHistoryRedisConsumerHandler) Run(channelID int) { + for { + select { + case cmd := <-och.chArrays[channelID]: + switch cmd.Cmd { + case AggregationMessages: + msgChannelValue := cmd.Value.(MsgChannelValue) + msgList := msgChannelValue.msgList + triggerID := msgChannelValue.triggerID + storageMsgList := make([]*pbMsg.MsgDataToMQ, 0, 80) + notStoragePushMsgList := make([]*pbMsg.MsgDataToMQ, 0, 80) + log.Debug(triggerID, "msg arrived channel", "channel id", channelID, msgList, msgChannelValue.aggregationID, len(msgList)) + for _, v := range msgList { + log.Debug(triggerID, "msg come to storage center", v.String()) + isHistory := utils.GetSwitchFromOptions(v.MsgData.Options, constant.IsHistory) + isSenderSync := utils.GetSwitchFromOptions(v.MsgData.Options, constant.IsSenderSync) + if isHistory { + storageMsgList = append(storageMsgList, v) + //log.NewWarn(triggerID, "storageMsgList to mongodb client msgID: ", v.MsgData.ClientMsgID) + } else { + if !(!isSenderSync && msgChannelValue.aggregationID == v.MsgData.SendID) { + notStoragePushMsgList = append(notStoragePushMsgList, v) + } + + } + + } + + //switch msgChannelValue.msg.MsgData.SessionType { + //case constant.SingleChatType: + //case constant.GroupChatType: + //case constant.NotificationChatType: + //default: + // log.NewError(msgFromMQ.OperationID, "SessionType error", msgFromMQ.String()) + // return + //} + log.Debug(triggerID, "msg storage length", len(storageMsgList), "push length", len(notStoragePushMsgList)) + err, lastSeq := saveUserChatList(msgChannelValue.aggregationID, storageMsgList, triggerID) + if err != nil { + singleMsgFailedCount += uint64(len(storageMsgList)) + log.NewError(triggerID, "single data insert to redis err", err.Error(), storageMsgList) + } else { + singleMsgSuccessCountMutex.Lock() + singleMsgSuccessCount += uint64(len(storageMsgList)) + singleMsgSuccessCountMutex.Unlock() + och.SendMessageToMongoCH(msgChannelValue.aggregationID, triggerID, storageMsgList, lastSeq) + go func(push, storage []*pbMsg.MsgDataToMQ) { + for _, v := range storage { + sendMessageToPush(v, msgChannelValue.aggregationID) + } + for _, x := range push { + sendMessageToPush(x, msgChannelValue.aggregationID) + } + + }(notStoragePushMsgList, storageMsgList) + + } + } + } } } -func (och *OnlineHistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey string) { +func (och *OnlineHistoryRedisConsumerHandler) SendMessageToMongoCH(aggregationID string, triggerID string, messages []*pbMsg.MsgDataToMQ, lastSeq uint64) { + pid, offset, err := producerToMongo.SendMessage(&pbMsg.MsgDataToMongoByMQ{LastSeq: lastSeq, AggregationID: aggregationID, MessageList: messages, TriggerID: triggerID}, aggregationID, triggerID) + if err != nil { + log.Error(triggerID, "kafka send failed", "send data", len(messages), "pid", pid, "offset", offset, "err", err.Error(), "key", aggregationID) + } else { + // log.NewWarn(m.OperationID, "sendMsgToKafka client msgID ", m.MsgData.ClientMsgID) + } + //hashCode := getHashCode(aggregationID) + //channelID := hashCode % ChannelNum + //log.Debug(triggerID, "generate channelID", hashCode, channelID, aggregationID) + ////go func(cID uint32, userID string, messages []*pbMsg.MsgDataToMQ) { + //och.chMongoArrays[channelID] <- Cmd2Value{Cmd: MongoMessages, Value: MsgChannelValue{aggregationID: aggregationID, msgList: messages, triggerID: triggerID, lastSeq: lastSeq}} +} + +//func (och *OnlineHistoryRedisConsumerHandler) MongoMessageRun(channelID int) { +// for { +// select { +// case cmd := <-och.chMongoArrays[channelID]: +// switch cmd.Cmd { +// case MongoMessages: +// msgChannelValue := cmd.Value.(MsgChannelValue) +// msgList := msgChannelValue.msgList +// triggerID := msgChannelValue.triggerID +// aggregationID := msgChannelValue.aggregationID +// lastSeq := msgChannelValue.lastSeq +// err := db.DB.BatchInsertChat2DB(aggregationID, msgList, triggerID, lastSeq) +// if err != nil { +// log.NewError(triggerID, "single data insert to mongo err", err.Error(), msgList) +// } +// for _, v := range msgList { +// if v.MsgData.ContentType == constant.DeleteMessageNotification { +// tips := server_api_params.TipsComm{} +// DeleteMessageTips := server_api_params.DeleteMessageTips{} +// err := proto.Unmarshal(v.MsgData.Content, &tips) +// if err != nil { +// log.NewError(triggerID, "tips unmarshal err:", err.Error(), v.String()) +// continue +// } +// err = proto.Unmarshal(tips.Detail, &DeleteMessageTips) +// if err != nil { +// log.NewError(triggerID, "deleteMessageTips unmarshal err:", err.Error(), v.String()) +// continue +// } +// if unexistSeqList, err := db.DB.DelMsgBySeqList(DeleteMessageTips.UserID, DeleteMessageTips.SeqList, v.OperationID); err != nil { +// log.NewError(v.OperationID, utils.GetSelfFuncName(), "DelMsgBySeqList args: ", DeleteMessageTips.UserID, DeleteMessageTips.SeqList, v.OperationID, err.Error(), unexistSeqList) +// } +// +// } +// } +// } +// } +// } +//} + +func (och *OnlineHistoryRedisConsumerHandler) MessagesDistributionHandle() { + for { + aggregationMsgs := make(map[string][]*pbMsg.MsgDataToMQ, ChannelNum) + select { + case cmd := <-och.msgDistributionCh: + switch cmd.Cmd { + case ConsumerMsgs: + triggerChannelValue := cmd.Value.(TriggerChannelValue) + triggerID := triggerChannelValue.triggerID + consumerMessages := triggerChannelValue.cmsgList + //Aggregation map[userid]message list + log.Debug(triggerID, "batch messages come to distribution center", len(consumerMessages)) + for i := 0; i < len(consumerMessages); i++ { + msgFromMQ := pbMsg.MsgDataToMQ{} + err := proto.Unmarshal(consumerMessages[i].Value, &msgFromMQ) + if err != nil { + log.Error(triggerID, "msg_transfer Unmarshal msg err", "msg", string(consumerMessages[i].Value), "err", err.Error()) + return + } + log.Debug(triggerID, "single msg come to distribution center", msgFromMQ.String(), string(consumerMessages[i].Key)) + if oldM, ok := aggregationMsgs[string(consumerMessages[i].Key)]; ok { + oldM = append(oldM, &msgFromMQ) + aggregationMsgs[string(consumerMessages[i].Key)] = oldM + } else { + m := make([]*pbMsg.MsgDataToMQ, 0, 100) + m = append(m, &msgFromMQ) + aggregationMsgs[string(consumerMessages[i].Key)] = m + } + } + log.Debug(triggerID, "generate map list users len", len(aggregationMsgs)) + for aggregationID, v := range aggregationMsgs { + if len(v) >= 0 { + hashCode := getHashCode(aggregationID) + channelID := hashCode % ChannelNum + log.Debug(triggerID, "generate channelID", hashCode, channelID, aggregationID) + //go func(cID uint32, userID string, messages []*pbMsg.MsgDataToMQ) { + och.chArrays[channelID] <- Cmd2Value{Cmd: AggregationMessages, Value: MsgChannelValue{aggregationID: aggregationID, msgList: v, triggerID: triggerID}} + //}(channelID, userID, v) + } + } + } + } + + } + +} +func (mc *OnlineHistoryRedisConsumerHandler) handleChatWs2Mongo(cMsg *sarama.ConsumerMessage, msgKey string, sess sarama.ConsumerGroupSession) { + msg := cMsg.Value now := time.Now() msgFromMQ := pbMsg.MsgDataToMQ{} err := proto.Unmarshal(msg, &msgFromMQ) @@ -86,14 +247,16 @@ func (och *OnlineHistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey s log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.String()) return } + singleMsgSuccessCountMutex.Lock() singleMsgSuccessCount++ + singleMsgSuccessCountMutex.Unlock() log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", time.Since(now)) } if !isSenderSync && msgKey == msgFromMQ.MsgData.SendID { } else { go sendMessageToPush(&msgFromMQ, msgKey) } - log.NewDebug(operationID, "saveUserChat cost time ", time.Since(now)) + log.NewDebug(operationID, "saveSingleMsg cost time ", time.Since(now)) case constant.GroupChatType: log.NewDebug(msgFromMQ.OperationID, "msg_transfer msg type = GroupChatType", isHistory, isPersist) if isHistory { @@ -105,6 +268,8 @@ func (och *OnlineHistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey s groupMsgCount++ } go sendMessageToPush(&msgFromMQ, msgFromMQ.MsgData.RecvID) + log.NewDebug(operationID, "saveGroupMsg cost time ", time.Since(now)) + case constant.NotificationChatType: log.NewDebug(msgFromMQ.OperationID, "msg_transfer msg type = NotificationChatType", isHistory, isPersist) if isHistory { @@ -124,36 +289,233 @@ func (och *OnlineHistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey s log.NewError(msgFromMQ.OperationID, "SessionType error", msgFromMQ.String()) return } + sess.MarkMessage(cMsg, "") log.NewDebug(msgFromMQ.OperationID, "msg_transfer handle topic data to database success...", msgFromMQ.String()) } -func (OnlineHistoryConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } -func (OnlineHistoryConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } -func (och *OnlineHistoryConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, - claim sarama.ConsumerGroupClaim) error { // a instance in the consumer group - log.NewDebug("", "online new session msg come", claim.HighWaterMarkOffset(), claim.Topic(), claim.Partition()) - for msg := range claim.Messages() { - SetOnlineTopicStatus(OnlineTopicBusy) - //och.TriggerCmd(OnlineTopicBusy) - log.NewDebug("", "online kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "online", msg.Offset, claim.HighWaterMarkOffset()) - och.msgHandle[msg.Topic](msg.Value, string(msg.Key)) - sess.MarkMessage(msg, "") - if claim.HighWaterMarkOffset()-msg.Offset <= 1 { - log.Debug("", "online msg consume end", claim.HighWaterMarkOffset(), msg.Offset) - SetOnlineTopicStatus(OnlineTopicVacancy) - och.TriggerCmd(OnlineTopicVacancy) +func (och *OnlineHistoryRedisConsumerHandler) handleChatWs2MongoLowReliability(cMsg *sarama.ConsumerMessage, msgKey string, sess sarama.ConsumerGroupSession) { + msg := cMsg.Value + msgFromMQ := pbMsg.MsgDataToMQ{} + err := proto.Unmarshal(msg, &msgFromMQ) + if err != nil { + log.Error("msg_transfer Unmarshal msg err", "", "msg", string(msg), "err", err.Error()) + return + } + operationID := msgFromMQ.OperationID + log.NewInfo(operationID, "msg come mongo!!!", "", "msg", string(msg)) + //Control whether to store offline messages (mongo) + isHistory := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsHistory) + isSenderSync := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsSenderSync) + if isHistory { + seq, err := db.DB.IncrUserSeq(msgKey) + if err != nil { + log.NewError(operationID, "data insert to redis err", err.Error(), string(msg)) + return + } + sess.MarkMessage(cMsg, "") + msgFromMQ.MsgData.Seq = uint32(seq) + log.Debug(operationID, "send ch msg is ", msgFromMQ.String()) + //och.msgCh <- Cmd2Value{Cmd: Msg, Value: MsgChannelValue{msgKey, msgFromMQ}} + //err := saveUserChat(msgKey, &msgFromMQ) + //if err != nil { + // singleMsgFailedCount++ + // log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.String()) + // return + //} + //singleMsgSuccessCountMutex.Lock() + //singleMsgSuccessCount++ + //singleMsgSuccessCountMutex.Unlock() + //log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", time.Since(now)) + } else { + if !(!isSenderSync && msgKey == msgFromMQ.MsgData.SendID) { + go sendMessageToPush(&msgFromMQ, msgKey) } } +} + +func (OnlineHistoryRedisConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } +func (OnlineHistoryRedisConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } + +//func (och *OnlineHistoryRedisConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, +// claim sarama.ConsumerGroupClaim) error { // a instance in the consumer group +// log.NewDebug("", "online new session msg come", claim.HighWaterMarkOffset(), claim.Topic(), claim.Partition()) +// for msg := range claim.Messages() { +// SetOnlineTopicStatus(OnlineTopicBusy) +// //och.TriggerCmd(OnlineTopicBusy) +// log.NewDebug("", "online kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "online", msg.Offset, claim.HighWaterMarkOffset()) +// och.msgHandle[msg.Topic](msg, string(msg.Key), sess) +// if claim.HighWaterMarkOffset()-msg.Offset <= 1 { +// log.Debug("", "online msg consume end", claim.HighWaterMarkOffset(), msg.Offset) +// SetOnlineTopicStatus(OnlineTopicVacancy) +// och.TriggerCmd(OnlineTopicVacancy) +// } +// } +// return nil +//} + +func (och *OnlineHistoryRedisConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, + claim sarama.ConsumerGroupClaim) error { // a instance in the consumer group + + for { + if sess == nil { + log.NewWarn("", " sess == nil, waiting ") + time.Sleep(100 * time.Millisecond) + } else { + break + } + } + rwLock := new(sync.RWMutex) + log.NewDebug("", "online new session msg come", claim.HighWaterMarkOffset(), claim.Topic(), claim.Partition()) + cMsg := make([]*sarama.ConsumerMessage, 0, 1000) + t := time.NewTicker(time.Duration(100) * time.Millisecond) + var triggerID string + go func() { + for { + select { + //case : + // triggerID = utils.OperationIDGenerator() + // + // log.NewDebug(triggerID, "claim.Messages ", msg) + // cMsg = append(cMsg, msg) + // if len(cMsg) >= 1000 { + // ccMsg := make([]*sarama.ConsumerMessage, 0, 1000) + // for _, v := range cMsg { + // ccMsg = append(ccMsg, v) + // } + // log.Debug(triggerID, "length trigger msg consumer start", len(ccMsg)) + // och.msgDistributionCh <- Cmd2Value{Cmd: ConsumerMsgs, Value: TriggerChannelValue{ + // triggerID: triggerID, cmsgList: ccMsg}} + // sess.MarkMessage(msg, "") + // cMsg = make([]*sarama.ConsumerMessage, 0, 1000) + // log.Debug(triggerID, "length trigger msg consumer end", len(cMsg)) + // } + + case <-t.C: + if len(cMsg) > 0 { + rwLock.Lock() + ccMsg := make([]*sarama.ConsumerMessage, 0, 1000) + for _, v := range cMsg { + ccMsg = append(ccMsg, v) + } + cMsg = make([]*sarama.ConsumerMessage, 0, 1000) + rwLock.Unlock() + split := 1000 + triggerID = utils.OperationIDGenerator() + log.NewWarn(triggerID, "timer trigger msg consumer start", len(ccMsg)) + for i := 0; i < len(ccMsg)/split; i++ { + //log.Debug() + och.msgDistributionCh <- Cmd2Value{Cmd: ConsumerMsgs, Value: TriggerChannelValue{ + triggerID: triggerID, cmsgList: ccMsg[i*split : (i+1)*split]}} + } + if (len(ccMsg) % split) > 0 { + och.msgDistributionCh <- Cmd2Value{Cmd: ConsumerMsgs, Value: TriggerChannelValue{ + triggerID: triggerID, cmsgList: ccMsg[split*(len(ccMsg)/split):]}} + } + //sess.MarkMessage(ccMsg[len(cMsg)-1], "") + + log.NewWarn(triggerID, "timer trigger msg consumer end", len(cMsg)) + } + + } + } + + }() + for msg := range claim.Messages() { + //msgFromMQ := pbMsg.MsgDataToMQ{} + //err := proto.Unmarshal(msg.Value, &msgFromMQ) + //if err != nil { + // log.Error(triggerID, "msg_transfer Unmarshal msg err", "msg", string(msg.Value), "err", err.Error()) + //} + //userID := string(msg.Key) + //hashCode := getHashCode(userID) + //channelID := hashCode % ChannelNum + //log.Debug(triggerID, "generate channelID", hashCode, channelID, userID) + ////go func(cID uint32, userID string, messages []*pbMsg.MsgDataToMQ) { + //och.chArrays[channelID] <- Cmd2Value{Cmd: UserMessages, Value: MsgChannelValue{userID: userID, msgList: []*pbMsg.MsgDataToMQ{&msgFromMQ}, triggerID: msgFromMQ.OperationID}} + //sess.MarkMessage(msg, "") + rwLock.Lock() + if len(msg.Value) != 0 { + cMsg = append(cMsg, msg) + } + rwLock.Unlock() + sess.MarkMessage(msg, "") + //och.TriggerCmd(OnlineTopicBusy) + + //log.NewDebug("", "online kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "online", msg.Offset, claim.HighWaterMarkOffset()) + + } + return nil } + +//func (och *OnlineHistoryRedisConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, +// claim sarama.ConsumerGroupClaim) error { // a instance in the consumer group +// +// for { +// if sess == nil { +// log.NewWarn("", " sess == nil, waiting ") +// time.Sleep(100 * time.Millisecond) +// } else { +// break +// } +// } +// +// log.NewDebug("", "online new session msg come", claim.HighWaterMarkOffset(), claim.Topic(), claim.Partition()) +// cMsg := make([]*sarama.ConsumerMessage, 0, 1000) +// t := time.NewTicker(time.Duration(100) * time.Millisecond) +// var triggerID string +// for msg := range claim.Messages() { +// cMsg = append(cMsg, msg) +// //och.TriggerCmd(OnlineTopicBusy) +// select { +// //case : +// // triggerID = utils.OperationIDGenerator() +// // +// // log.NewDebug(triggerID, "claim.Messages ", msg) +// // cMsg = append(cMsg, msg) +// // if len(cMsg) >= 1000 { +// // ccMsg := make([]*sarama.ConsumerMessage, 0, 1000) +// // for _, v := range cMsg { +// // ccMsg = append(ccMsg, v) +// // } +// // log.Debug(triggerID, "length trigger msg consumer start", len(ccMsg)) +// // och.msgDistributionCh <- Cmd2Value{Cmd: ConsumerMsgs, Value: TriggerChannelValue{ +// // triggerID: triggerID, cmsgList: ccMsg}} +// // sess.MarkMessage(msg, "") +// // cMsg = make([]*sarama.ConsumerMessage, 0, 1000) +// // log.Debug(triggerID, "length trigger msg consumer end", len(cMsg)) +// // } +// +// case <-t.C: +// if len(cMsg) > 0 { +// ccMsg := make([]*sarama.ConsumerMessage, 0, 1000) +// for _, v := range cMsg { +// ccMsg = append(ccMsg, v) +// } +// triggerID = utils.OperationIDGenerator() +// log.Debug(triggerID, "timer trigger msg consumer start", len(ccMsg)) +// och.msgDistributionCh <- Cmd2Value{Cmd: ConsumerMsgs, Value: TriggerChannelValue{ +// triggerID: triggerID, cmsgList: ccMsg}} +// sess.MarkMessage(cMsg[len(cMsg)-1], "") +// cMsg = make([]*sarama.ConsumerMessage, 0, 1000) +// log.Debug(triggerID, "timer trigger msg consumer end", len(cMsg)) +// } +// default: +// +// } +// //log.NewDebug("", "online kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "online", msg.Offset, claim.HighWaterMarkOffset()) +// +// } +// return nil +//} func sendMessageToPush(message *pbMsg.MsgDataToMQ, pushToUserID string) { log.Info(message.OperationID, "msg_transfer send message to push", "message", message.String()) rpcPushMsg := pbPush.PushMsgReq{OperationID: message.OperationID, MsgData: message.MsgData, PushToUserID: pushToUserID} mqPushMsg := pbMsg.PushMsgDataToMQ{OperationID: message.OperationID, MsgData: message.MsgData, PushToUserID: pushToUserID} - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImPushName) + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImPushName, message.OperationID) if grpcConn == nil { log.Error(rpcPushMsg.OperationID, "rpc dial failed", "push data", rpcPushMsg.String()) - pid, offset, err := producer.SendMessage(&mqPushMsg) + pid, offset, err := producer.SendMessage(&mqPushMsg, mqPushMsg.PushToUserID, rpcPushMsg.OperationID) if err != nil { log.Error(mqPushMsg.OperationID, "kafka send failed", "send data", message.String(), "pid", pid, "offset", offset, "err", err.Error()) } @@ -163,7 +525,7 @@ func sendMessageToPush(message *pbMsg.MsgDataToMQ, pushToUserID string) { _, err := msgClient.PushMsg(context.Background(), &rpcPushMsg) if err != nil { log.Error(rpcPushMsg.OperationID, "rpc send failed", rpcPushMsg.OperationID, "push data", rpcPushMsg.String(), "err", err.Error()) - pid, offset, err := producer.SendMessage(&mqPushMsg) + pid, offset, err := producer.SendMessage(&mqPushMsg, mqPushMsg.PushToUserID, rpcPushMsg.OperationID) if err != nil { log.Error(message.OperationID, "kafka send failed", mqPushMsg.OperationID, "send data", mqPushMsg.String(), "pid", pid, "offset", offset, "err", err.Error()) } @@ -172,3 +534,12 @@ func sendMessageToPush(message *pbMsg.MsgDataToMQ, pushToUserID string) { } } + +// String hashes a string to a unique hashcode. +// +// crc32 returns a uint32, but for our use we need +// and non negative integer. Here we cast to an integer +// and invert it if the result is negative. +func getHashCode(s string) uint32 { + return crc32.ChecksumIEEE([]byte(s)) +} diff --git a/internal/msg_transfer/logic/online_msg_to_mongo_handler.go b/internal/msg_transfer/logic/online_msg_to_mongo_handler.go new file mode 100644 index 000000000..dae6571f8 --- /dev/null +++ b/internal/msg_transfer/logic/online_msg_to_mongo_handler.go @@ -0,0 +1,79 @@ +package logic + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + kfk "Open_IM/pkg/common/kafka" + "Open_IM/pkg/common/log" + pbMsg "Open_IM/pkg/proto/chat" + server_api_params "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "github.com/Shopify/sarama" + "github.com/golang/protobuf/proto" +) + +type OnlineHistoryMongoConsumerHandler struct { + msgHandle map[string]fcb + historyConsumerGroup *kfk.MConsumerGroup +} + +func (och *OnlineHistoryMongoConsumerHandler) Init() { + och.msgHandle = make(map[string]fcb) + och.msgHandle[config.Config.Kafka.MsgToMongo.Topic] = och.handleChatWs2Mongo + och.historyConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V2_0_0_0, + OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false}, []string{config.Config.Kafka.MsgToMongo.Topic}, + config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.ConsumerGroupID.MsgToMongo) + +} +func (mc *OnlineHistoryMongoConsumerHandler) handleChatWs2Mongo(cMsg *sarama.ConsumerMessage, msgKey string, _ sarama.ConsumerGroupSession) { + msg := cMsg.Value + msgFromMQ := pbMsg.MsgDataToMongoByMQ{} + err := proto.Unmarshal(msg, &msgFromMQ) + if err != nil { + log.Error("msg_transfer Unmarshal msg err", "", "msg", string(msg), "err", err.Error()) + return + } + err = db.DB.BatchInsertChat2DB(msgFromMQ.AggregationID, msgFromMQ.MessageList, msgFromMQ.TriggerID, msgFromMQ.LastSeq) + if err != nil { + log.NewError(msgFromMQ.TriggerID, "single data insert to mongo err", err.Error(), msgFromMQ.MessageList) + } + for _, v := range msgFromMQ.MessageList { + if v.MsgData.ContentType == constant.DeleteMessageNotification { + tips := server_api_params.TipsComm{} + DeleteMessageTips := server_api_params.DeleteMessageTips{} + err := proto.Unmarshal(v.MsgData.Content, &tips) + if err != nil { + log.NewError(msgFromMQ.TriggerID, "tips unmarshal err:", err.Error(), v.String()) + continue + } + err = proto.Unmarshal(tips.Detail, &DeleteMessageTips) + if err != nil { + log.NewError(msgFromMQ.TriggerID, "deleteMessageTips unmarshal err:", err.Error(), v.String()) + continue + } + if unexistSeqList, err := db.DB.DelMsgBySeqList(DeleteMessageTips.UserID, DeleteMessageTips.SeqList, v.OperationID); err != nil { + log.NewError(v.OperationID, utils.GetSelfFuncName(), "DelMsgBySeqList args: ", DeleteMessageTips.UserID, DeleteMessageTips.SeqList, v.OperationID, err.Error(), unexistSeqList) + } + + } + } +} + +func (OnlineHistoryMongoConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } +func (OnlineHistoryMongoConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } + +func (och *OnlineHistoryMongoConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, + claim sarama.ConsumerGroupClaim) error { // a instance in the consumer group + log.NewDebug("", "online new session msg come", claim.HighWaterMarkOffset(), claim.Topic(), claim.Partition()) + for msg := range claim.Messages() { + log.NewDebug("", "kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value), "key", string(msg.Key)) + if len(msg.Value) != 0 { + och.msgHandle[msg.Topic](msg, string(msg.Key), sess) + } else { + log.Error("", "mongo msg get from kafka but is nil", msg.Key) + } + sess.MarkMessage(msg, "") + } + return nil +} diff --git a/internal/msg_transfer/logic/persistent_msg_handler.go b/internal/msg_transfer/logic/persistent_msg_handler.go index 6e330a664..4a313d1ad 100644 --- a/internal/msg_transfer/logic/persistent_msg_handler.go +++ b/internal/msg_transfer/logic/persistent_msg_handler.go @@ -26,14 +26,15 @@ type PersistentConsumerHandler struct { func (pc *PersistentConsumerHandler) Init() { pc.msgHandle = make(map[string]fcb) pc.msgHandle[config.Config.Kafka.Ws2mschat.Topic] = pc.handleChatWs2Mysql - pc.persistentConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V0_10_2_0, + pc.persistentConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V2_0_0_0, OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false}, []string{config.Config.Kafka.Ws2mschat.Topic}, config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.ConsumerGroupID.MsgToMySql) } -func (pc *PersistentConsumerHandler) handleChatWs2Mysql(msg []byte, msgKey string) { - log.NewInfo("msg come here mysql!!!", "", "msg", string(msg)) +func (pc *PersistentConsumerHandler) handleChatWs2Mysql(cMsg *sarama.ConsumerMessage, msgKey string, _ sarama.ConsumerGroupSession) { + msg := cMsg.Value + log.NewInfo("msg come here mysql!!!", "", "msg", string(msg), msgKey) var tag bool msgFromMQ := pbMsg.MsgDataToMQ{} err := proto.Unmarshal(msg, &msgFromMQ) @@ -41,6 +42,7 @@ func (pc *PersistentConsumerHandler) handleChatWs2Mysql(msg []byte, msgKey strin log.NewError(msgFromMQ.OperationID, "msg_transfer Unmarshal msg err", "msg", string(msg), "err", err.Error()) return } + log.Debug(msgFromMQ.OperationID, "proto.Unmarshal MsgDataToMQ", msgFromMQ.String()) //Control whether to store history messages (mysql) isPersist := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsPersistent) //Only process receiver data @@ -54,6 +56,8 @@ func (pc *PersistentConsumerHandler) handleChatWs2Mysql(msg []byte, msgKey strin if msgKey == msgFromMQ.MsgData.SendID { tag = true } + case constant.SuperGroupChatType: + tag = true } if tag { log.NewInfo(msgFromMQ.OperationID, "msg_transfer msg persisting", string(msg)) @@ -70,8 +74,12 @@ func (PersistentConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { func (pc *PersistentConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error { for msg := range claim.Messages() { - log.NewDebug("", "kafka get info to mysql", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value)) - pc.msgHandle[msg.Topic](msg.Value, string(msg.Key)) + log.NewDebug("", "kafka get info to mysql", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value), "key", string(msg.Key)) + if len(msg.Value) != 0 { + pc.msgHandle[msg.Topic](msg, string(msg.Key), sess) + } else { + log.Error("", "msg get from kafka but is nil", msg.Key) + } sess.MarkMessage(msg, "") } return nil diff --git a/internal/push/getui/push.go b/internal/push/getui/push.go index b91b51fc2..03d3346ce 100644 --- a/internal/push/getui/push.go +++ b/internal/push/getui/push.go @@ -1,6 +1,7 @@ package getui import ( + "Open_IM/internal/push" "Open_IM/pkg/common/config" "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" @@ -98,7 +99,7 @@ func newGetuiClient() *Getui { return &Getui{} } -func (g *Getui) Push(userIDList []string, alert, detailContent, operationID string) (resp string, err error) { +func (g *Getui) Push(userIDList []string, alert, detailContent, operationID string, opts push.PushOpts) (resp string, err error) { token, err := db.DB.GetGetuiToken() log.NewDebug(operationID, utils.GetSelfFuncName(), "token:", token) if err != nil { diff --git a/internal/push/jpush/push.go b/internal/push/jpush/push.go index aaaee306d..060b11d78 100644 --- a/internal/push/jpush/push.go +++ b/internal/push/jpush/push.go @@ -1,6 +1,7 @@ package push import ( + "Open_IM/internal/push" "Open_IM/internal/push/jpush/common" "Open_IM/internal/push/jpush/requestBody" "Open_IM/pkg/common/config" @@ -32,17 +33,25 @@ func (j *JPush) SetAlias(cid, alias string) (resp string, err error) { return resp, nil } -func (j *JPush) Push(accounts []string, alert, detailContent, operationID string) (string, error) { +func (j *JPush) Push(accounts []string, alert, detailContent, operationID string, opts push.PushOpts) (string, error) { + var pf requestBody.Platform pf.SetAll() var au requestBody.Audience au.SetAlias(accounts) var no requestBody.Notification + + var extras requestBody.Extras + if opts.Signal.ClientMsgID != "" { + extras.ClientMsgID = opts.Signal.ClientMsgID + } + no.IOSEnableMutableContent() + no.SetExtras(extras) no.SetAlert(alert) var me requestBody.Message me.SetMsgContent(detailContent) var o requestBody.Options - o.SetApnsProduction(false) + o.SetApnsProduction(config.Config.IOSPush.Production) var po requestBody.PushObj po.SetPlatform(&pf) po.SetAudience(&au) diff --git a/internal/push/jpush/requestBody/notification.go b/internal/push/jpush/requestBody/notification.go index 9ff49a439..56ada1551 100644 --- a/internal/push/jpush/requestBody/notification.go +++ b/internal/push/jpush/requestBody/notification.go @@ -15,11 +15,18 @@ type Android struct { Intent struct { URL string `json:"url,omitempty"` } `json:"intent,omitempty"` + Extras Extras `json:"extras"` } type Ios struct { - Alert string `json:"alert,omitempty"` - Sound string `json:"sound,omitempty"` - Badge string `json:"badge,omitempty"` + Alert string `json:"alert,omitempty"` + Sound string `json:"sound,omitempty"` + Badge string `json:"badge,omitempty"` + Extras Extras `json:"extras"` + MutableContent bool `json:"mutable-content"` +} + +type Extras struct { + ClientMsgID string `json:"clientMsgID"` } func (n *Notification) SetAlert(alert string) { @@ -29,8 +36,17 @@ func (n *Notification) SetAlert(alert string) { n.IOS.Alert = alert n.IOS.Sound = "default" n.IOS.Badge = "+1" - } + +func (n *Notification) SetExtras(extras Extras) { + n.IOS.Extras = extras + n.Android.Extras = extras +} + func (n *Notification) SetAndroidIntent() { n.Android.Intent.URL = config.Config.Push.Jpns.PushIntent } + +func (n *Notification) IOSEnableMutableContent() { + n.IOS.MutableContent = true +} diff --git a/internal/push/logic/callback.go b/internal/push/logic/callback.go new file mode 100644 index 000000000..e8fd576a5 --- /dev/null +++ b/internal/push/logic/callback.go @@ -0,0 +1,46 @@ +package logic + +import ( + cbApi "Open_IM/pkg/call_back_struct" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/http" + commonPb "Open_IM/pkg/proto/sdk_ws" + http2 "net/http" +) + +func callbackOfflinePush(operationID, userID string, msg *commonPb.MsgData) cbApi.CommonCallbackResp { + callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} + if !config.Config.Callback.CallbackOfflinePush.Enable { + return callbackResp + } + callbackOfflinePushReq := cbApi.CallbackOfflinePushReq{ + UserStatusCallbackReq: cbApi.UserStatusCallbackReq{ + CallbackCommand: constant.CallbackOfflinePushCommand, + OperationID: operationID, + UserID: userID, + PlatformID: msg.SenderPlatformID, + Platform: constant.PlatformIDToName(int(msg.SenderPlatformID)), + }, + OfflinePushInfo: msg.OfflinePushInfo, + SendID: msg.SendID, + GroupID: msg.GroupID, + ContentType: msg.ContentType, + SessionType: msg.SessionType, + AtUserIDList: msg.AtUserIDList, + Content: string(msg.Content), + } + callbackOfflinePushResp := &cbApi.CallbackOfflinePushResp{CommonCallbackResp: &callbackResp} + if err := http.PostReturn(config.Config.Callback.CallbackUrl, callbackOfflinePushReq, callbackOfflinePushResp, config.Config.Callback.CallbackOfflinePush.CallbackTimeOut); err != nil { + callbackResp.ErrCode = http2.StatusInternalServerError + callbackResp.ErrMsg = err.Error() + if !config.Config.Callback.CallbackOfflinePush.CallbackFailedContinue { + callbackResp.ActionCode = constant.ActionForbidden + return callbackResp + } else { + callbackResp.ActionCode = constant.ActionAllow + return callbackResp + } + } + return callbackResp +} diff --git a/internal/push/logic/init.go b/internal/push/logic/init.go index 75902e7f8..c9e168940 100644 --- a/internal/push/logic/init.go +++ b/internal/push/logic/init.go @@ -7,6 +7,9 @@ package logic import ( + pusher "Open_IM/internal/push" + "Open_IM/internal/push/getui" + jpush "Open_IM/internal/push/jpush" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/kafka" @@ -15,11 +18,12 @@ import ( ) var ( - rpcServer RPCServer - pushCh PushConsumerHandler - pushTerminal []int32 - producer *kafka.Producer - successCount uint64 + rpcServer RPCServer + pushCh PushConsumerHandler + pushTerminal []int32 + producer *kafka.Producer + offlinePusher pusher.OfflinePusher + successCount uint64 ) func Init(rpcPort int) { @@ -31,6 +35,12 @@ func Init(rpcPort int) { func init() { producer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.Ws2mschat.Topic) statistics.NewStatistics(&successCount, config.Config.ModuleName.PushName, fmt.Sprintf("%d second push to msg_gateway count", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval) + if config.Config.Push.Getui.Enable { + offlinePusher = getui.GetuiClient + } + if config.Config.Push.Jpns.Enable { + offlinePusher = jpush.JPushClient + } } func Run() { diff --git a/internal/push/logic/push_handler.go b/internal/push/logic/push_handler.go index 5412b8b3e..e18f0c136 100644 --- a/internal/push/logic/push_handler.go +++ b/internal/push/logic/push_handler.go @@ -26,7 +26,7 @@ type PushConsumerHandler struct { func (ms *PushConsumerHandler) Init() { ms.msgHandle = make(map[string]fcb) ms.msgHandle[config.Config.Kafka.Ms2pschat.Topic] = ms.handleMs2PsChat - ms.pushConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V0_10_2_0, + ms.pushConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V2_0_0_0, OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false}, []string{config.Config.Kafka.Ms2pschat.Topic}, config.Config.Kafka.Ms2pschat.Addr, config.Config.Kafka.ConsumerGroupID.MsgToPush) } diff --git a/internal/push/logic/push_rpc_server.go b/internal/push/logic/push_rpc_server.go index ba656a7d0..08939ef1a 100644 --- a/internal/push/logic/push_rpc_server.go +++ b/internal/push/logic/push_rpc_server.go @@ -2,6 +2,7 @@ package logic import ( "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" "Open_IM/pkg/proto/push" @@ -43,7 +44,7 @@ func (r *RPCServer) run() { srv := grpc.NewServer() defer srv.GracefulStop() pbPush.RegisterPushMsgServiceServer(srv, r) - rpcRegisterIP := "" + rpcRegisterIP := config.Config.RpcRegisterIP if config.Config.RpcRegisterIP == "" { rpcRegisterIP, err = utils.GetLocalIP() if err != nil { @@ -63,7 +64,12 @@ func (r *RPCServer) run() { } func (r *RPCServer) PushMsg(_ context.Context, pbData *pbPush.PushMsgReq) (*pbPush.PushMsgResp, error) { //Call push module to send message to the user - MsgToUser(pbData) + switch pbData.MsgData.SessionType { + case constant.SuperGroupChatType: + MsgToSuperGroupUser(pbData) + default: + MsgToUser(pbData) + } return &pbPush.PushMsgResp{ ResultCode: 0, }, nil diff --git a/internal/push/logic/push_to_client.go b/internal/push/logic/push_to_client.go index b8125be5a..ea7a435de 100644 --- a/internal/push/logic/push_to_client.go +++ b/internal/push/logic/push_to_client.go @@ -7,18 +7,21 @@ package logic import ( - pusher "Open_IM/internal/push" - "Open_IM/internal/push/getui" - jpush "Open_IM/internal/push/jpush" + "Open_IM/internal/push" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbCache "Open_IM/pkg/proto/cache" pbPush "Open_IM/pkg/proto/push" pbRelay "Open_IM/pkg/proto/relay" + pbRtc "Open_IM/pkg/proto/rtc" "Open_IM/pkg/utils" "context" "encoding/json" + "github.com/golang/protobuf/proto" + "google.golang.org/grpc" "strings" ) @@ -34,94 +37,244 @@ type AtContent struct { IsAtSelf bool `json:"isAtSelf"` } +var grpcCons []*grpc.ClientConn + func MsgToUser(pushMsg *pbPush.PushMsgReq) { - var wsResult []*pbRelay.SingleMsgToUser + var wsResult []*pbRelay.SingelMsgToUserResultList isOfflinePush := utils.GetSwitchFromOptions(pushMsg.MsgData.Options, constant.IsOfflinePush) log.Debug(pushMsg.OperationID, "Get msg from msg_transfer And push msg", pushMsg.String()) - grpcCons := getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName) + if len(grpcCons) == 0 { + log.NewWarn(pushMsg.OperationID, "first GetConn4Unique ") + grpcCons = getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName) + } //Online push message - log.Debug("test", pushMsg.OperationID, "len grpc", len(grpcCons), "data", pushMsg.String()) + log.Debug(pushMsg.OperationID, "len grpc", len(grpcCons), "data", pushMsg.String()) for _, v := range grpcCons { msgClient := pbRelay.NewOnlineMessageRelayServiceClient(v) - reply, err := msgClient.OnlinePushMsg(context.Background(), &pbRelay.OnlinePushMsgReq{OperationID: pushMsg.OperationID, MsgData: pushMsg.MsgData, PushToUserID: pushMsg.PushToUserID}) + reply, err := msgClient.SuperGroupOnlineBatchPushOneMsg(context.Background(), &pbRelay.OnlineBatchPushOneMsgReq{OperationID: pushMsg.OperationID, MsgData: pushMsg.MsgData, PushToUserIDList: []string{pushMsg.PushToUserID}}) if err != nil { - log.NewError("push data to client rpc err", pushMsg.OperationID, "err", err) + log.NewError("SuperGroupOnlineBatchPushOneMsg push data to client rpc err", pushMsg.OperationID, "err", err) continue } - if reply != nil && reply.Resp != nil { - wsResult = append(wsResult, reply.Resp...) + if reply != nil && reply.SinglePushResult != nil { + wsResult = append(wsResult, reply.SinglePushResult...) } } log.NewInfo(pushMsg.OperationID, "push_result", wsResult, "sendData", pushMsg.MsgData) successCount++ if isOfflinePush && pushMsg.PushToUserID != pushMsg.MsgData.SendID { + // save invitation info for offline push for _, v := range wsResult { - if v.ResultCode == 0 { - continue + if v.OnlinePush { + return } - if utils.IsContainInt32(v.RecvPlatFormID, pushTerminal) { - //Use offline push messaging - var UIDList []string - UIDList = append(UIDList, v.RecvID) - customContent := OpenIMContent{ - SessionType: int(pushMsg.MsgData.SessionType), - From: pushMsg.MsgData.SendID, - To: pushMsg.MsgData.RecvID, - Seq: pushMsg.MsgData.Seq, - } - bCustomContent, _ := json.Marshal(customContent) - jsonCustomContent := string(bCustomContent) - var content string - if pushMsg.MsgData.OfflinePushInfo != nil { - content = pushMsg.MsgData.OfflinePushInfo.Title - - } else { - switch pushMsg.MsgData.ContentType { - case constant.Text: - content = constant.ContentType2PushContent[constant.Text] - case constant.Picture: - content = constant.ContentType2PushContent[constant.Picture] - case constant.Voice: - content = constant.ContentType2PushContent[constant.Voice] - case constant.Video: - content = constant.ContentType2PushContent[constant.Video] - case constant.File: - content = constant.ContentType2PushContent[constant.File] - case constant.AtText: - a := AtContent{} - _ = utils.JsonStringToStruct(string(pushMsg.MsgData.Content), &a) - if utils.IsContain(v.RecvID, a.AtUserList) { - content = constant.ContentType2PushContent[constant.AtText] + constant.ContentType2PushContent[constant.Common] - } else { - content = constant.ContentType2PushContent[constant.GroupMsg] - } - default: - content = constant.ContentType2PushContent[constant.Common] - } - } - var offlinePusher pusher.OfflinePusher - if config.Config.Push.Getui.Enable { - log.NewInfo(pushMsg.OperationID, utils.GetSelfFuncName(), config.Config.Push.Getui) - offlinePusher = getui.GetuiClient - } - if config.Config.Push.Jpns.Enable { - offlinePusher = jpush.JPushClient - } - if offlinePusher == nil { - offlinePusher = jpush.JPushClient - } - pushResult, err := offlinePusher.Push(UIDList, content, jsonCustomContent, pushMsg.OperationID) - if err != nil { - log.NewError(pushMsg.OperationID, "offline push error", pushMsg.String(), err.Error()) - } else { - log.NewDebug(pushMsg.OperationID, "offline push return result is ", pushResult, pushMsg.MsgData) - } - break + } + if pushMsg.MsgData.ContentType == constant.SignalingNotification { + if err := db.DB.HandleSignalInfo(pushMsg.OperationID, pushMsg.MsgData); err != nil { + log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), err.Error(), pushMsg.MsgData) + return } + } + //Use offline push messaging + var UIDList []string + UIDList = append(UIDList, pushMsg.PushToUserID) + customContent := OpenIMContent{ + SessionType: int(pushMsg.MsgData.SessionType), + From: pushMsg.MsgData.SendID, + To: pushMsg.MsgData.RecvID, + Seq: pushMsg.MsgData.Seq, + } + bCustomContent, _ := json.Marshal(customContent) + jsonCustomContent := string(bCustomContent) + var content string + if pushMsg.MsgData.OfflinePushInfo != nil { + content = pushMsg.MsgData.OfflinePushInfo.Title + } else { + switch pushMsg.MsgData.ContentType { + case constant.Text: + content = constant.ContentType2PushContent[constant.Text] + case constant.Picture: + content = constant.ContentType2PushContent[constant.Picture] + case constant.Voice: + content = constant.ContentType2PushContent[constant.Voice] + case constant.Video: + content = constant.ContentType2PushContent[constant.Video] + case constant.File: + content = constant.ContentType2PushContent[constant.File] + case constant.AtText: + a := AtContent{} + _ = utils.JsonStringToStruct(string(pushMsg.MsgData.Content), &a) + if utils.IsContain(pushMsg.PushToUserID, a.AtUserList) { + content = constant.ContentType2PushContent[constant.AtText] + constant.ContentType2PushContent[constant.Common] + } else { + content = constant.ContentType2PushContent[constant.GroupMsg] + } + case constant.SignalingNotification: + content = constant.ContentType2PushContent[constant.SignalMsg] + default: + content = constant.ContentType2PushContent[constant.Common] + + } + } + + callbackResp := callbackOfflinePush(pushMsg.OperationID, UIDList[0], pushMsg.MsgData) + log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offline callback Resp") + if callbackResp.ErrCode != 0 { + log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "callbackOfflinePush result: ", callbackResp) + } + if callbackResp.ActionCode != constant.ActionAllow { + log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offlinePush stop") + return + } + if offlinePusher == nil { + return + } + opts, err := GetOfflinePushOpts(pushMsg) + if err != nil { + log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "GetOfflinePushOpts failed", pushMsg, err.Error()) + } + log.NewInfo(pushMsg.OperationID, utils.GetSelfFuncName(), UIDList, content, jsonCustomContent, "opts:", opts) + pushResult, err := offlinePusher.Push(UIDList, content, jsonCustomContent, pushMsg.OperationID, opts) + if err != nil { + log.NewError(pushMsg.OperationID, "offline push error", pushMsg.String(), err.Error()) + } else { + log.NewDebug(pushMsg.OperationID, "offline push return result is ", pushResult, pushMsg.MsgData) + } + } +} + +func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) { + var wsResult []*pbRelay.SingelMsgToUserResultList + isOfflinePush := utils.GetSwitchFromOptions(pushMsg.MsgData.Options, constant.IsOfflinePush) + log.Debug(pushMsg.OperationID, "Get super group msg from msg_transfer And push msg", pushMsg.String()) + getGroupMemberIDListFromCacheReq := &pbCache.GetGroupMemberIDListFromCacheReq{OperationID: pushMsg.OperationID, GroupID: pushMsg.MsgData.GroupID} + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, pushMsg.OperationID) + if etcdConn == nil { + errMsg := pushMsg.OperationID + "getcdv3.GetConn == nil" + log.NewError(pushMsg.OperationID, errMsg) + return + } + client := pbCache.NewCacheClient(etcdConn) + cacheResp, err := client.GetGroupMemberIDListFromCache(context.Background(), getGroupMemberIDListFromCacheReq) + if err != nil { + log.NewError(pushMsg.OperationID, "GetGroupMemberIDListFromCache rpc call failed ", err.Error()) + return + } + if cacheResp.CommonResp.ErrCode != 0 { + log.NewError(pushMsg.OperationID, "GetGroupMemberIDListFromCache rpc logic call failed ", cacheResp.String()) + return + } + if len(grpcCons) == 0 { + log.NewWarn(pushMsg.OperationID, "first GetConn4Unique ") + grpcCons = getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName) + } + //Online push message + log.Debug("test", pushMsg.OperationID, "len grpc", len(grpcCons), "data", pushMsg.String()) + for _, v := range grpcCons { + msgClient := pbRelay.NewOnlineMessageRelayServiceClient(v) + reply, err := msgClient.SuperGroupOnlineBatchPushOneMsg(context.Background(), &pbRelay.OnlineBatchPushOneMsgReq{OperationID: pushMsg.OperationID, MsgData: pushMsg.MsgData, PushToUserIDList: cacheResp.UserIDList}) + if err != nil { + log.NewError("push data to client rpc err", pushMsg.OperationID, "err", err) + continue + } + if reply != nil && reply.SinglePushResult != nil { + wsResult = append(wsResult, reply.SinglePushResult...) + } + } + log.Debug(pushMsg.OperationID, "push_result", wsResult, "sendData", pushMsg.MsgData) + successCount++ + if isOfflinePush { + var onlineSuccessUserIDList []string + onlineSuccessUserIDList = append(onlineSuccessUserIDList, pushMsg.MsgData.SendID) + for _, v := range wsResult { + if v.OnlinePush && v.UserID != pushMsg.MsgData.SendID { + onlineSuccessUserIDList = append(onlineSuccessUserIDList, v.UserID) + } + } + onlineFailedUserIDList := utils.DifferenceString(onlineSuccessUserIDList, cacheResp.UserIDList) + //Use offline push messaging + customContent := OpenIMContent{ + SessionType: int(pushMsg.MsgData.SessionType), + From: pushMsg.MsgData.SendID, + To: pushMsg.MsgData.RecvID, + Seq: pushMsg.MsgData.Seq, + } + bCustomContent, _ := json.Marshal(customContent) + jsonCustomContent := string(bCustomContent) + var content string + if pushMsg.MsgData.OfflinePushInfo != nil { + content = pushMsg.MsgData.OfflinePushInfo.Title + + } else { + switch pushMsg.MsgData.ContentType { + case constant.Text: + content = constant.ContentType2PushContent[constant.Text] + case constant.Picture: + content = constant.ContentType2PushContent[constant.Picture] + case constant.Voice: + content = constant.ContentType2PushContent[constant.Voice] + case constant.Video: + content = constant.ContentType2PushContent[constant.Video] + case constant.File: + content = constant.ContentType2PushContent[constant.File] + case constant.AtText: + a := AtContent{} + _ = utils.JsonStringToStruct(string(pushMsg.MsgData.Content), &a) + if utils.IsContain(pushMsg.PushToUserID, a.AtUserList) { + content = constant.ContentType2PushContent[constant.AtText] + constant.ContentType2PushContent[constant.Common] + } else { + content = constant.ContentType2PushContent[constant.GroupMsg] + } + case constant.SignalingNotification: + content = constant.ContentType2PushContent[constant.SignalMsg] + default: + content = constant.ContentType2PushContent[constant.Common] + + } + } + + callbackResp := callbackOfflinePush(pushMsg.OperationID, onlineFailedUserIDList[0], pushMsg.MsgData) + log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offline callback Resp") + if callbackResp.ErrCode != 0 { + log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "callbackOfflinePush result: ", callbackResp) + } + if callbackResp.ActionCode != constant.ActionAllow { + log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offlinePush stop") + return + } + if offlinePusher == nil { + return + } + opts, err := GetOfflinePushOpts(pushMsg) + if err != nil { + log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "GetOfflinePushOpts failed", pushMsg, err.Error()) + } + log.NewInfo(pushMsg.OperationID, utils.GetSelfFuncName(), onlineFailedUserIDList, content, jsonCustomContent, "opts:", opts) + pushResult, err := offlinePusher.Push(onlineFailedUserIDList, content, jsonCustomContent, pushMsg.OperationID, opts) + if err != nil { + log.NewError(pushMsg.OperationID, "offline push error", pushMsg.String(), err.Error()) + } else { + log.NewDebug(pushMsg.OperationID, "offline push return result is ", pushResult, pushMsg.MsgData) + } + } +} + +func GetOfflinePushOpts(pushMsg *pbPush.PushMsgReq) (opts push.PushOpts, err error) { + if pushMsg.MsgData.ContentType < constant.SignalingNotificationEnd && pushMsg.MsgData.ContentType > constant.SignalingNotificationBegin { + req := &pbRtc.SignalReq{} + if err := proto.Unmarshal(pushMsg.MsgData.Content, req); err != nil { + return opts, utils.Wrap(err, "") + } + log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "SignalReq: ", req.String()) + switch req.Payload.(type) { + case *pbRtc.SignalReq_Invite, *pbRtc.SignalReq_InviteInGroup: + opts.Signal.ClientMsgID = pushMsg.MsgData.ClientMsgID + log.NewDebug(pushMsg.OperationID, opts) } } + return opts, nil } //func SendMsgByWS(m *pbChat.WSToMsgSvrChatMsg) { diff --git a/internal/push/push_interface.go b/internal/push/push_interface.go index 59b4764b4..a1d45d7b7 100644 --- a/internal/push/push_interface.go +++ b/internal/push/push_interface.go @@ -1,5 +1,13 @@ package push type OfflinePusher interface { - Push(userIDList []string, alert, detailContent, operationID string) (resp string, err error) + Push(userIDList []string, alert, detailContent, operationID string, opts PushOpts) (resp string, err error) +} + +type PushOpts struct { + Signal Signal +} + +type Signal struct { + ClientMsgID string } diff --git a/internal/rpc/admin_cms/admin_cms.go b/internal/rpc/admin_cms/admin_cms.go index e8084836f..4a97f94e1 100644 --- a/internal/rpc/admin_cms/admin_cms.go +++ b/internal/rpc/admin_cms/admin_cms.go @@ -10,10 +10,11 @@ import ( pbAdminCMS "Open_IM/pkg/proto/admin_cms" "Open_IM/pkg/utils" "context" - "google.golang.org/grpc" "net" "strconv" "strings" + + "google.golang.org/grpc" ) type adminCMSServer struct { @@ -55,13 +56,14 @@ func (s *adminCMSServer) Run() { defer srv.GracefulStop() //Service registers with etcd pbAdminCMS.RegisterAdminCMSServer(srv, s) - rpcRegisterIP := "" + rpcRegisterIP := config.Config.RpcRegisterIP if config.Config.RpcRegisterIP == "" { rpcRegisterIP, err = utils.GetLocalIP() if err != nil { log.Error("", "GetLocalIP failed ", err.Error()) } } + log.NewInfo("", "rpcRegisterIP", rpcRegisterIP) err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) if err != nil { log.NewError("0", "RegisterEtcd failed ", err.Error()) diff --git a/internal/rpc/auth/auth.go b/internal/rpc/auth/auth.go index 09b903c68..31c0cd62b 100644 --- a/internal/rpc/auth/auth.go +++ b/internal/rpc/auth/auth.go @@ -8,8 +8,10 @@ import ( "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" pbAuth "Open_IM/pkg/proto/auth" + pbRelay "Open_IM/pkg/proto/relay" "Open_IM/pkg/utils" "context" + "errors" "net" "strconv" "strings" @@ -47,7 +49,7 @@ func (rpc *rpcAuth) UserToken(_ context.Context, req *pbAuth.UserTokenReq) (*pbA return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}}, nil } - tokens, expTime, err := token_verify.CreateToken(req.FromUserID, req.Platform) + tokens, expTime, err := token_verify.CreateToken(req.FromUserID, int(req.Platform)) if err != nil { errMsg := req.OperationID + " token_verify.CreateToken failed " + err.Error() + req.FromUserID + utils.Int32ToString(req.Platform) log.NewError(req.OperationID, errMsg) @@ -58,6 +60,41 @@ func (rpc *rpcAuth) UserToken(_ context.Context, req *pbAuth.UserTokenReq) (*pbA return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{}, Token: tokens, ExpiredTime: expTime}, nil } +func (rpc *rpcAuth) ForceLogout(_ context.Context, req *pbAuth.ForceLogoutReq) (*pbAuth.ForceLogoutResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + if !token_verify.IsManagerUserID(req.OpUserID) { + errMsg := req.OperationID + " IsManagerUserID false " + req.OpUserID + log.NewError(req.OperationID, errMsg) + return &pbAuth.ForceLogoutResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + if err := token_verify.DeleteToken(req.FromUserID, int(req.Platform)); err != nil { + errMsg := req.OperationID + " DeleteToken failed " + err.Error() + req.FromUserID + utils.Int32ToString(req.Platform) + log.NewError(req.OperationID, errMsg) + return &pbAuth.ForceLogoutResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}}, nil + } + if err := rpc.forceKickOff(req.FromUserID, req.Platform, req.OperationID); err != nil { + errMsg := req.OperationID + " forceKickOff failed " + err.Error() + req.FromUserID + utils.Int32ToString(req.Platform) + log.NewError(req.OperationID, errMsg) + return &pbAuth.ForceLogoutResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}}, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{}}) + return &pbAuth.ForceLogoutResp{CommonResp: &pbAuth.CommonResp{}}, nil +} + +func (rpc *rpcAuth) forceKickOff(userID string, platformID int32, operationID string) error { + + grpcCons := getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName) + for _, v := range grpcCons { + client := pbRelay.NewOnlineMessageRelayServiceClient(v) + kickReq := &pbRelay.KickUserOfflineReq{OperationID: operationID, KickUserIDList: []string{userID}, PlatformID: platformID} + log.NewInfo(operationID, "KickUserOffline ", client, kickReq.String()) + _, err := client.KickUserOffline(context.Background(), kickReq) + return utils.Wrap(err, "") + } + + return errors.New("no rpc node ") +} + type rpcAuth struct { rpcPort int rpcRegisterName string @@ -97,13 +134,14 @@ func (rpc *rpcAuth) Run() { //service registers with etcd pbAuth.RegisterAuthServer(srv, rpc) - rpcRegisterIP := "" + rpcRegisterIP := config.Config.RpcRegisterIP if config.Config.RpcRegisterIP == "" { rpcRegisterIP, err = utils.GetLocalIP() if err != nil { log.Error("", "GetLocalIP failed ", err.Error()) } } + log.NewInfo("", "rpcRegisterIP", rpcRegisterIP) err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), rpcRegisterIP, rpc.rpcPort, rpc.rpcRegisterName, 10) if err != nil { diff --git a/internal/rpc/cache/cache.go b/internal/rpc/cache/cache.go index ab181b908..79d86f2b8 100644 --- a/internal/rpc/cache/cache.go +++ b/internal/rpc/cache/cache.go @@ -14,6 +14,7 @@ import ( "net" "strconv" "strings" + "sync" "google.golang.org/grpc" ) @@ -64,14 +65,14 @@ func (s *cacheServer) Run() { defer srv.GracefulStop() pbCache.RegisterCacheServer(srv, s) - rpcRegisterIP := "" + rpcRegisterIP := config.Config.RpcRegisterIP if config.Config.RpcRegisterIP == "" { rpcRegisterIP, err = utils.GetLocalIP() if err != nil { log.Error("", "GetLocalIP failed ", err.Error()) } } - + log.NewInfo("", "rpcRegisterIP", rpcRegisterIP) err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) if err != nil { log.NewError("0", "RegisterEtcd failed ", err.Error()) @@ -94,36 +95,54 @@ func SyncDB2Cache() error { return utils.Wrap(err, "") } //err = updateAllUserToCache(userList) - err = updateAllFriendToCache(userList) - err = updateAllBlackListToCache(userList) - err = updateAllGroupMemberListToCache() + wg := &sync.WaitGroup{} + wg.Add(3) + go func() { + defer wg.Done() + err = updateAllFriendToCache(userList) + }() + go func() { + defer wg.Done() + err = updateAllBlackListToCache(userList) + }() + go func() { + defer wg.Done() + err = updateAllGroupMemberListToCache() + }() + wg.Wait() return utils.Wrap(err, "") } func DelRelationCache() {} func updateAllUserToCache(userList []db.User) error { + wg := &sync.WaitGroup{} + wg.Add(len(userList)) for _, userInfo := range userList { - userInfoPb := &commonPb.UserInfo{ - UserID: userInfo.UserID, - Nickname: userInfo.Nickname, - FaceURL: userInfo.FaceURL, - Gender: userInfo.Gender, - PhoneNumber: userInfo.PhoneNumber, - Birth: uint32(userInfo.Birth.Unix()), - Email: userInfo.Email, - Ex: userInfo.Ex, - CreateTime: uint32(userInfo.CreateTime.Unix()), - AppMangerLevel: userInfo.AppMangerLevel, - } - m, err := utils.Pb2Map(userInfoPb) - if err != nil { - log.NewWarn("", utils.GetSelfFuncName(), err.Error()) - } - if err := db.DB.SetUserInfoToCache(userInfo.UserID, m); err != nil { - log.NewWarn("0", utils.GetSelfFuncName(), "set userInfo to cache failed", err.Error()) - } + go func() { + defer wg.Done() + userInfoPb := &commonPb.UserInfo{ + UserID: userInfo.UserID, + Nickname: userInfo.Nickname, + FaceURL: userInfo.FaceURL, + Gender: userInfo.Gender, + PhoneNumber: userInfo.PhoneNumber, + Birth: uint32(userInfo.Birth.Unix()), + Email: userInfo.Email, + Ex: userInfo.Ex, + CreateTime: uint32(userInfo.CreateTime.Unix()), + AppMangerLevel: userInfo.AppMangerLevel, + } + m, err := utils.Pb2Map(userInfoPb) + if err != nil { + log.NewWarn("", utils.GetSelfFuncName(), err.Error()) + } + if err := db.DB.SetUserInfoToCache(userInfo.UserID, m); err != nil { + log.NewWarn("0", utils.GetSelfFuncName(), "set userInfo to cache failed", err.Error()) + } + }() } + wg.Wait() log.NewInfo("0", utils.GetSelfFuncName(), "ok") return nil } @@ -135,13 +154,13 @@ func updateAllGroupMemberListToCache() error { log.NewWarn("0", utils.GetSelfFuncName(), "getAllGroupIDList failed", err.Error()) panic(err.Error()) } + for _, groupID := range groupIDList { groupMemberIDList, err := imdb.GetGroupMemberIDListByGroupID(groupID) if err != nil { log.NewWarn("", utils.GetSelfFuncName(), "GetGroupMemberIDListByGroupID", err.Error()) continue } - //log.NewDebug("", utils.GetSelfFuncName(), "groupMemberIDList", groupMemberIDList) if len(groupMemberIDList) > 0 { if err := db.DB.AddGroupMemberToCache(groupID, groupMemberIDList...); err != nil { log.NewWarn("", utils.GetSelfFuncName(), "AddGroupMemberToCache", err.Error()) @@ -166,6 +185,7 @@ func updateAllFriendToCache(userList []db.User) error { } } } + log.NewInfo("0", utils.GetSelfFuncName(), "ok") return nil } diff --git a/internal/rpc/conversation/conversaion.go b/internal/rpc/conversation/conversaion.go index 84e0b302a..9ea7efcc0 100644 --- a/internal/rpc/conversation/conversaion.go +++ b/internal/rpc/conversation/conversaion.go @@ -157,13 +157,14 @@ func (rpc *rpcConversation) Run() { //service registers with etcd pbConversation.RegisterConversationServer(srv, rpc) - rpcRegisterIP := "" + rpcRegisterIP := config.Config.RpcRegisterIP if config.Config.RpcRegisterIP == "" { rpcRegisterIP, err = utils.GetLocalIP() if err != nil { log.Error("", "GetLocalIP failed ", err.Error()) } } + log.NewInfo("", "rpcRegisterIP", rpcRegisterIP) err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), rpcRegisterIP, rpc.rpcPort, rpc.rpcRegisterName, 10) if err != nil { log.NewError("0", "RegisterEtcd failed ", err.Error(), diff --git a/internal/rpc/friend/firend.go b/internal/rpc/friend/firend.go index d85ccbc55..5c2c2a359 100644 --- a/internal/rpc/friend/firend.go +++ b/internal/rpc/friend/firend.go @@ -15,11 +15,12 @@ import ( sdkws "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" - "google.golang.org/grpc" "net" "strconv" "strings" "time" + + "google.golang.org/grpc" ) type friendServer struct { @@ -62,14 +63,14 @@ func (s *friendServer) Run() { defer srv.GracefulStop() //User friend related services register to etcd pbFriend.RegisterFriendServer(srv, s) - rpcRegisterIP := "" + rpcRegisterIP := config.Config.RpcRegisterIP if config.Config.RpcRegisterIP == "" { rpcRegisterIP, err = utils.GetLocalIP() if err != nil { log.Error("", "GetLocalIP failed ", err.Error()) } } - + log.NewInfo("", "rpcRegisterIP", rpcRegisterIP) err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) if err != nil { log.NewError("0", "RegisterEtcd failed ", err.Error(), s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName) @@ -98,7 +99,12 @@ func (s *friendServer) AddBlacklist(ctx context.Context, req *pbFriend.AddBlackl } log.NewInfo(req.CommID.OperationID, "AddBlacklist rpc ok ", req.CommID.FromUserID, req.CommID.ToUserID) reqAddBlackUserToCache := &pbCache.AddBlackUserToCacheReq{UserID: req.CommID.FromUserID, BlackUserID: req.CommID.ToUserID, OperationID: req.CommID.OperationID} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + return &pbFriend.AddBlacklistResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } cacheClient := pbCache.NewCacheClient(etcdConn) cacheResp, err := cacheClient.AddBlackUserToCache(context.Background(), reqAddBlackUserToCache) if err != nil { @@ -262,7 +268,12 @@ func (s *friendServer) AddFriendResponse(ctx context.Context, req *pbFriend.AddF } // cache rpc addFriendToCacheReq := &pbCache.AddFriendToCacheReq{OperationID: req.CommID.OperationID} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + return &pbFriend.AddFriendResponseResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } client := pbCache.NewCacheClient(etcdConn) addFriendToCacheReq.UserID = req.CommID.ToUserID addFriendToCacheReq.FriendID = req.CommID.FromUserID @@ -317,7 +328,12 @@ func (s *friendServer) DeleteFriend(ctx context.Context, req *pbFriend.DeleteFri } log.NewInfo(req.CommID.OperationID, "DeleteFriend rpc ok") reduceFriendFromCache := &pbCache.ReduceFriendFromCacheReq{OperationID: req.CommID.OperationID, UserID: req.CommID.FromUserID, FriendID: req.CommID.ToUserID} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + return &pbFriend.DeleteFriendResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } client := pbCache.NewCacheClient(etcdConn) respPb, err := client.ReduceFriendFromCache(context.Background(), reduceFriendFromCache) if err != nil { @@ -398,7 +414,13 @@ func (s *friendServer) RemoveBlacklist(ctx context.Context, req *pbFriend.Remove } log.NewInfo(req.CommID.OperationID, "rpc RemoveBlacklist ok ") reqReduceBlackUserFromCache := &pbCache.ReduceBlackUserFromCacheReq{UserID: req.CommID.FromUserID, BlackUserID: req.CommID.ToUserID, OperationID: req.CommID.OperationID} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + return &pbFriend.RemoveBlacklistResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } + cacheClient := pbCache.NewCacheClient(etcdConn) cacheResp, err := cacheClient.ReduceBlackUserFromCache(context.Background(), reqReduceBlackUserFromCache) if err != nil { diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index 22fcc61af..ea46bb005 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -12,17 +12,18 @@ import ( cp "Open_IM/pkg/common/utils" "Open_IM/pkg/grpc-etcdv3/getcdv3" pbCache "Open_IM/pkg/proto/cache" + pbConversation "Open_IM/pkg/proto/conversation" pbGroup "Open_IM/pkg/proto/group" open_im_sdk "Open_IM/pkg/proto/sdk_ws" pbUser "Open_IM/pkg/proto/user" "Open_IM/pkg/utils" "context" + "google.golang.org/grpc" + "math/big" "net" "strconv" "strings" "time" - - "google.golang.org/grpc" ) type groupServer struct { @@ -65,12 +66,13 @@ func (s *groupServer) Run() { pbGroup.RegisterGroupServer(srv, s) rpcRegisterIP := config.Config.RpcRegisterIP - if rpcRegisterIP == "" { + if config.Config.RpcRegisterIP == "" { rpcRegisterIP, err = utils.GetLocalIP() if err != nil { log.Error("", "GetLocalIP failed ", err.Error()) } } + log.NewInfo("", "rpcRegisterIP", rpcRegisterIP) err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) if err != nil { log.NewError("", "RegisterEtcd failed ", err.Error()) @@ -91,88 +93,92 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR log.NewError(req.OperationID, "CheckAccess false ", req.OpUserID, req.OwnerUserID) return &pbGroup.CreateGroupResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil } - canCreate, err := callbackBeforeCreateGroup(req) - if err != nil || !canCreate { - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "callbackBeforeCreateGroup failed") - } - } groupId := req.GroupInfo.GroupID if groupId == "" { - groupId = utils.Md5(strconv.FormatInt(time.Now().UnixNano(), 10)) + groupId = utils.Md5(req.OperationID + strconv.FormatInt(time.Now().UnixNano(), 10)) + bi := big.NewInt(0) + bi.SetString(groupId[0:8], 16) + groupId = bi.String() } //to group groupInfo := db.Group{} utils.CopyStructFields(&groupInfo, req.GroupInfo) groupInfo.CreatorUserID = req.OpUserID groupInfo.GroupID = groupId - err = imdb.InsertIntoGroup(groupInfo) + err := imdb.InsertIntoGroup(groupInfo) if err != nil { log.NewError(req.OperationID, "InsertIntoGroup failed, ", err.Error(), groupInfo) return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, http.WrapError(constant.ErrDB) } + var okUserIDList []string + resp := &pbGroup.CreateGroupResp{GroupInfo: &open_im_sdk.GroupInfo{}} groupMember := db.GroupMember{} us := &db.User{} - if req.OwnerUserID == "" { - goto initMemberList - } - us, err = imdb.GetUserByUserID(req.OwnerUserID) - if err != nil { - log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), req.OwnerUserID) - return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, http.WrapError(constant.ErrDB) - } - - //to group member - groupMember = db.GroupMember{GroupID: groupId, RoleLevel: constant.GroupOwner, OperatorUserID: req.OpUserID} - utils.CopyStructFields(&groupMember, us) - err = imdb.InsertIntoGroupMember(groupMember) - if err != nil { - log.NewError(req.OperationID, "InsertIntoGroupMember failed ", err.Error(), groupMember) - return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, http.WrapError(constant.ErrDB) - } - -initMemberList: - var okUserIDList []string - //to group member - for _, user := range req.InitMemberList { - us, err := imdb.GetUserByUserID(user.UserID) + if req.OwnerUserID != "" { + us, err = imdb.GetUserByUserID(req.OwnerUserID) if err != nil { - log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), user.UserID) - continue + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), req.OwnerUserID) + return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, http.WrapError(constant.ErrDB) } - if user.RoleLevel == constant.GroupOwner { - log.NewError(req.OperationID, "only one owner, failed ", user) - continue - } - groupMember.RoleLevel = user.RoleLevel + //to group member + groupMember = db.GroupMember{GroupID: groupId, RoleLevel: constant.GroupOwner, OperatorUserID: req.OpUserID} utils.CopyStructFields(&groupMember, us) err = imdb.InsertIntoGroupMember(groupMember) if err != nil { log.NewError(req.OperationID, "InsertIntoGroupMember failed ", err.Error(), groupMember) - continue + return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, http.WrapError(constant.ErrDB) } - okUserIDList = append(okUserIDList, user.UserID) } - resp := &pbGroup.CreateGroupResp{GroupInfo: &open_im_sdk.GroupInfo{}} - group, err := imdb.GetGroupInfoByGroupID(groupId) - if err != nil { - log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), groupId) - resp.ErrCode = constant.ErrDB.ErrCode - resp.ErrMsg = err.Error() - return resp, nil - } - utils.CopyStructFields(resp.GroupInfo, group) - resp.GroupInfo.MemberCount, err = imdb.GetGroupMemberNumByGroupID(groupId) - if err != nil { - log.NewError(req.OperationID, "GetGroupMemberNumByGroupID failed ", err.Error(), groupId) - resp.ErrCode = constant.ErrDB.ErrCode - resp.ErrMsg = err.Error() - return resp, nil - } - if req.OwnerUserID != "" { - resp.GroupInfo.OwnerUserID = req.OwnerUserID - okUserIDList = append(okUserIDList, req.OwnerUserID) + if req.GroupInfo.GroupType != constant.SuperGroup { + //to group member + for _, user := range req.InitMemberList { + us, err := imdb.GetUserByUserID(user.UserID) + if err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), user.UserID) + continue + } + if user.RoleLevel == constant.GroupOwner { + log.NewError(req.OperationID, "only one owner, failed ", user) + continue + } + groupMember.RoleLevel = user.RoleLevel + utils.CopyStructFields(&groupMember, us) + err = imdb.InsertIntoGroupMember(groupMember) + if err != nil { + log.NewError(req.OperationID, "InsertIntoGroupMember failed ", err.Error(), groupMember) + continue + } + okUserIDList = append(okUserIDList, user.UserID) + } + group, err := imdb.GetGroupInfoByGroupID(groupId) + if err != nil { + log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), groupId) + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = err.Error() + return resp, nil + } + utils.CopyStructFields(resp.GroupInfo, group) + resp.GroupInfo.MemberCount, err = imdb.GetGroupMemberNumByGroupID(groupId) + if err != nil { + log.NewError(req.OperationID, "GetGroupMemberNumByGroupID failed ", err.Error(), groupId) + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = err.Error() + return resp, nil + } + if req.OwnerUserID != "" { + resp.GroupInfo.OwnerUserID = req.OwnerUserID + okUserIDList = append(okUserIDList, req.OwnerUserID) + } + } else { + for _, v := range req.InitMemberList { + okUserIDList = append(okUserIDList, v.UserID) + } + if err := db.DB.CreateSuperGroup(groupId, okUserIDList, len(okUserIDList)); err != nil { + log.NewError(req.OperationID, "GetGroupMemberNumByGroupID failed ", err.Error(), groupId) + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = err.Error() + ": CreateSuperGroup failed" + } } if len(okUserIDList) != 0 { @@ -181,7 +187,12 @@ initMemberList: GroupID: groupId, OperationID: req.OperationID, } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.CreateGroupResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}, nil + } cacheClient := pbCache.NewCacheClient(etcdConn) cacheResp, err := cacheClient.AddGroupMemberToCache(context.Background(), addGroupMemberToCacheReq) if err != nil { @@ -194,7 +205,15 @@ initMemberList: } log.NewInfo(req.OperationID, "rpc CreateGroup return ", resp.String()) - chat.GroupCreatedNotification(req.OperationID, req.OpUserID, groupId, okUserIDList) + if req.GroupInfo.GroupType != constant.SuperGroup { + chat.GroupCreatedNotification(req.OperationID, req.OpUserID, groupId, okUserIDList) + } else { + go func() { + for _, v := range okUserIDList { + chat.SuperGroupNotification(req.OperationID, v, v) + } + }() + } return resp, nil } else { log.NewInfo(req.OperationID, "rpc CreateGroup return ", resp.String()) @@ -239,7 +258,6 @@ func (s *groupServer) GetJoinedGroupList(ctx context.Context, req *pbGroup.GetJo func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.InviteUserToGroupReq) (*pbGroup.InviteUserToGroupResp, error) { log.NewInfo(req.OperationID, "InviteUserToGroup args ", req.String()) - if !imdb.IsExistGroupMember(req.GroupID, req.OpUserID) && !token_verify.IsManagerUserID(req.OpUserID) { log.NewError(req.OperationID, "no permission InviteUserToGroup ", req.GroupID, req.OpUserID) return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil @@ -254,102 +272,161 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite errMsg := " group status is dismissed " return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrStatus.ErrCode, ErrMsg: errMsg}, nil } + var resp pbGroup.InviteUserToGroupResp + if groupInfo.NeedVerification == constant.AllNeedVerification && + !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsManagerUserID(req.OpUserID) { + var resp pbGroup.InviteUserToGroupResp + joinReq := pbGroup.JoinGroupReq{} + for _, v := range req.InvitedUserIDList { + var groupRequest db.GroupRequest + groupRequest.UserID = v + groupRequest.GroupID = req.GroupID + err = imdb.InsertIntoGroupRequest(groupRequest) + if err != nil { + var resultNode pbGroup.Id2Result + resultNode.Result = -1 + resultNode.UserID = v + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) + + continue + log.NewError(req.OperationID, "InsertIntoGroupRequest failed ", err.Error(), groupRequest) + // return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } else { + var resultNode pbGroup.Id2Result + resultNode.Result = 0 + resultNode.UserID = v + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) + joinReq.GroupID = req.GroupID + joinReq.OperationID = req.OperationID + joinReq.OpUserID = v + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) + chat.JoinGroupApplicationNotification(&joinReq) + } + } + log.NewInfo(req.OperationID, "InviteUserToGroup rpc return ", resp) + return &resp, nil + } // //from User: invite: applicant //to user: invite: invited - var resp pbGroup.InviteUserToGroupResp var okUserIDList []string - for _, v := range req.InvitedUserIDList { - var resultNode pbGroup.Id2Result - resultNode.UserID = v - resultNode.Result = 0 - toUserInfo, err := imdb.GetUserByUserID(v) - if err != nil { - log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), v) - resultNode.Result = -1 + if groupInfo.GroupType != constant.SuperGroup { + for _, v := range req.InvitedUserIDList { + var resultNode pbGroup.Id2Result + resultNode.UserID = v + resultNode.Result = 0 + toUserInfo, err := imdb.GetUserByUserID(v) + if err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), v) + resultNode.Result = -1 + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) + continue + } + + if imdb.IsExistGroupMember(req.GroupID, v) { + log.NewError(req.OperationID, "IsExistGroupMember ", req.GroupID, v) + resultNode.Result = -1 + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) + continue + } + var toInsertInfo db.GroupMember + utils.CopyStructFields(&toInsertInfo, toUserInfo) + toInsertInfo.GroupID = req.GroupID + toInsertInfo.RoleLevel = constant.GroupOrdinaryUsers + toInsertInfo.OperatorUserID = req.OpUserID + err = imdb.InsertIntoGroupMember(toInsertInfo) + if err != nil { + log.NewError(req.OperationID, "InsertIntoGroupMember failed ", req.GroupID, toUserInfo.UserID, toUserInfo.Nickname, toUserInfo.FaceURL) + resultNode.Result = -1 + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) + continue + } + okUserIDList = append(okUserIDList, v) + err = db.DB.AddGroupMember(req.GroupID, toUserInfo.UserID) + if err != nil { + log.NewError(req.OperationID, "AddGroupMember failed ", err.Error(), req.GroupID, toUserInfo.UserID) + } resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) - continue + } + var haveConUserID []string + conversations, err := imdb.GetConversationsByConversationIDMultipleOwner(okUserIDList, utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType)) + if err != nil { + log.NewError(req.OperationID, "GetConversationsByConversationIDMultipleOwner failed ", err.Error(), req.GroupID, constant.GroupChatType) + } + for _, v := range conversations { + haveConUserID = append(haveConUserID, v.OwnerUserID) + } + var reqPb pbUser.SetConversationReq + var c pbUser.Conversation + for _, v := range conversations { + reqPb.OperationID = req.OperationID + c.OwnerUserID = v.OwnerUserID + c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) + c.RecvMsgOpt = v.RecvMsgOpt + c.ConversationType = constant.GroupChatType + c.GroupID = req.GroupID + c.IsPinned = v.IsPinned + c.AttachedInfo = v.AttachedInfo + c.IsPrivateChat = v.IsPrivateChat + c.GroupAtType = v.GroupAtType + c.IsNotInGroup = false + c.Ex = v.Ex + reqPb.Conversation = &c + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}, nil + } + client := pbUser.NewUserClient(etcdConn) + respPb, err := client.SetConversation(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v.OwnerUserID) + } else { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v.OwnerUserID) + } + } + for _, v := range utils.DifferenceString(haveConUserID, okUserIDList) { + reqPb.OperationID = req.OperationID + c.OwnerUserID = v + c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) + c.ConversationType = constant.GroupChatType + c.GroupID = req.GroupID + c.IsNotInGroup = false + reqPb.Conversation = &c + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}, nil + } + client := pbUser.NewUserClient(etcdConn) + respPb, err := client.SetConversation(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v) + } else { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v) + } + } + } else { + okUserIDList = req.InvitedUserIDList + if err := db.DB.AddUserToSuperGroup(req.GroupID, req.InvitedUserIDList); err != nil { + log.NewError(req.OperationID, "AddUserToSuperGroup failed ", req.GroupID, err) + return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: err.Error()}, nil } - if imdb.IsExistGroupMember(req.GroupID, v) { - log.NewError(req.OperationID, "IsExistGroupMember ", req.GroupID, v) - resultNode.Result = -1 - resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) - continue - } - var toInsertInfo db.GroupMember - utils.CopyStructFields(&toInsertInfo, toUserInfo) - toInsertInfo.GroupID = req.GroupID - toInsertInfo.RoleLevel = constant.GroupOrdinaryUsers - toInsertInfo.OperatorUserID = req.OpUserID - err = imdb.InsertIntoGroupMember(toInsertInfo) - if err != nil { - log.NewError(req.OperationID, "InsertIntoGroupMember failed ", req.GroupID, toUserInfo.UserID, toUserInfo.Nickname, toUserInfo.FaceURL) - resultNode.Result = -1 - resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) - continue - } - okUserIDList = append(okUserIDList, v) - err = db.DB.AddGroupMember(req.GroupID, toUserInfo.UserID) - if err != nil { - log.NewError(req.OperationID, "AddGroupMember failed ", err.Error(), req.GroupID, toUserInfo.UserID) - } - resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) } - var haveConUserID []string - conversations, err := imdb.GetConversationsByConversationIDMultipleOwner(okUserIDList, utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType)) - for _, v := range conversations { - haveConUserID = append(haveConUserID, v.OwnerUserID) - } - var reqPb pbUser.SetConversationReq - var c pbUser.Conversation - for _, v := range conversations { - reqPb.OperationID = req.OperationID - c.OwnerUserID = v.OwnerUserID - c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) - c.RecvMsgOpt = v.RecvMsgOpt - c.ConversationType = constant.GroupChatType - c.GroupID = req.GroupID - c.IsPinned = v.IsPinned - c.AttachedInfo = v.AttachedInfo - c.IsPrivateChat = v.IsPrivateChat - c.GroupAtType = v.GroupAtType - c.IsNotInGroup = false - c.Ex = v.Ex - reqPb.Conversation = &c - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) - client := pbUser.NewUserClient(etcdConn) - respPb, err := client.SetConversation(context.Background(), &reqPb) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v.OwnerUserID) - } else { - log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v.OwnerUserID) - } - } - for _, v := range utils.DifferenceString(haveConUserID, okUserIDList) { - reqPb.OperationID = req.OperationID - c.OwnerUserID = v - c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) - c.ConversationType = constant.GroupChatType - c.GroupID = req.GroupID - c.IsNotInGroup = false - reqPb.Conversation = &c - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) - client := pbUser.NewUserClient(etcdConn) - respPb, err := client.SetConversation(context.Background(), &reqPb) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v) - } else { - log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v) - } - } - addGroupMemberToCacheReq := &pbCache.AddGroupMemberToCacheReq{ UserIDList: okUserIDList, GroupID: req.GroupID, OperationID: req.OperationID, } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}, nil + } cacheClient := pbCache.NewCacheClient(etcdConn) cacheResp, err := cacheClient.AddGroupMemberToCache(context.Background(), addGroupMemberToCacheReq) if err != nil { @@ -361,30 +438,47 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil } - chat.MemberInvitedNotification(req.OperationID, req.GroupID, req.OpUserID, req.Reason, okUserIDList) - resp.ErrCode = 0 - log.NewInfo(req.OperationID, "InviteUserToGroup rpc return ", resp.String()) + if groupInfo.GroupType != constant.SuperGroup { + chat.MemberInvitedNotification(req.OperationID, req.GroupID, req.OpUserID, req.Reason, okUserIDList) + } else { + go func() { + for _, v := range req.InvitedUserIDList { + chat.SuperGroupNotification(req.OperationID, v, v) + } + }() + } + + log.NewInfo(req.OperationID, "InviteUserToGroup rpc return ", resp) return &resp, nil } func (s *groupServer) GetGroupAllMember(ctx context.Context, req *pbGroup.GetGroupAllMemberReq) (*pbGroup.GetGroupAllMemberResp, error) { log.NewInfo(req.OperationID, "GetGroupAllMember, args ", req.String()) var resp pbGroup.GetGroupAllMemberResp - memberList, err := imdb.GetGroupMemberListByGroupID(req.GroupID) + groupInfo, err := imdb.GetGroupInfoByGroupID(req.GroupID) if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.GroupID) resp.ErrCode = constant.ErrDB.ErrCode resp.ErrMsg = constant.ErrDB.ErrMsg - log.NewError(req.OperationID, "GetGroupMemberListByGroupID failed,", err.Error(), req.GroupID) return &resp, nil } + if groupInfo.GroupType != constant.SuperGroup { + memberList, err := imdb.GetGroupMemberListByGroupID(req.GroupID) + if err != nil { + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = constant.ErrDB.ErrMsg + log.NewError(req.OperationID, "GetGroupMemberListByGroupID failed,", err.Error(), req.GroupID) + return &resp, nil + } - for _, v := range memberList { - log.Debug(req.OperationID, v) - var node open_im_sdk.GroupMemberFullInfo - cp.GroupMemberDBCopyOpenIM(&node, &v) - log.Debug(req.OperationID, "db value:", v.MuteEndTime, "seconds: ", v.MuteEndTime.Unix()) - log.Debug(req.OperationID, "cp value: ", node) - resp.MemberList = append(resp.MemberList, &node) + for _, v := range memberList { + //log.Debug(req.OperationID, v) + var node open_im_sdk.GroupMemberFullInfo + cp.GroupMemberDBCopyOpenIM(&node, &v) + //log.Debug(req.OperationID, "db value:", v.MuteEndTime, "seconds: ", v.MuteEndTime.Unix()) + //log.Debug(req.OperationID, "cp value: ", node) + resp.MemberList = append(resp.MemberList, &node) + } } log.NewInfo(req.OperationID, "GetGroupAllMember rpc return ", resp.String()) return &resp, nil @@ -418,90 +512,126 @@ func (s *groupServer) GetGroupMemberList(ctx context.Context, req *pbGroup.GetGr return &resp, nil } +func (s *groupServer) getGroupUserLevel(groupID, userID string) (int, error) { + opFlag := 0 + if !token_verify.IsManagerUserID(userID) { + opInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(groupID, userID) + if err != nil { + return opFlag, utils.Wrap(err, "") + } + if opInfo.RoleLevel == constant.GroupOrdinaryUsers { + opFlag = 0 + } else if opInfo.RoleLevel == constant.GroupOwner { + opFlag = 2 //owner + } else { + opFlag = 3 //admin + } + } else { + opFlag = 1 //app manager + } + return opFlag, nil +} + func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGroupMemberReq) (*pbGroup.KickGroupMemberResp, error) { - log.NewInfo(req.OperationID, "KickGroupMember args ", req.String()) - ownerList, err := imdb.GetOwnerManagerByGroupID(req.GroupID) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + groupInfo, err := imdb.GetGroupInfoByGroupID(req.GroupID) if err != nil { - log.NewError(req.OperationID, "GetOwnerManagerByGroupId failed ", err.Error(), req.GroupID) + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupInfoByGroupID", req.GroupID, err.Error()) return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil } - //op is group owner? - var flag = 0 - for _, v := range ownerList { - if v.UserID == req.OpUserID { - flag = 1 - log.NewDebug(req.OperationID, "is group owner ", req.OpUserID, req.GroupID) - break - } - } - - //op is app manager - if flag != 1 { - if token_verify.IsManagerUserID(req.OpUserID) { - flag = 1 - log.NewDebug(req.OperationID, "is app manager ", req.OpUserID) - } - } - - if flag != 1 { - log.NewError(req.OperationID, "failed, no access kick ", req.OpUserID) - return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil - } - - if len(req.KickedUserIDList) == 0 { - log.NewError(req.OperationID, "failed, kick list 0") - return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrArgs.ErrCode, ErrMsg: constant.ErrArgs.ErrMsg}, nil - } - - groupOwnerUserID := "" - for _, v := range ownerList { - if v.RoleLevel == constant.GroupOwner { - groupOwnerUserID = v.UserID - } - } - var okUserIDList []string - //remove var resp pbGroup.KickGroupMemberResp - for _, v := range req.KickedUserIDList { - //owner can‘t kicked - if v == groupOwnerUserID { - log.NewError(req.OperationID, "failed, can't kick owner ", v) - resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1}) - continue - } - err := imdb.RemoveGroupMember(req.GroupID, v) - if err != nil { - log.NewError(req.OperationID, "RemoveGroupMember failed ", err.Error(), req.GroupID, v) - resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1}) + if groupInfo.GroupType != constant.SuperGroup { + opFlag := 0 + if !token_verify.IsManagerUserID(req.OpUserID) { + opInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, req.OpUserID) + if err != nil { + errMsg := req.OperationID + " GetGroupMemberInfoByGroupIDAndUserID failed " + err.Error() + req.GroupID + req.OpUserID + log.Error(req.OperationID, errMsg) + return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + if opInfo.RoleLevel == constant.GroupOrdinaryUsers { + errMsg := req.OperationID + " opInfo.RoleLevel == constant.GroupOrdinaryUsers " + opInfo.UserID + opInfo.GroupID + log.Error(req.OperationID, errMsg) + return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } else if opInfo.RoleLevel == constant.GroupOwner { + opFlag = 2 //owner + } else { + opFlag = 3 //admin + } } else { - log.NewDebug(req.OperationID, "kicked ", v) - resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: 0}) - okUserIDList = append(okUserIDList, v) + opFlag = 1 //app manager } - //err = db.DB.DelGroupMember(req.GroupID, v) - //if err != nil { - // log.NewError(req.OperationID, "DelGroupMember failed ", err.Error(), req.GroupID, v) - //} - } - var reqPb pbUser.SetConversationReq - var c pbUser.Conversation - for _, v := range okUserIDList { - reqPb.OperationID = req.OperationID - c.OwnerUserID = v - c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) - c.ConversationType = constant.GroupChatType - c.GroupID = req.GroupID - c.IsNotInGroup = true - reqPb.Conversation = &c - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) - client := pbUser.NewUserClient(etcdConn) - respPb, err := client.SetConversation(context.Background(), &reqPb) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v) - } else { - log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v) + //op is group owner? + if len(req.KickedUserIDList) == 0 { + log.NewError(req.OperationID, "failed, kick list 0") + return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrArgs.ErrCode, ErrMsg: constant.ErrArgs.ErrMsg}, nil + } + + //remove + for _, v := range req.KickedUserIDList { + kickedInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, v) + if err != nil { + log.NewError(req.OperationID, " GetGroupMemberInfoByGroupIDAndUserID failed ", req.GroupID, v, err.Error()) + resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1}) + continue + } + + if kickedInfo.RoleLevel == constant.GroupAdmin && opFlag == 3 { + log.Error(req.OperationID, "is constant.GroupAdmin, can't kicked ", v) + resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1}) + continue + } + if kickedInfo.RoleLevel == constant.GroupOwner && opFlag != 1 { + log.NewDebug(req.OperationID, "is constant.GroupOwner, can't kicked ", v) + resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1}) + continue + } + + err = imdb.RemoveGroupMember(req.GroupID, v) + if err != nil { + log.NewError(req.OperationID, "RemoveGroupMember failed ", err.Error(), req.GroupID, v) + resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1}) + } else { + log.NewDebug(req.OperationID, "kicked ", v) + resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: 0}) + okUserIDList = append(okUserIDList, v) + } + } + var reqPb pbUser.SetConversationReq + var c pbUser.Conversation + for _, v := range okUserIDList { + reqPb.OperationID = req.OperationID + c.OwnerUserID = v + c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) + c.ConversationType = constant.GroupChatType + c.GroupID = req.GroupID + c.IsNotInGroup = true + reqPb.Conversation = &c + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + resp.ErrCode = constant.ErrInternal.ErrCode + resp.ErrMsg = errMsg + return &resp, nil + } + client := pbUser.NewUserClient(etcdConn) + respPb, err := client.SetConversation(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v) + } else { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v) + } + } + } else { + okUserIDList = req.KickedUserIDList + if err := db.DB.RemoverUserFromSuperGroup(req.GroupID, okUserIDList); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), req.GroupID, req.KickedUserIDList, err.Error()) + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = constant.ErrDB.ErrMsg + return &resp, nil } } @@ -510,7 +640,12 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou GroupID: req.GroupID, OperationID: req.OperationID, } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}, nil + } cacheClient := pbCache.NewCacheClient(etcdConn) cacheResp, err := cacheClient.ReduceGroupMemberFromCache(context.Background(), reduceGroupMemberFromCacheReq) if err != nil { @@ -521,8 +656,16 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou log.NewError(req.OperationID, "ReduceGroupMemberFromCache rpc logic call failed ", cacheResp.String()) return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil } + if groupInfo.GroupType != constant.SuperGroup { + chat.MemberKickedNotification(req, okUserIDList) + } else { + go func() { + for _, v := range req.KickedUserIDList { + chat.SuperGroupNotification(req.OperationID, v, v) + } + }() - chat.MemberKickedNotification(req, okUserIDList) + } log.NewInfo(req.OperationID, "GetGroupMemberList rpc return ", resp.String()) return &resp, nil } @@ -594,11 +737,14 @@ func (s *groupServer) GetGroupsInfo(ctx context.Context, req *pbGroup.GetGroupsI } var groupInfo open_im_sdk.GroupInfo cp.GroupDBCopyOpenIM(&groupInfo, groupInfoFromMysql) + //groupInfo.NeedVerification + + groupInfo.NeedVerification = groupInfoFromMysql.NeedVerification groupsInfoList = append(groupsInfoList, &groupInfo) } resp := pbGroup.GetGroupsInfoResp{GroupInfoList: groupsInfoList} - log.NewInfo(req.OperationID, "GetGroupsInfo rpc return ", resp.String()) + log.NewInfo(req.OperationID, "GetGroupsInfo rpc return ", resp.String()) return &resp, nil } @@ -664,7 +810,12 @@ func (s *groupServer) GroupApplicationResponse(_ context.Context, req *pbGroup.G c.Ex = conversation.Ex } reqPb.Conversation = &c - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.SetConversation(context.Background(), &reqPb) if err != nil { @@ -673,7 +824,12 @@ func (s *groupServer) GroupApplicationResponse(_ context.Context, req *pbGroup.G log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String()) } addGroupMemberToCacheReq := &pbCache.AddGroupMemberToCacheReq{OperationID: req.OperationID, GroupID: req.GroupID, UserIDList: []string{req.FromUserID}} - etcdCacheConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdCacheConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } cacheClient := pbCache.NewCacheClient(etcdCacheConn) cacheResp, err := cacheClient.AddGroupMemberToCache(context.Background(), addGroupMemberToCacheReq) if err != nil { @@ -715,65 +871,127 @@ func (s *groupServer) JoinGroup(ctx context.Context, req *pbGroup.JoinGroupReq) return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrStatus.ErrCode, ErrMsg: errMsg}}, nil } + if groupInfo.NeedVerification == constant.Directly { + us, err := imdb.GetUserByUserID(req.OpUserID) + if err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), req.OpUserID) + return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + //to group member + groupMember := db.GroupMember{GroupID: req.GroupID, RoleLevel: constant.GroupOwner, OperatorUserID: req.OpUserID} + utils.CopyStructFields(&groupMember, us) + err = imdb.InsertIntoGroupMember(groupMember) + if err != nil { + log.NewError(req.OperationID, "InsertIntoGroupMember failed ", err.Error(), groupMember) + return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + if groupInfo.GroupType != constant.SuperGroup { + addGroupMemberToCacheReq := &pbCache.AddGroupMemberToCacheReq{ + UserIDList: []string{req.OpUserID}, + GroupID: req.GroupID, + OperationID: req.OperationID, + } + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: constant.ErrInternal.ErrMsg}}, nil + } + cacheClient := pbCache.NewCacheClient(etcdConn) + cacheResp, err := cacheClient.AddGroupMemberToCache(context.Background(), addGroupMemberToCacheReq) + if err != nil { + log.NewError(req.OperationID, "AddGroupMemberToCache rpc call failed ", err.Error()) + return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + if cacheResp.CommonResp.ErrCode != 0 { + log.NewError(req.OperationID, "AddGroupMemberToCache rpc logic call failed ", cacheResp.String()) + return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + chat.MemberEnterDirectlyNotification(req.GroupID, req.OpUserID, req.OperationID) + log.NewInfo(req.OperationID, "JoinGroup rpc return ") + return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil + } else { + log.Error(req.OperationID, "JoinGroup rpc failed, group type: ", groupInfo.GroupType) + return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrArgs.ErrCode, ErrMsg: constant.ErrArgs.ErrMsg}}, nil + } + } + var groupRequest db.GroupRequest groupRequest.UserID = req.OpUserID groupRequest.ReqMsg = req.ReqMessage groupRequest.GroupID = req.GroupID - err = imdb.InsertIntoGroupRequest(groupRequest) if err != nil { - log.NewError(req.OperationID, "UpdateGroupRequest ", err.Error(), groupRequest) + log.NewError(req.OperationID, "InsertIntoGroupRequest failed ", err.Error(), groupRequest) return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil } - _, err = imdb.GetGroupMemberListByGroupIDAndRoleLevel(req.GroupID, constant.GroupOwner) - if err != nil { - log.NewError(req.OperationID, "GetGroupMemberListByGroupIDAndRoleLevel failed ", err.Error(), req.GroupID, constant.GroupOwner) - return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil - } + // + //_, err = imdb.GetGroupMemberListByGroupIDAndRoleLevel(req.GroupID, constant.GroupOwner) + //if err != nil { + // log.NewError(req.OperationID, "GetGroupMemberListByGroupIDAndRoleLevel failed ", err.Error(), req.GroupID, constant.GroupOwner) + // return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil + //} chat.JoinGroupApplicationNotification(req) - - log.NewInfo(req.OperationID, "ReceiveJoinApplicationNotification rpc return ") + log.NewInfo(req.OperationID, "JoinGroup rpc return ") return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil } func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq) (*pbGroup.QuitGroupResp, error) { log.NewInfo(req.OperationID, "QuitGroup args ", req.String()) - _, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, req.OpUserID) + groupInfo, err := imdb.GetGroupInfoByGroupID(req.GroupID) if err != nil { - log.NewError(req.OperationID, "GetGroupMemberInfoByGroupIDAndUserID failed ", err.Error(), req.GroupID, req.OpUserID) + log.NewError(req.OperationID, "ReduceGroupMemberFromCache rpc call failed ", err.Error()) return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil } + if groupInfo.GroupType != constant.SuperGroup { + _, err = imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, req.OpUserID) + if err != nil { + log.NewError(req.OperationID, "GetGroupMemberInfoByGroupIDAndUserID failed ", err.Error(), req.GroupID, req.OpUserID) + return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } - err = imdb.DeleteGroupMemberByGroupIDAndUserID(req.GroupID, req.OpUserID) - if err != nil { - log.NewError(req.OperationID, "DeleteGroupMemberByGroupIdAndUserId failed ", err.Error(), req.GroupID, req.OpUserID) - return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil - } + err = imdb.DeleteGroupMemberByGroupIDAndUserID(req.GroupID, req.OpUserID) + if err != nil { + log.NewError(req.OperationID, "DeleteGroupMemberByGroupIdAndUserId failed ", err.Error(), req.GroupID, req.OpUserID) + return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } - err = db.DB.DelGroupMember(req.GroupID, req.OpUserID) - if err != nil { - log.NewError(req.OperationID, "DelGroupMember failed ", req.GroupID, req.OpUserID) - // return &pbGroup.CommonResp{ErrorCode: constant.ErrQuitGroup.ErrCode, ErrorMsg: constant.ErrQuitGroup.ErrMsg}, nil - } - //modify quitter conversation info - var reqPb pbUser.SetConversationReq - var c pbUser.Conversation - reqPb.OperationID = req.OperationID - c.OwnerUserID = req.OpUserID - c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) - c.ConversationType = constant.GroupChatType - c.GroupID = req.GroupID - c.IsNotInGroup = true - reqPb.Conversation = &c - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) - client := pbUser.NewUserClient(etcdConn) - respPb, err := client.SetConversation(context.Background(), &reqPb) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error()) + err = db.DB.DelGroupMember(req.GroupID, req.OpUserID) + if err != nil { + log.NewError(req.OperationID, "DelGroupMember failed ", req.GroupID, req.OpUserID) + // return &pbGroup.CommonResp{ErrorCode: constant.ErrQuitGroup.ErrCode, ErrorMsg: constant.ErrQuitGroup.ErrMsg}, nil + } + //modify quitter conversation info + var reqPb pbUser.SetConversationReq + var c pbUser.Conversation + reqPb.OperationID = req.OperationID + c.OwnerUserID = req.OpUserID + c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) + c.ConversationType = constant.GroupChatType + c.GroupID = req.GroupID + c.IsNotInGroup = true + reqPb.Conversation = &c + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } + client := pbUser.NewUserClient(etcdConn) + respPb, err := client.SetConversation(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error()) + } else { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String()) + } } else { - log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String()) + okUserIDList := []string{req.OpUserID} + if err := db.DB.RemoverUserFromSuperGroup(req.GroupID, okUserIDList); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), req.GroupID, okUserIDList, err.Error()) + return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } } reduceGroupMemberFromCacheReq := &pbCache.ReduceGroupMemberFromCacheReq{ @@ -781,7 +999,12 @@ func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq) GroupID: req.GroupID, OperationID: req.OperationID, } - etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConnCache == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } cacheClient := pbCache.NewCacheClient(etcdConnCache) cacheResp, err := cacheClient.ReduceGroupMemberFromCache(context.Background(), reduceGroupMemberFromCacheReq) if err != nil { @@ -793,7 +1016,12 @@ func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq) return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil } - chat.MemberQuitNotification(req) + if groupInfo.GroupType != constant.SuperGroup { + chat.MemberQuitNotification(req) + } else { + chat.SuperGroupNotification(req.OperationID, req.OpUserID, req.OpUserID) + } + log.NewInfo(req.OperationID, "rpc QuitGroup return ", pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}) return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil } @@ -802,9 +1030,9 @@ func hasAccess(req *pbGroup.SetGroupInfoReq) bool { if utils.IsContain(req.OpUserID, config.Config.Manager.AppManagerUid) { return true } - groupUserInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupInfo.GroupID, req.OpUserID) + groupUserInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupInfoForSet.GroupID, req.OpUserID) if err != nil { - log.NewError(req.OperationID, "GetGroupMemberInfoByGroupIDAndUserID failed, ", err.Error(), req.GroupInfo.GroupID, req.OpUserID) + log.NewError(req.OperationID, "GetGroupMemberInfoByGroupIDAndUserID failed, ", err.Error(), req.GroupInfoForSet.GroupID, req.OpUserID) return false } @@ -821,9 +1049,9 @@ func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInf return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil } - group, err := imdb.GetGroupInfoByGroupID(req.GroupInfo.GroupID) + group, err := imdb.GetGroupInfoByGroupID(req.GroupInfoForSet.GroupID) if err != nil { - log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), req.GroupInfo.GroupID) + log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), req.GroupInfoForSet.GroupID) return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, http.WrapError(constant.ErrDB) } @@ -834,21 +1062,44 @@ func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInf ////bitwise operators: 0001:groupName; 0010:Notification 0100:Introduction; 1000:FaceUrl; 10000:owner var changedType int32 - if group.GroupName != req.GroupInfo.GroupName && req.GroupInfo.GroupName != "" { + groupName := "" + notification := "" + introduction := "" + faceURL := "" + if group.GroupName != req.GroupInfoForSet.GroupName && req.GroupInfoForSet.GroupName != "" { changedType = 1 + groupName = req.GroupInfoForSet.GroupName } - if group.Notification != req.GroupInfo.Notification && req.GroupInfo.Notification != "" { + if group.Notification != req.GroupInfoForSet.Notification && req.GroupInfoForSet.Notification != "" { changedType = changedType | (1 << 1) + notification = req.GroupInfoForSet.Notification } - if group.Introduction != req.GroupInfo.Introduction && req.GroupInfo.Introduction != "" { + if group.Introduction != req.GroupInfoForSet.Introduction && req.GroupInfoForSet.Introduction != "" { changedType = changedType | (1 << 2) + introduction = req.GroupInfoForSet.Introduction } - if group.FaceURL != req.GroupInfo.FaceURL && req.GroupInfo.FaceURL != "" { + if group.FaceURL != req.GroupInfoForSet.FaceURL && req.GroupInfoForSet.FaceURL != "" { changedType = changedType | (1 << 3) + faceURL = req.GroupInfoForSet.FaceURL } + + if req.GroupInfoForSet.NeedVerification != nil { + changedType = changedType | (1 << 4) + m := make(map[string]interface{}) + m["need_verification"] = req.GroupInfoForSet.NeedVerification.Value + if err := imdb.UpdateGroupInfoDefaultZero(req.GroupInfoForSet.GroupID, m); err != nil { + log.NewError(req.OperationID, "UpdateGroupInfoDefaultZero failed ", err.Error(), m) + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, http.WrapError(constant.ErrDB) + } + } + + // + //if req.RoleLevel != nil { + // + //} //only administrators can set group information var groupInfo db.Group - utils.CopyStructFields(&groupInfo, req.GroupInfo) + utils.CopyStructFields(&groupInfo, req.GroupInfoForSet) err = imdb.SetGroupInfo(groupInfo) if err != nil { log.NewError(req.OperationID, "SetGroupInfo failed ", err.Error(), groupInfo) @@ -856,7 +1107,53 @@ func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInf } log.NewInfo(req.OperationID, "SetGroupInfo rpc return ", pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{}}) if changedType != 0 { - chat.GroupInfoSetNotification(req.OperationID, req.OpUserID, req.GroupInfo.GroupID) + chat.GroupInfoSetNotification(req.OperationID, req.OpUserID, req.GroupInfoForSet.GroupID, groupName, notification, introduction, faceURL, req.GroupInfoForSet.NeedVerification) + } + if req.GroupInfoForSet.Notification != "" { + //get group member user id + getGroupMemberIDListFromCacheReq := &pbCache.GetGroupMemberIDListFromCacheReq{OperationID: req.OperationID, GroupID: req.GroupInfoForSet.GroupID} + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, http.WrapError(constant.ErrInternal) + } + client := pbCache.NewCacheClient(etcdConn) + cacheResp, err := client.GetGroupMemberIDListFromCache(context.Background(), getGroupMemberIDListFromCacheReq) + if err != nil { + log.NewError(req.OperationID, "GetGroupMemberIDListFromCache rpc call failed ", err.Error()) + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{}}, nil + } + if cacheResp.CommonResp.ErrCode != 0 { + log.NewError(req.OperationID, "GetGroupMemberIDListFromCache rpc logic call failed ", cacheResp.String()) + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{}}, nil + } + var conversationReq pbConversation.ModifyConversationFieldReq + + conversation := pbConversation.Conversation{ + OwnerUserID: req.OpUserID, + ConversationID: utils.GetConversationIDBySessionType(req.GroupInfoForSet.GroupID, constant.GroupChatType), + ConversationType: constant.GroupChatType, + GroupID: req.GroupInfoForSet.GroupID, + } + conversationReq.Conversation = &conversation + conversationReq.OperationID = req.OperationID + conversationReq.FieldType = constant.FieldGroupAtType + conversation.GroupAtType = constant.GroupNotification + conversationReq.UserIDList = cacheResp.UserIDList + nEtcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, http.WrapError(constant.ErrInternal) + } + nClient := pbConversation.NewConversationClient(nEtcdConn) + conversationReply, err := nClient.ModifyConversationField(context.Background(), &conversationReq) + if err != nil { + log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), err.Error()) + } else if conversationReply.CommonResp.ErrCode != 0 { + log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), conversationReply.String()) + } } return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{}}, nil } @@ -1045,7 +1342,12 @@ func (s *groupServer) OperateUserRole(_ context.Context, req *pbGroup.OperateUse log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMaster failed", err.Error()) return resp, http.WrapError(constant.ErrDB) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return resp, http.WrapError(constant.ErrInternal) + } client := pbGroup.NewGroupClient(etcdConn) var reqPb pbGroup.TransferGroupOwnerReq reqPb.OperationID = req.OperationID @@ -1126,7 +1428,12 @@ func (s *groupServer) RemoveGroupMembersCMS(_ context.Context, req *pbGroup.Remo c.GroupID = req.GroupId c.IsNotInGroup = true reqPb.Conversation = &c - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return resp, http.WrapError(constant.ErrInternal) + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.SetConversation(context.Background(), &reqPb) if err != nil { @@ -1141,7 +1448,12 @@ func (s *groupServer) RemoveGroupMembersCMS(_ context.Context, req *pbGroup.Remo GroupID: req.GroupId, OperationID: req.OperationID, } - etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConnCache == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return resp, http.WrapError(constant.ErrInternal) + } cacheClient := pbCache.NewCacheClient(etcdConnCache) cacheResp, err := cacheClient.ReduceGroupMemberFromCache(context.Background(), reduceGroupMemberFromCacheReq) if err != nil { @@ -1197,7 +1509,12 @@ func (s *groupServer) AddGroupMembersCMS(_ context.Context, req *pbGroup.AddGrou GroupID: req.GroupId, OperationID: req.OperationId, } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationId) + if etcdConn == nil { + errMsg := req.OperationId + "getcdv3.GetConn == nil" + log.NewError(req.OperationId, errMsg) + return resp, http.WrapError(constant.ErrInternal) + } cacheClient := pbCache.NewCacheClient(etcdConn) cacheResp, err := cacheClient.AddGroupMemberToCache(context.Background(), addGroupMemberToCacheReq) if err != nil { @@ -1261,38 +1578,55 @@ func (s *groupServer) DismissGroup(ctx context.Context, req *pbGroup.DismissGrou log.NewError(req.OperationID, "OperateGroupStatus failed ", req.GroupID, constant.GroupStatusDismissed) return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil } - memberList, err := imdb.GetGroupMemberListByGroupID(req.GroupID) + groupInfo, err := imdb.GetGroupInfoByGroupID(req.GroupID) if err != nil { - log.NewError(req.OperationID, "GetGroupMemberListByGroupID failed,", err.Error(), req.GroupID) + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.GroupID) + return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil } - //modify quitter conversation info - var reqPb pbUser.SetConversationReq - var c pbUser.Conversation - for _, v := range memberList { - reqPb.OperationID = req.OperationID - c.OwnerUserID = v.UserID - c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) - c.ConversationType = constant.GroupChatType - c.GroupID = req.GroupID - c.IsNotInGroup = true - reqPb.Conversation = &c - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) - client := pbUser.NewUserClient(etcdConn) - respPb, err := client.SetConversation(context.Background(), &reqPb) + if groupInfo.GroupType != constant.SuperGroup { + memberList, err := imdb.GetGroupMemberListByGroupID(req.GroupID) if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v.UserID) - } else { - log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v.UserID) + log.NewError(req.OperationID, "GetGroupMemberListByGroupID failed,", err.Error(), req.GroupID) + } + //modify quitter conversation info + var reqPb pbUser.SetConversationReq + var c pbUser.Conversation + for _, v := range memberList { + reqPb.OperationID = req.OperationID + c.OwnerUserID = v.UserID + c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) + c.ConversationType = constant.GroupChatType + c.GroupID = req.GroupID + c.IsNotInGroup = true + reqPb.Conversation = &c + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } + client := pbUser.NewUserClient(etcdConn) + respPb, err := client.SetConversation(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v.UserID) + } else { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v.UserID) + } + } + err = imdb.DeleteGroupMemberByGroupID(req.GroupID) + if err != nil { + log.NewError(req.OperationID, "DeleteGroupMemberByGroupID failed ", req.GroupID) + return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + chat.GroupDismissedNotification(req) + } else { + err = db.DB.DeleteSuperGroup(req.GroupID) + if err != nil { + log.NewError(req.OperationID, "DeleteGroupMemberByGroupID failed ", req.GroupID) + return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } } - chat.GroupDismissedNotification(req) - err = imdb.DeleteGroupMemberByGroupID(req.GroupID) - if err != nil { - log.NewError(req.OperationID, "DeleteGroupMemberByGroupID failed ", req.GroupID) - return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil - - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return ", pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}) return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil } @@ -1304,14 +1638,36 @@ func (s *groupServer) DismissGroup(ctx context.Context, req *pbGroup.DismissGrou func (s *groupServer) MuteGroupMember(ctx context.Context, req *pbGroup.MuteGroupMemberReq) (*pbGroup.MuteGroupMemberResp, error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String()) - if !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsManagerUserID(req.OpUserID) { - log.Error(req.OperationID, "verify failed ", req.GroupID, req.UserID) - return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + opFlag, err := s.getGroupUserLevel(req.GroupID, req.OpUserID) + if err != nil { + errMsg := req.OperationID + " getGroupUserLevel failed " + req.GroupID + req.OpUserID + err.Error() + log.Error(req.OperationID, errMsg) + return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil } + if opFlag == 0 { + errMsg := req.OperationID + "opFlag == 0 " + req.GroupID + req.OpUserID + log.Error(req.OperationID, errMsg) + return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + + mutedInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, req.UserID) + if err != nil { + errMsg := req.OperationID + " GetGroupMemberInfoByGroupIDAndUserID failed " + req.GroupID + req.UserID + err.Error() + return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + if mutedInfo.RoleLevel == constant.GroupOwner && opFlag != 1 { + errMsg := req.OperationID + " mutedInfo.RoleLevel == constant.GroupOwner " + req.GroupID + req.UserID + return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + if mutedInfo.RoleLevel == constant.GroupAdmin && opFlag == 3 { + errMsg := req.OperationID + " mutedInfo.RoleLevel == constant.GroupAdmin " + req.GroupID + req.UserID + return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + groupMemberInfo := db.GroupMember{GroupID: req.GroupID, UserID: req.UserID} groupMemberInfo.MuteEndTime = time.Unix(int64(time.Now().Second())+int64(req.MutedSeconds), time.Now().UnixNano()) - err := imdb.UpdateGroupMemberInfo(groupMemberInfo) + err = imdb.UpdateGroupMemberInfo(groupMemberInfo) if err != nil { log.Error(req.OperationID, "UpdateGroupMemberInfo failed ", err.Error(), groupMemberInfo) return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil @@ -1323,13 +1679,36 @@ func (s *groupServer) MuteGroupMember(ctx context.Context, req *pbGroup.MuteGrou func (s *groupServer) CancelMuteGroupMember(ctx context.Context, req *pbGroup.CancelMuteGroupMemberReq) (*pbGroup.CancelMuteGroupMemberResp, error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String()) - if !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsManagerUserID(req.OpUserID) { - log.Error(req.OperationID, "verify failed ", req.OpUserID, req.GroupID) - return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + + opFlag, err := s.getGroupUserLevel(req.GroupID, req.OpUserID) + if err != nil { + errMsg := req.OperationID + " getGroupUserLevel failed " + req.GroupID + req.OpUserID + err.Error() + log.Error(req.OperationID, errMsg) + return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil } + if opFlag == 0 { + errMsg := req.OperationID + "opFlag == 0 " + req.GroupID + req.OpUserID + log.Error(req.OperationID, errMsg) + return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + + mutedInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, req.UserID) + if err != nil { + errMsg := req.OperationID + " GetGroupMemberInfoByGroupIDAndUserID failed " + req.GroupID + req.UserID + err.Error() + return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + if mutedInfo.RoleLevel == constant.GroupOwner && opFlag != 1 { + errMsg := req.OperationID + " mutedInfo.RoleLevel == constant.GroupOwner " + req.GroupID + req.UserID + return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + if mutedInfo.RoleLevel == constant.GroupAdmin && opFlag == 3 { + errMsg := req.OperationID + " mutedInfo.RoleLevel == constant.GroupAdmin " + req.GroupID + req.UserID + return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + groupMemberInfo := db.GroupMember{GroupID: req.GroupID, UserID: req.UserID} groupMemberInfo.MuteEndTime = time.Unix(0, 0) - err := imdb.UpdateGroupMemberInfo(groupMemberInfo) + err = imdb.UpdateGroupMemberInfo(groupMemberInfo) if err != nil { log.Error(req.OperationID, "UpdateGroupMemberInfo failed ", err.Error(), groupMemberInfo) return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil @@ -1341,11 +1720,34 @@ func (s *groupServer) CancelMuteGroupMember(ctx context.Context, req *pbGroup.Ca func (s *groupServer) MuteGroup(ctx context.Context, req *pbGroup.MuteGroupReq) (*pbGroup.MuteGroupResp, error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String()) - if !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsManagerUserID(req.OpUserID) { - log.Error(req.OperationID, "verify failed ", req.GroupID, req.GroupID) - return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + + opFlag, err := s.getGroupUserLevel(req.GroupID, req.OpUserID) + if err != nil { + errMsg := req.OperationID + " getGroupUserLevel failed " + req.GroupID + req.OpUserID + err.Error() + log.Error(req.OperationID, errMsg) + return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil } - err := imdb.OperateGroupStatus(req.GroupID, constant.GroupStatusMuted) + if opFlag == 0 { + errMsg := req.OperationID + "opFlag == 0 " + req.GroupID + req.OpUserID + log.Error(req.OperationID, errMsg) + return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + + //mutedInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, req.UserID) + //if err != nil { + // errMsg := req.OperationID + " GetGroupMemberInfoByGroupIDAndUserID failed " + req.GroupID + req.OpUserID + err.Error() + // return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + //} + //if mutedInfo.RoleLevel == constant.GroupOwner && opFlag != 1 { + // errMsg := req.OperationID + " mutedInfo.RoleLevel == constant.GroupOwner " + req.GroupID + req.OpUserID + err.Error() + // return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + //} + //if mutedInfo.RoleLevel == constant.GroupAdmin && opFlag == 3 { + // errMsg := req.OperationID + " mutedInfo.RoleLevel == constant.GroupAdmin " + req.GroupID + req.OpUserID + err.Error() + // return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + //} + + err = imdb.OperateGroupStatus(req.GroupID, constant.GroupStatusMuted) if err != nil { log.Error(req.OperationID, "OperateGroupStatus failed ", err.Error(), req.GroupID, constant.GroupStatusMuted) return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil @@ -1357,12 +1759,34 @@ func (s *groupServer) MuteGroup(ctx context.Context, req *pbGroup.MuteGroupReq) func (s *groupServer) CancelMuteGroup(ctx context.Context, req *pbGroup.CancelMuteGroupReq) (*pbGroup.CancelMuteGroupResp, error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String()) - if !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsManagerUserID(req.OpUserID) { - log.Error(req.OperationID, "verify failed ", req.OpUserID, req.GroupID) - return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + + opFlag, err := s.getGroupUserLevel(req.GroupID, req.OpUserID) + if err != nil { + errMsg := req.OperationID + " getGroupUserLevel failed " + req.GroupID + req.OpUserID + err.Error() + log.Error(req.OperationID, errMsg) + return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + if opFlag == 0 { + errMsg := req.OperationID + "opFlag == 0 " + req.GroupID + req.OpUserID + log.Error(req.OperationID, errMsg) + return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil } - err := imdb.UpdateGroupInfoDefaultZero(req.GroupID, map[string]interface{}{"status": constant.GroupOk}) + //mutedInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, req.) + //if err != nil { + // errMsg := req.OperationID + " GetGroupMemberInfoByGroupIDAndUserID failed " + req.GroupID + req.OpUserID + err.Error() + // return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + //} + //if mutedInfo.RoleLevel == constant.GroupOwner && opFlag != 1 { + // errMsg := req.OperationID + " mutedInfo.RoleLevel == constant.GroupOwner " + req.GroupID + req.OpUserID + err.Error() + // return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + //} + //if mutedInfo.RoleLevel == constant.GroupAdmin && opFlag == 3 { + // errMsg := req.OperationID + " mutedInfo.RoleLevel == constant.GroupAdmin " + req.GroupID + req.OpUserID + err.Error() + // return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + //} + log.Debug(req.OperationID, "UpdateGroupInfoDefaultZero ", req.GroupID, map[string]interface{}{"status": constant.GroupOk}) + err = imdb.UpdateGroupInfoDefaultZero(req.GroupID, map[string]interface{}{"status": constant.GroupOk}) if err != nil { log.Error(req.OperationID, "UpdateGroupInfoDefaultZero failed ", err.Error(), req.GroupID) return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil @@ -1404,3 +1828,46 @@ func (s *groupServer) SetGroupMemberNickname(ctx context.Context, req *pbGroup.S log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return ", pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}) return &pbGroup.SetGroupMemberNicknameResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil } + +func (s *groupServer) SetGroupMemberInfo(ctx context.Context, req *pbGroup.SetGroupMemberInfoReq) (resp *pbGroup.SetGroupMemberInfoResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbGroup.SetGroupMemberInfoResp{CommonResp: &pbGroup.CommonResp{}} + groupMember := db.GroupMember{ + GroupID: req.GroupID, + UserID: req.UserID, + } + m := make(map[string]interface{}) + if req.RoleLevel != nil { + m["role_level"] = req.RoleLevel.Value + } + if req.FaceURL != nil { + m["user_group_face_url"] = req.FaceURL.Value + } + if req.Nickname != nil { + m["nickname"] = req.Nickname.Value + } + if req.Ex != nil { + m["ex"] = req.Ex.Value + } + err = imdb.UpdateGroupMemberInfoByMap(groupMember, m) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetGroupMemberInfo failed", err.Error()) + resp.CommonResp.ErrCode = constant.ErrDB.ErrCode + resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg + ":" + err.Error() + return resp, nil + } + if req.RoleLevel != nil { + switch req.RoleLevel.Value { + case constant.GroupOrdinaryUsers: + //chat.GroupMemberRoleLevelChangeNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID, constant.GroupMemberSetToOrdinaryUserNotification) + chat.GroupMemberInfoSetNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID) + case constant.GroupAdmin, constant.GroupOwner: + //chat.GroupMemberRoleLevelChangeNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID, constant.GroupMemberSetToAdminNotification) + chat.GroupMemberInfoSetNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID) + } + } else { + chat.GroupMemberInfoSetNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} diff --git a/internal/rpc/group/super_group.go b/internal/rpc/group/super_group.go new file mode 100644 index 000000000..ca57bbb4f --- /dev/null +++ b/internal/rpc/group/super_group.go @@ -0,0 +1,64 @@ +package group + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + cp "Open_IM/pkg/common/utils" + pbGroup "Open_IM/pkg/proto/group" + commonPb "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" +) + +func (s *groupServer) GetJoinedSuperGroupList(ctx context.Context, req *pbGroup.GetJoinedSuperGroupListReq) (*pbGroup.GetJoinedSuperGroupListResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbGroup.GetJoinedSuperGroupListResp{CommonResp: &pbGroup.CommonResp{}} + userToSuperGroup, err := db.DB.GetSuperGroupByUserID(req.UserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSuperGroupByUserID failed", err.Error()) + resp.CommonResp.ErrCode = constant.ErrDB.ErrCode + resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg + return resp, nil + } + for _, groupID := range userToSuperGroup.GroupIDList { + groupInfoDB, err := imdb.GetGroupInfoByGroupID(groupID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupInfoByGroupID failed", groupID, err.Error()) + continue + } + groupInfo := &commonPb.GroupInfo{} + if err := utils.CopyStructFields(groupInfo, groupInfoDB); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + } + group, err := db.DB.GetSuperGroup(groupID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSuperGroup failed", groupID, err.Error()) + continue + } + groupInfo.MemberCount = uint32(len(group.MemberIDList)) + resp.GroupList = append(resp.GroupList, groupInfo) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *groupServer) GetSuperGroupsInfo(_ context.Context, req *pbGroup.GetSuperGroupsInfoReq) (resp *pbGroup.GetSuperGroupsInfoResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbGroup.GetSuperGroupsInfoResp{CommonResp: &pbGroup.CommonResp{}} + groupsInfoList := make([]*commonPb.GroupInfo, 0) + for _, groupID := range req.GroupIDList { + groupInfoFromMysql, err := imdb.GetGroupInfoByGroupID(groupID) + if err != nil { + log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), groupID) + continue + } + var groupInfo commonPb.GroupInfo + cp.GroupDBCopyOpenIM(&groupInfo, groupInfoFromMysql) + groupsInfoList = append(groupsInfoList, &groupInfo) + } + resp.GroupInfoList = groupsInfoList + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} diff --git a/internal/rpc/message_cms/message_cms.go b/internal/rpc/message_cms/message_cms.go index e35755ef2..44fdca1e4 100644 --- a/internal/rpc/message_cms/message_cms.go +++ b/internal/rpc/message_cms/message_cms.go @@ -63,13 +63,14 @@ func (s *messageCMSServer) Run() { defer srv.GracefulStop() //Service registers with etcd pbMessageCMS.RegisterMessageCMSServer(srv, s) - rpcRegisterIP := "" + rpcRegisterIP := config.Config.RpcRegisterIP if config.Config.RpcRegisterIP == "" { rpcRegisterIP, err = utils.GetLocalIP() if err != nil { log.Error("", "GetLocalIP failed ", err.Error()) } } + log.NewInfo("", "rpcRegisterIP", rpcRegisterIP) err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) if err != nil { log.NewError("0", "RegisterEtcd failed ", err.Error()) diff --git a/internal/rpc/msg/callback.go b/internal/rpc/msg/callback.go index 452846799..440680e1b 100644 --- a/internal/rpc/msg/callback.go +++ b/internal/rpc/msg/callback.go @@ -8,6 +8,7 @@ import ( "Open_IM/pkg/common/log" pbChat "Open_IM/pkg/proto/chat" "Open_IM/pkg/utils" + http2 "net/http" ) func copyCallbackCommonReqStruct(msg *pbChat.SendMsgReq) cbApi.CommonCallbackReq { @@ -24,14 +25,16 @@ func copyCallbackCommonReqStruct(msg *pbChat.SendMsgReq) cbApi.CommonCallbackReq Status: msg.MsgData.Status, CreateTime: msg.MsgData.CreateTime, Content: string(msg.MsgData.Content), + AtUserIDList: msg.MsgData.AtUserIDList, + SenderFaceURL: msg.MsgData.SenderFaceURL, } } -func callbackBeforeSendSingleMsg(msg *pbChat.SendMsgReq) (canSend bool, err error) { +func callbackBeforeSendSingleMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp { + callbackResp := cbApi.CommonCallbackResp{OperationID: msg.OperationID} if !config.Config.Callback.CallbackBeforeSendSingleMsg.Enable { - return true, nil + return callbackResp } - log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) commonCallbackReq := copyCallbackCommonReqStruct(msg) commonCallbackReq.CallbackCommand = constant.CallbackBeforeSendSingleMsgCommand @@ -40,27 +43,28 @@ func callbackBeforeSendSingleMsg(msg *pbChat.SendMsgReq) (canSend bool, err erro RecvID: msg.MsgData.RecvID, } resp := &cbApi.CallbackBeforeSendSingleMsgResp{ - CommonCallbackResp: cbApi.CommonCallbackResp{}, + CommonCallbackResp: &callbackResp, } //utils.CopyStructFields(req, msg.MsgData) defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackBeforeSendSingleMsg.CallbackTimeOut); err != nil { + callbackResp.ErrCode = http2.StatusInternalServerError + callbackResp.ErrMsg = err.Error() if !config.Config.Callback.CallbackBeforeSendSingleMsg.CallbackFailedContinue { - return false, err + callbackResp.ActionCode = constant.ActionForbidden + return callbackResp } else { - return true, err - } - } else { - if resp.ActionCode == constant.ActionForbidden && resp.ErrCode == constant.CallbackHandleSuccess { - return false, nil + callbackResp.ActionCode = constant.ActionAllow + return callbackResp } } - return true, err + return callbackResp } -func callbackAfterSendSingleMsg(msg *pbChat.SendMsgReq) error { +func callbackAfterSendSingleMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp { + callbackResp := cbApi.CommonCallbackResp{OperationID: msg.OperationID} if !config.Config.Callback.CallbackAfterSendSingleMsg.Enable { - return nil + return callbackResp } log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) commonCallbackReq := copyCallbackCommonReqStruct(msg) @@ -69,18 +73,20 @@ func callbackAfterSendSingleMsg(msg *pbChat.SendMsgReq) error { CommonCallbackReq: commonCallbackReq, RecvID: msg.MsgData.RecvID, } - resp := &cbApi.CallbackAfterSendSingleMsgResp{CommonCallbackResp: cbApi.CommonCallbackResp{}} - //utils.CopyStructFields(req, msg.MsgData) + resp := &cbApi.CallbackAfterSendSingleMsgResp{CommonCallbackResp: &callbackResp} defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackAfterSendSingleMsg.CallbackTimeOut); err != nil { - return err + callbackResp.ErrCode = http2.StatusInternalServerError + callbackResp.ErrMsg = err.Error() + return callbackResp } - return nil + return callbackResp } -func callbackBeforeSendGroupMsg(msg *pbChat.SendMsgReq) (canSend bool, err error) { +func callbackBeforeSendGroupMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp { + callbackResp := cbApi.CommonCallbackResp{OperationID: msg.OperationID} if !config.Config.Callback.CallbackBeforeSendGroupMsg.Enable { - return true, nil + return callbackResp } log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) commonCallbackReq := copyCallbackCommonReqStruct(msg) @@ -89,26 +95,26 @@ func callbackBeforeSendGroupMsg(msg *pbChat.SendMsgReq) (canSend bool, err error CommonCallbackReq: commonCallbackReq, GroupID: msg.MsgData.GroupID, } - resp := &cbApi.CallbackBeforeSendGroupMsgResp{CommonCallbackResp: cbApi.CommonCallbackResp{}} - //utils.CopyStructFields(req, msg.MsgData) + resp := &cbApi.CallbackBeforeSendGroupMsgResp{CommonCallbackResp: &callbackResp} defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackBeforeSendGroupMsg.CallbackTimeOut); err != nil { + callbackResp.ErrCode = http2.StatusInternalServerError + callbackResp.ErrMsg = err.Error() if !config.Config.Callback.CallbackBeforeSendGroupMsg.CallbackFailedContinue { - return false, err + callbackResp.ActionCode = constant.ActionForbidden + return callbackResp } else { - return true, err - } - } else { - if resp.ActionCode == constant.ActionForbidden && resp.ErrCode == constant.CallbackHandleSuccess { - return false, nil + callbackResp.ActionCode = constant.ActionAllow + return callbackResp } } - return true, err + return callbackResp } -func callbackAfterSendGroupMsg(msg *pbChat.SendMsgReq) error { +func callbackAfterSendGroupMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp { + callbackResp := cbApi.CommonCallbackResp{OperationID: msg.OperationID} if !config.Config.Callback.CallbackAfterSendGroupMsg.Enable { - return nil + return callbackResp } log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) commonCallbackReq := copyCallbackCommonReqStruct(msg) @@ -117,19 +123,20 @@ func callbackAfterSendGroupMsg(msg *pbChat.SendMsgReq) error { CommonCallbackReq: commonCallbackReq, GroupID: msg.MsgData.GroupID, } - resp := &cbApi.CallbackAfterSendGroupMsgResp{CommonCallbackResp: cbApi.CommonCallbackResp{}} - - //utils.CopyStructFields(req, msg.MsgData) + resp := &cbApi.CallbackAfterSendGroupMsgResp{CommonCallbackResp: &callbackResp} defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackAfterSendGroupMsg.CallbackTimeOut); err != nil { - return err + callbackResp.ErrCode = http2.StatusInternalServerError + callbackResp.ErrMsg = err.Error() + return callbackResp } - return nil + return callbackResp } -func callbackWordFilter(msg *pbChat.SendMsgReq) (canSend bool, err error) { +func callbackWordFilter(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp { + callbackResp := cbApi.CommonCallbackResp{OperationID: msg.OperationID} if !config.Config.Callback.CallbackWordFilter.Enable || msg.MsgData.ContentType != constant.Text { - return true, nil + return callbackResp } log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) commonCallbackReq := copyCallbackCommonReqStruct(msg) @@ -137,24 +144,22 @@ func callbackWordFilter(msg *pbChat.SendMsgReq) (canSend bool, err error) { req := cbApi.CallbackWordFilterReq{ CommonCallbackReq: commonCallbackReq, } - resp := &cbApi.CallbackWordFilterResp{CommonCallbackResp: cbApi.CommonCallbackResp{}} - //utils.CopyStructFields(&req., msg.MsgData) + resp := &cbApi.CallbackWordFilterResp{CommonCallbackResp: &callbackResp} defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackWordFilter.CallbackTimeOut); err != nil { + callbackResp.ErrCode = http2.StatusInternalServerError + callbackResp.ErrMsg = err.Error() if !config.Config.Callback.CallbackWordFilter.CallbackFailedContinue { - log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), "callback failed and config disable, stop this operation") - return false, err + callbackResp.ActionCode = constant.ActionForbidden + return callbackResp } else { - return true, err + callbackResp.ActionCode = constant.ActionAllow + return callbackResp } - } else { - if resp.ActionCode == constant.ActionForbidden && resp.ErrCode == constant.CallbackHandleSuccess { - return false, nil - } - if resp.ErrCode == constant.CallbackHandleSuccess { - msg.MsgData.Content = []byte(resp.Content) - } - log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), string(msg.MsgData.Content)) } - return true, err + if resp.ErrCode == constant.CallbackHandleSuccess && resp.ActionCode == constant.ActionAllow && resp.Content != "" { + msg.MsgData.Content = []byte(resp.Content) + } + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), string(msg.MsgData.Content)) + return callbackResp } diff --git a/internal/rpc/msg/chat.go b/internal/rpc/msg/chat.go new file mode 100644 index 000000000..bb83dc055 --- /dev/null +++ b/internal/rpc/msg/chat.go @@ -0,0 +1,38 @@ +package msg + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" + "context" +) + +func (rpc *rpcChat) ClearMsg(_ context.Context, req *pbChat.ClearMsgReq) (*pbChat.ClearMsgResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc req: ", req.String()) + if req.OpUserID != req.UserID && !token_verify.IsManagerUserID(req.UserID) { + errMsg := "No permission" + req.OpUserID + req.UserID + log.Error(req.OperationID, errMsg) + return &pbChat.ClearMsgResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + log.Debug(req.OperationID, "CleanUpOneUserAllMsgFromRedis args", req.UserID) + err := db.DB.CleanUpOneUserAllMsgFromRedis(req.UserID, req.OperationID) + if err != nil { + errMsg := "CleanUpOneUserAllMsgFromRedis failed " + err.Error() + req.OperationID + req.UserID + log.Error(req.OperationID, errMsg) + return &pbChat.ClearMsgResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + log.Debug(req.OperationID, "CleanUpUserMsgFromMongo args", req.UserID) + err = db.DB.CleanUpUserMsgFromMongo(req.UserID, req.OperationID) + if err != nil { + errMsg := "CleanUpUserMsgFromMongo failed " + err.Error() + req.OperationID + req.UserID + log.Error(req.OperationID, errMsg) + return &pbChat.ClearMsgResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + + resp := pbChat.ClearMsgResp{ErrCode: 0} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return &resp, nil +} diff --git a/internal/rpc/msg/conversation_notification.go b/internal/rpc/msg/conversation_notification.go index 5c39ea06a..b43db7959 100644 --- a/internal/rpc/msg/conversation_notification.go +++ b/internal/rpc/msg/conversation_notification.go @@ -49,12 +49,6 @@ func ConversationSetPrivateNotification(operationID, sendID, recvID string, isPr } var tips open_im_sdk.TipsComm var tipsMsg string - //var senderName string - //senderName, err := im_mysql_model.GetUserNameByUserID(sendID) - //if err != nil { - // log.NewError(operationID, utils.GetSelfFuncName(), err.Error()) - // senderName = sendID - //} if isPrivateChat == true { tipsMsg = config.Config.Notification.ConversationSetPrivate.DefaultTips.OpenTips } else { diff --git a/internal/rpc/msg/del_msg.go b/internal/rpc/msg/del_msg.go index 17610a384..c6856bb98 100644 --- a/internal/rpc/msg/del_msg.go +++ b/internal/rpc/msg/del_msg.go @@ -2,23 +2,28 @@ package msg import ( "Open_IM/pkg/common/constant" - "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" commonPb "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" + "time" ) func (rpc *rpcChat) DelMsgList(_ context.Context, req *commonPb.DelMsgListReq) (*commonPb.DelMsgListResp, error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) resp := &commonPb.DelMsgListResp{} - if err := db.DB.DelMsgBySeqList(req.UserID, req.SeqList, req.OperationID); err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsg failed", err.Error()) - resp.ErrMsg = constant.ErrDB.ErrMsg - resp.ErrCode = constant.ErrDB.ErrCode + select { + case rpc.delMsgCh <- deleteMsg{ + UserID: req.UserID, + OpUserID: req.OpUserID, + SeqList: req.SeqList, + OperationID: req.OperationID, + }: + case <-time.After(1 * time.Second): + resp.ErrCode = constant.ErrSendLimit.ErrCode + resp.ErrMsg = constant.ErrSendLimit.ErrMsg return resp, nil } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) return resp, nil } diff --git a/internal/rpc/msg/group_notification.go b/internal/rpc/msg/group_notification.go index 5ba2400dd..b24789e23 100644 --- a/internal/rpc/msg/group_notification.go +++ b/internal/rpc/msg/group_notification.go @@ -12,6 +12,7 @@ import ( "Open_IM/pkg/utils" "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/types/known/wrapperspb" ) //message GroupCreatedTips{ @@ -36,7 +37,6 @@ func setOpUserInfo(opUserID, groupID string, groupMemberInfo *open_im_sdk.GroupM return utils.Wrap(err, "") } } - user, err := imdb.GetUserByUserID(opUserID) if err != nil { return utils.Wrap(err, "") @@ -101,7 +101,7 @@ func setPublicUserInfo(userID string, publicUserInfo *open_im_sdk.PublicUserInfo } func groupNotification(contentType int32, m proto.Message, sendID, groupID, recvUserID, operationID string) { - log.Info(operationID, utils.GetSelfFuncName(), "args: ", contentType) + log.Info(operationID, utils.GetSelfFuncName(), "args: ", contentType, sendID, groupID, recvUserID) var err error var tips open_im_sdk.TipsComm @@ -117,19 +117,19 @@ func groupNotification(contentType int32, m proto.Message, sendID, groupID, recv } tips.JsonDetail, _ = marshaler.MarshalToString(m) + var nickname string from, err := imdb.GetUserByUserID(sendID) if err != nil { log.Error(operationID, "GetUserByUserID failed ", err.Error(), sendID) } - nickname := "" if from != nil { nickname = from.Nickname } to, err := imdb.GetUserByUserID(recvUserID) if err != nil { - log.Error(operationID, "GetUserByUserID failed ", err.Error(), recvUserID) + log.NewWarn(operationID, "GetUserByUserID failed ", err.Error(), recvUserID) } toNickname := "" if to != nil { @@ -170,7 +170,10 @@ func groupNotification(contentType int32, m proto.Message, sendID, groupID, recv tips.DefaultTips = toNickname + "" + cn.GroupMemberCancelMuted.DefaultTips.Tips case constant.GroupMemberInfoSetNotification: tips.DefaultTips = toNickname + "" + cn.GroupMemberInfoSet.DefaultTips.Tips - + case constant.GroupMemberSetToAdminNotification: + tips.DefaultTips = toNickname + "" + cn.GroupMemberSetToAdmin.DefaultTips.Tips + case constant.GroupMemberSetToOrdinaryUserNotification: + tips.DefaultTips = toNickname + "" + cn.GroupMemberSetToOrdinary.DefaultTips.Tips default: log.Error(operationID, "contentType failed ", contentType) return @@ -225,12 +228,24 @@ func GroupCreatedNotification(operationID, opUserID, groupID string, initMemberL } //群信息改变后掉用 -func GroupInfoSetNotification(operationID, opUserID, groupID string) { +//groupName := "" +// notification := "" +// introduction := "" +// faceURL := "" +func GroupInfoSetNotification(operationID, opUserID, groupID string, groupName, notification, introduction, faceURL string, needVerification *wrapperspb.Int32Value) { GroupInfoChangedTips := open_im_sdk.GroupInfoSetTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}} if err := setGroupInfo(groupID, GroupInfoChangedTips.Group); err != nil { log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID) return } + GroupInfoChangedTips.Group.GroupName = groupName + GroupInfoChangedTips.Group.Notification = notification + GroupInfoChangedTips.Group.Introduction = introduction + GroupInfoChangedTips.Group.FaceURL = faceURL + if needVerification != nil { + GroupInfoChangedTips.Group.NeedVerification = needVerification.Value + } + if err := setOpUserInfo(opUserID, groupID, GroupInfoChangedTips.OpUser); err != nil { log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID) return @@ -303,6 +318,28 @@ func GroupMemberInfoSetNotification(operationID, opUserID, groupID, groupMemberU groupNotification(constant.GroupMemberInfoSetNotification, &tips, opUserID, groupID, "", operationID) } +func GroupMemberRoleLevelChangeNotification(operationID, opUserID, groupID, groupMemberUserID string, notificationType int32) { + if notificationType != constant.GroupMemberSetToAdminNotification && notificationType != constant.GroupMemberSetToOrdinaryUserNotification { + log.NewError(operationID, utils.GetSelfFuncName(), "invalid notificationType: ", notificationType) + return + } + tips := open_im_sdk.GroupMemberInfoSetTips{Group: &open_im_sdk.GroupInfo{}, + OpUser: &open_im_sdk.GroupMemberFullInfo{}, ChangedUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(groupID, tips.Group); err != nil { + log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID) + return + } + if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil { + log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID) + return + } + if err := setGroupMemberInfo(groupID, groupMemberUserID, tips.ChangedUser); err != nil { + log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, groupMemberUserID) + return + } + groupNotification(notificationType, &tips, opUserID, groupID, "", operationID) +} + func GroupMemberCancelMutedNotification(operationID, opUserID, groupID, groupMemberUserID string) { tips := open_im_sdk.GroupMemberCancelMutedTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}, MutedUser: &open_im_sdk.GroupMemberFullInfo{}} @@ -521,9 +558,21 @@ func MemberEnterNotification(req *pbGroup.GroupApplicationResponseReq) { return } if err := setGroupMemberInfo(req.GroupID, req.FromUserID, MemberEnterTips.EntrantUser); err != nil { - log.Error(req.OperationID, "setOpUserInfo failed ", err.Error(), req.OpUserID, req.GroupID, MemberEnterTips.EntrantUser) + log.Error(req.OperationID, "setGroupMemberInfo failed ", err.Error(), req.OpUserID, req.GroupID, MemberEnterTips.EntrantUser) return } groupNotification(constant.MemberEnterNotification, &MemberEnterTips, req.OpUserID, req.GroupID, "", req.OperationID) - +} + +func MemberEnterDirectlyNotification(groupID string, entrantUserID string, operationID string) { + MemberEnterTips := open_im_sdk.MemberEnterTips{Group: &open_im_sdk.GroupInfo{}, EntrantUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(groupID, MemberEnterTips.Group); err != nil { + log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID, MemberEnterTips.Group) + return + } + if err := setGroupMemberInfo(groupID, entrantUserID, MemberEnterTips.EntrantUser); err != nil { + log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, entrantUserID, MemberEnterTips.EntrantUser) + return + } + groupNotification(constant.MemberEnterNotification, &MemberEnterTips, entrantUserID, groupID, "", operationID) } diff --git a/internal/rpc/msg/msg_notification.go b/internal/rpc/msg/msg_notification.go new file mode 100644 index 000000000..8ecdafbff --- /dev/null +++ b/internal/rpc/msg/msg_notification.go @@ -0,0 +1,47 @@ +package msg + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" +) + +func DeleteMessageNotification(opUserID, userID string, seqList []uint32, operationID string) { + DeleteMessageTips := open_im_sdk.DeleteMessageTips{OpUserID: opUserID, UserID: userID, SeqList: seqList} + MessageNotification(operationID, userID, userID, constant.DeleteMessageNotification, &DeleteMessageTips) +} + +func MessageNotification(operationID, sendID, recvID string, contentType int32, m proto.Message) { + log.Debug(operationID, utils.GetSelfFuncName(), "args: ", m.String(), contentType) + var err error + var tips open_im_sdk.TipsComm + tips.Detail, err = proto.Marshal(m) + if err != nil { + log.Error(operationID, "Marshal failed ", err.Error(), m.String()) + return + } + + marshaler := jsonpb.Marshaler{ + OrigName: true, + EnumsAsInts: false, + EmitDefaults: false, + } + + tips.JsonDetail, _ = marshaler.MarshalToString(m) + var n NotificationMsg + n.SendID = sendID + n.RecvID = recvID + n.ContentType = contentType + n.SessionType = constant.SingleChatType + n.MsgFrom = constant.SysMsgType + n.OperationID = operationID + n.Content, err = proto.Marshal(&tips) + if err != nil { + log.Error(operationID, "Marshal failed ", err.Error(), tips.String()) + return + } + Notification(&n) +} diff --git a/internal/rpc/msg/pull_message.go b/internal/rpc/msg/pull_message.go index 819a9592e..22181f09b 100644 --- a/internal/rpc/msg/pull_message.go +++ b/internal/rpc/msg/pull_message.go @@ -2,56 +2,100 @@ package msg import ( "context" - "github.com/garyburd/redigo/redis" + go_redis "github.com/go-redis/redis/v8" commonDB "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" - pbMsg "Open_IM/pkg/proto/chat" open_im_sdk "Open_IM/pkg/proto/sdk_ws" ) -func (rpc *rpcChat) GetMaxAndMinSeq(_ context.Context, in *pbMsg.GetMaxAndMinSeqReq) (*pbMsg.GetMaxAndMinSeqResp, error) { +func (rpc *rpcChat) GetMaxAndMinSeq(_ context.Context, in *open_im_sdk.GetMaxAndMinSeqReq) (*open_im_sdk.GetMaxAndMinSeqResp, error) { log.NewInfo(in.OperationID, "rpc getMaxAndMinSeq is arriving", in.String()) + resp := new(open_im_sdk.GetMaxAndMinSeqResp) + m := make(map[string]*open_im_sdk.MaxAndMinSeq) //seq, err := model.GetBiggestSeqFromReceive(in.UserID) maxSeq, err1 := commonDB.DB.GetUserMaxSeq(in.UserID) - minSeq, err2 := commonDB.DB.GetUserMinSeq(in.UserID) - resp := new(pbMsg.GetMaxAndMinSeqResp) + //minSeq, err2 := commonDB.DB.GetUserMinSeq(in.UserID) if err1 == nil { resp.MaxSeq = uint32(maxSeq) - } else if err1 == redis.ErrNil { + for _, v := range in.GroupIDList { + x := new(open_im_sdk.MaxAndMinSeq) + maxSeq, _ := commonDB.DB.GetUserMaxSeq(v) + x.MaxSeq = uint32(maxSeq) + m[v] = x + } + resp.GroupMaxAndMinSeq = m + } else if err1 == go_redis.Nil { resp.MaxSeq = 0 } else { log.NewError(in.OperationID, "getMaxSeq from redis error", in.String(), err1.Error()) resp.ErrCode = 200 resp.ErrMsg = "redis get err" } - if err2 == nil { - resp.MinSeq = uint32(minSeq) - } else if err2 == redis.ErrNil { - resp.MinSeq = 0 - } else { - log.NewError(in.OperationID, "getMaxSeq from redis error", in.String(), err2.Error()) - resp.ErrCode = 201 - resp.ErrMsg = "redis get err" - } + //if err2 == nil { + // resp.MinSeq = uint32(minSeq) + //} else if err2 == redis.ErrNil { + // resp.MinSeq = 0 + //} else { + // log.NewError(in.OperationID, "getMaxSeq from redis error", in.String(), err2.Error()) + // resp.ErrCode = 201 + // resp.ErrMsg = "redis get err" + //} return resp, nil } func (rpc *rpcChat) PullMessageBySeqList(_ context.Context, in *open_im_sdk.PullMessageBySeqListReq) (*open_im_sdk.PullMessageBySeqListResp, error) { log.NewInfo(in.OperationID, "rpc PullMessageBySeqList is arriving", in.String()) resp := new(open_im_sdk.PullMessageBySeqListResp) + m := make(map[string]*open_im_sdk.MsgDataList) //msgList, err := commonDB.DB.GetMsgBySeqList(in.UserID, in.SeqList, in.OperationID) - msgList, err := commonDB.DB.GetMsgBySeqListMongo2(in.UserID, in.SeqList, in.OperationID) + redisMsgList, failedSeqList, err := commonDB.DB.GetMessageListBySeq(in.UserID, in.SeqList, in.OperationID) if err != nil { - log.Error(in.OperationID, "PullMessageBySeqList data error", in.String(), err.Error()) - resp.ErrCode = 201 - resp.ErrMsg = err.Error() - return resp, nil + if err != go_redis.Nil { + log.Error(in.OperationID, "get message from redis exception", err.Error(), failedSeqList) + } else { + log.Debug(in.OperationID, "get message from redis is nil", failedSeqList) + } + msgList, err1 := commonDB.DB.GetMsgBySeqListMongo2(in.UserID, failedSeqList, in.OperationID) + if err1 != nil { + log.Error(in.OperationID, "PullMessageBySeqList data error", in.String(), err.Error()) + resp.ErrCode = 201 + resp.ErrMsg = err.Error() + return resp, nil + } else { + redisMsgList = append(redisMsgList, msgList...) + resp.List = redisMsgList + } + } else { + resp.List = redisMsgList } + for k, v := range in.GroupSeqList { + x := new(open_im_sdk.MsgDataList) + redisMsgList, failedSeqList, err := commonDB.DB.GetMessageListBySeq(k, v.SeqList, in.OperationID) + if err != nil { + if err != go_redis.Nil { + log.Error(in.OperationID, "get message from redis exception", err.Error(), failedSeqList) + } else { + log.Debug(in.OperationID, "get message from redis is nil", failedSeqList) + } + msgList, err1 := commonDB.DB.GetSuperGroupMsgBySeqListMongo(k, failedSeqList, in.OperationID) + if err1 != nil { + log.Error(in.OperationID, "PullMessageBySeqList data error", in.String(), err.Error()) + resp.ErrCode = 201 + resp.ErrMsg = err.Error() + return resp, nil + } else { + redisMsgList = append(redisMsgList, msgList...) + x.MsgDataList = redisMsgList + m[k] = x + } + } else { + x.MsgDataList = redisMsgList + m[k] = x + } + } + resp.GroupMsgDataList = m //respSingleMsgFormat = singleMsgHandleByUser(SingleMsgFormat, in.UserID) //respGroupMsgFormat = groupMsgHandleByUser(GroupMsgFormat) - resp.ErrCode = 0 - resp.ErrMsg = "" - resp.List = msgList return resp, nil } diff --git a/internal/rpc/msg/rpcChat.go b/internal/rpc/msg/rpcChat.go index 002918bae..e7ae283ab 100644 --- a/internal/rpc/msg/rpcChat.go +++ b/internal/rpc/msg/rpcChat.go @@ -3,6 +3,7 @@ package msg import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" "Open_IM/pkg/common/kafka" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" @@ -21,6 +22,14 @@ type rpcChat struct { etcdAddr []string onlineProducer *kafka.Producer offlineProducer *kafka.Producer + delMsgCh chan deleteMsg +} + +type deleteMsg struct { + UserID string + OpUserID string + SeqList []uint32 + OperationID string } func NewRpcChatServer(port int) *rpcChat { @@ -33,6 +42,7 @@ func NewRpcChatServer(port int) *rpcChat { } rc.onlineProducer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.Ws2mschat.Topic) rc.offlineProducer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschatOffline.Addr, config.Config.Kafka.Ws2mschatOffline.Topic) + rc.delMsgCh = make(chan deleteMsg, 1000) return &rc } @@ -54,7 +64,7 @@ func (rpc *rpcChat) Run() { srv := grpc.NewServer() defer srv.GracefulStop() - rpcRegisterIP := "" + rpcRegisterIP := config.Config.RpcRegisterIP pbChat.RegisterChatServer(srv, rpc) if config.Config.RpcRegisterIP == "" { rpcRegisterIP, err = utils.GetLocalIP() @@ -67,7 +77,7 @@ func (rpc *rpcChat) Run() { log.Error("", "register rpcChat to etcd failed ", err.Error()) return } - + go rpc.runCh() err = srv.Serve(listener) if err != nil { log.Error("", "rpc rpcChat failed ", err.Error()) @@ -75,3 +85,22 @@ func (rpc *rpcChat) Run() { } log.Info("", "rpc rpcChat init success") } + +func (rpc *rpcChat) runCh() { + log.NewInfo("", "start del msg chan ") + for { + select { + case msg := <-rpc.delMsgCh: + log.NewInfo(msg.OperationID, utils.GetSelfFuncName(), "delmsgch recv new: ", msg) + db.DB.DelMsgFromCache(msg.UserID, msg.SeqList, msg.OperationID) + unexistSeqList, err := db.DB.DelMsgBySeqList(msg.UserID, msg.SeqList, msg.OperationID) + if err != nil { + log.NewError(msg.OperationID, utils.GetSelfFuncName(), "DelMsgBySeqList args: ", msg.UserID, msg.SeqList, msg.OperationID, err.Error()) + continue + } + if len(unexistSeqList) > 0 { + DeleteMessageNotification(msg.OpUserID, msg.UserID, unexistSeqList, msg.OperationID) + } + } + } +} diff --git a/internal/rpc/msg/send_msg.go b/internal/rpc/msg/send_msg.go index 16e4c5ab6..9d1fc841e 100644 --- a/internal/rpc/msg/send_msg.go +++ b/internal/rpc/msg/send_msg.go @@ -5,6 +5,7 @@ import ( "Open_IM/pkg/common/constant" "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" cacheRpc "Open_IM/pkg/proto/cache" pbCache "Open_IM/pkg/proto/cache" @@ -15,7 +16,7 @@ import ( "Open_IM/pkg/utils" "context" "errors" - "github.com/garyburd/redigo/redis" + go_redis "github.com/go-redis/redis/v8" "github.com/golang/protobuf/proto" "math/rand" "strconv" @@ -49,44 +50,81 @@ type MsgCallBackResp struct { } } -func userRelationshipVerification(data *pbChat.SendMsgReq) (bool, int32, string) { - if data.MsgData.SessionType == constant.GroupChatType { - return true, 0, "" - } - log.NewDebug(data.OperationID, config.Config.MessageVerify.FriendVerify) - reqGetBlackIDListFromCache := &cacheRpc.GetBlackIDListFromCacheReq{UserID: data.MsgData.RecvID, OperationID: data.OperationID} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) - cacheClient := cacheRpc.NewCacheClient(etcdConn) - cacheResp, err := cacheClient.GetBlackIDListFromCache(context.Background(), reqGetBlackIDListFromCache) - if err != nil { - log.NewError(data.OperationID, "GetBlackIDListFromCache rpc call failed ", err.Error()) - } else { - if cacheResp.CommonResp.ErrCode != 0 { - log.NewError(data.OperationID, "GetBlackIDListFromCache rpc logic call failed ", cacheResp.String()) +func isMessageHasReadEnabled(pb *pbChat.SendMsgReq) (bool, int32, string) { + switch pb.MsgData.ContentType { + case constant.HasReadReceipt: + if config.Config.SingleMessageHasReadReceiptEnable { + return true, 0, "" } else { - if utils.IsContain(data.MsgData.SendID, cacheResp.UserIDList) { - return false, 600, "in black list" - } + return false, constant.ErrMessageHasReadDisable.ErrCode, constant.ErrMessageHasReadDisable.ErrMsg + } + case constant.GroupHasReadReceipt: + if config.Config.GroupMessageHasReadReceiptEnable { + return true, 0, "" + } else { + return false, constant.ErrMessageHasReadDisable.ErrCode, constant.ErrMessageHasReadDisable.ErrMsg } } - log.NewDebug(data.OperationID, config.Config.MessageVerify.FriendVerify) - if config.Config.MessageVerify.FriendVerify { - reqGetFriendIDListFromCache := &cacheRpc.GetFriendIDListFromCacheReq{UserID: data.MsgData.RecvID, OperationID: data.OperationID} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + return true, 0, "" +} + +func userRelationshipVerification(data *pbChat.SendMsgReq) (bool, int32, string) { + if data.MsgData.SessionType == constant.SingleChatType { + if utils.IsContain(data.MsgData.SendID, config.Config.Manager.AppManagerUid) { + return true, 0, "" + } + if data.MsgData.ContentType <= constant.FriendApplicationNotification && data.MsgData.ContentType >= constant.FriendApplicationApprovedNotification { + return true, 0, "" + } + log.NewDebug(data.OperationID, config.Config.MessageVerify.FriendVerify) + reqGetBlackIDListFromCache := &cacheRpc.GetBlackIDListFromCacheReq{UserID: data.MsgData.RecvID, OperationID: data.OperationID} + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, data.OperationID) + if etcdConn == nil { + errMsg := data.OperationID + "getcdv3.GetConn == nil" + log.NewError(data.OperationID, errMsg) + return true, 0, "" + } + cacheClient := cacheRpc.NewCacheClient(etcdConn) - cacheResp, err := cacheClient.GetFriendIDListFromCache(context.Background(), reqGetFriendIDListFromCache) + cacheResp, err := cacheClient.GetBlackIDListFromCache(context.Background(), reqGetBlackIDListFromCache) if err != nil { - log.NewError(data.OperationID, "GetFriendIDListFromCache rpc call failed ", err.Error()) + log.NewError(data.OperationID, "GetBlackIDListFromCache rpc call failed ", err.Error()) } else { if cacheResp.CommonResp.ErrCode != 0 { - log.NewError(data.OperationID, "GetFriendIDListFromCache rpc logic call failed ", cacheResp.String()) + log.NewError(data.OperationID, "GetBlackIDListFromCache rpc logic call failed ", cacheResp.String()) } else { - if !utils.IsContain(data.MsgData.SendID, cacheResp.UserIDList) { - return false, 601, "not friend" + if utils.IsContain(data.MsgData.SendID, cacheResp.UserIDList) { + return false, 600, "in black list" } } } - return true, 0, "" + log.NewDebug(data.OperationID, config.Config.MessageVerify.FriendVerify) + if config.Config.MessageVerify.FriendVerify { + reqGetFriendIDListFromCache := &cacheRpc.GetFriendIDListFromCacheReq{UserID: data.MsgData.RecvID, OperationID: data.OperationID} + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, data.OperationID) + if etcdConn == nil { + errMsg := data.OperationID + "getcdv3.GetConn == nil" + log.NewError(data.OperationID, errMsg) + return true, 0, "" + } + cacheClient := cacheRpc.NewCacheClient(etcdConn) + cacheResp, err := cacheClient.GetFriendIDListFromCache(context.Background(), reqGetFriendIDListFromCache) + if err != nil { + log.NewError(data.OperationID, "GetFriendIDListFromCache rpc call failed ", err.Error()) + } else { + if cacheResp.CommonResp.ErrCode != 0 { + log.NewError(data.OperationID, "GetFriendIDListFromCache rpc logic call failed ", cacheResp.String()) + } else { + if !utils.IsContain(data.MsgData.SendID, cacheResp.UserIDList) { + return false, 601, "not friend" + } + } + } + return true, 0, "" + } else { + return true, 0, "" + } + } else { return true, 0, "" } @@ -137,57 +175,51 @@ func (rpc *rpcChat) encapsulateMsgData(msg *sdk_ws.MsgData) { utils.SetSwitchFromOptions(msg.Options, constant.IsSenderConversationUpdate, false) utils.SetSwitchFromOptions(msg.Options, constant.IsUnreadCount, false) utils.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, false) - } } func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.SendMsgResp, error) { replay := pbChat.SendMsgResp{} - log.NewDebug(pb.OperationID, "rpc sendMsg come here", pb.String()) - flag, errCode, errMsg := userRelationshipVerification(pb) + newTime := db.GetCurrentTimestampByMill() + log.Info(pb.OperationID, "rpc sendMsg come here ", pb.String()) + flag, errCode, errMsg := isMessageHasReadEnabled(pb) + log.Info(pb.OperationID, "isMessageHasReadEnabled ", flag) + if !flag { + return returnMsg(&replay, pb, errCode, errMsg, "", 0) + } + flag, errCode, errMsg = userRelationshipVerification(pb) + log.Info(pb.OperationID, "userRelationshipVerification ", flag) if !flag { return returnMsg(&replay, pb, errCode, errMsg, "", 0) } - //if !utils.VerifyToken(pb.Token, pb.SendID) { - // return returnMsg(&replay, pb, http.StatusUnauthorized, "token validate err,not authorized", "", 0) rpc.encapsulateMsgData(pb.MsgData) - log.Info("", "this is a test MsgData ", pb.MsgData) msgToMQSingle := pbChat.MsgDataToMQ{Token: pb.Token, OperationID: pb.OperationID, MsgData: pb.MsgData} - //options := utils.JsonStringToMap(pbData.Options) - isHistory := utils.GetSwitchFromOptions(pb.MsgData.Options, constant.IsHistory) - mReq := MsgCallBackReq{ - SendID: pb.MsgData.SendID, - RecvID: pb.MsgData.RecvID, - Content: string(pb.MsgData.Content), - SendTime: pb.MsgData.SendTime, - MsgFrom: pb.MsgData.MsgFrom, - ContentType: pb.MsgData.ContentType, - SessionType: pb.MsgData.SessionType, - PlatformID: pb.MsgData.SenderPlatformID, - MsgID: pb.MsgData.ClientMsgID, - } - if !isHistory { - mReq.IsOnlineOnly = true - } - // callback - canSend, err := callbackWordFilter(pb) - if err != nil { - log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackWordFilter failed", err.Error(), pb.MsgData) + callbackResp := callbackWordFilter(pb) + log.Info(pb.OperationID, "callbackWordFilter ", callbackResp) + if callbackResp.ErrCode != 0 { + log.Error(pb.OperationID, utils.GetSelfFuncName(), "callbackWordFilter resp: ", callbackResp) } - if !canSend { - log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackWordFilter result", canSend, "end rpc and return", pb.MsgData) - return returnMsg(&replay, pb, 201, "callbackWordFilter result stop rpc and return", "", 0) + log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackResp: ", callbackResp) + if callbackResp.ActionCode != constant.ActionAllow { + if callbackResp.ErrCode == 0 { + callbackResp.ErrCode = 201 + } + log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackWordFilter result", "end rpc and return", pb.MsgData) + return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0) } switch pb.MsgData.SessionType { case constant.SingleChatType: // callback - canSend, err := callbackBeforeSendSingleMsg(pb) - if err != nil { - log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg failed", err.Error()) + callbackResp := callbackBeforeSendSingleMsg(pb) + if callbackResp.ErrCode != 0 { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg resp: ", callbackResp) } - if !canSend { - log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg result", canSend, "end rpc and return") - return returnMsg(&replay, pb, 201, "callbackBeforeSendSingleMsg result stop rpc and return", "", 0) + if callbackResp.ActionCode != constant.ActionAllow { + if callbackResp.ErrCode == 0 { + callbackResp.ErrCode = 201 + } + log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg result", "end rpc and return", callbackResp) + return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0) } isSend := modifyMessageByUserMessageReceiveOpt(pb.MsgData.RecvID, pb.MsgData.SendID, constant.SingleChatType, pb) if isSend { @@ -195,7 +227,7 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S log.NewInfo(msgToMQSingle.OperationID, msgToMQSingle) err1 := rpc.sendMsgToKafka(&msgToMQSingle, msgToMQSingle.MsgData.RecvID, constant.OnlineStatus) if err1 != nil { - log.NewError(msgToMQSingle.OperationID, "kafka send msg err:RecvID", msgToMQSingle.MsgData.RecvID, msgToMQSingle.String()) + log.NewError(msgToMQSingle.OperationID, "kafka send msg err :RecvID", msgToMQSingle.MsgData.RecvID, msgToMQSingle.String(), err1.Error()) return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) } } @@ -207,22 +239,31 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S } } // callback - if err := callbackAfterSendSingleMsg(pb); err != nil { - log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendSingleMsg failed", err.Error()) + callbackResp = callbackAfterSendSingleMsg(pb) + if callbackResp.ErrCode != 0 { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendSingleMsg resp: ", callbackResp) } return returnMsg(&replay, pb, 0, "", msgToMQSingle.MsgData.ServerMsgID, msgToMQSingle.MsgData.SendTime) case constant.GroupChatType: // callback - canSend, err := callbackBeforeSendGroupMsg(pb) - if err != nil { - log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendGroupMsg failed", err.Error()) + callbackResp := callbackBeforeSendGroupMsg(pb) + if callbackResp.ErrCode != 0 { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendGroupMsg resp:", callbackResp) } - if !canSend { - log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendGroupMsg result", canSend, "end rpc and return") - return returnMsg(&replay, pb, 201, "callbackBeforeSendGroupMsg result stop rpc and return", "", 0) + if callbackResp.ActionCode != constant.ActionAllow { + if callbackResp.ErrCode == 0 { + callbackResp.ErrCode = 201 + } + log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg result", "end rpc and return", callbackResp) + return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0) } getGroupMemberIDListFromCacheReq := &pbCache.GetGroupMemberIDListFromCacheReq{OperationID: pb.OperationID, GroupID: pb.MsgData.GroupID} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, msgToMQSingle.OperationID) + if etcdConn == nil { + errMsg := msgToMQSingle.OperationID + "getcdv3.GetConn == nil" + log.NewError(msgToMQSingle.OperationID, errMsg) + return returnMsg(&replay, pb, 201, errMsg, "", 0) + } client := pbCache.NewCacheClient(etcdConn) cacheResp, err := client.GetGroupMemberIDListFromCache(context.Background(), getGroupMemberIDListFromCacheReq) if err != nil { @@ -234,7 +275,7 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S return returnMsg(&replay, pb, 201, "GetGroupMemberIDListFromCache logic failed", "", 0) } memberUserIDList := cacheResp.UserIDList - log.Debug(pb.OperationID, "GetGroupAllMember userID list", cacheResp.UserIDList) + log.Debug(pb.OperationID, "GetGroupAllMember userID list", cacheResp.UserIDList, "len: ", len(cacheResp.UserIDList)) var addUidList []string switch pb.MsgData.ContentType { case constant.MemberKickedNotification: @@ -257,37 +298,50 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S default: } - m := make(map[string][]string, 2) - if len(memberUserIDList) > GroupMemberNum { - getOnlineAndOfflineUserIDList(memberUserIDList, m, pb.OperationID) - log.Debug(pb.OperationID, m[constant.OnlineStatus], m[constant.OfflineStatus]) - } else { - m[constant.OnlineStatus] = memberUserIDList + if len(addUidList) > 0 { + memberUserIDList = append(memberUserIDList, addUidList...) } + if !token_verify.IsManagerUserID(pb.MsgData.SendID) { + if !utils.IsContain(pb.MsgData.SendID, memberUserIDList) { + return returnMsg(&replay, pb, 202, "you are not in group", "", 0) + } + } + m := make(map[string][]string, 2) + m[constant.OnlineStatus] = memberUserIDList + log.Debug(pb.OperationID, "send msg cost time1 ", db.GetCurrentTimestampByMill()-newTime, pb.MsgData.ClientMsgID) + newTime = db.GetCurrentTimestampByMill() //split parallel send var wg sync.WaitGroup var sendTag bool - var split = 50 + var split = 20 for k, v := range m { remain := len(v) % split for i := 0; i < len(v)/split; i++ { wg.Add(1) - go rpc.sendMsgToGroup(v[i*split:(i+1)*split], *pb, k, &sendTag, &wg) + tmp := valueCopy(pb) + // go rpc.sendMsgToGroup(v[i*split:(i+1)*split], *pb, k, &sendTag, &wg) + go rpc.sendMsgToGroupOptimization(v[i*split:(i+1)*split], tmp, k, &sendTag, &wg) } if remain > 0 { wg.Add(1) - go rpc.sendMsgToGroup(v[split*(len(v)/split):], *pb, k, &sendTag, &wg) + tmp := valueCopy(pb) + // go rpc.sendMsgToGroup(v[split*(len(v)/split):], *pb, k, &sendTag, &wg) + go rpc.sendMsgToGroupOptimization(v[split*(len(v)/split):], tmp, k, &sendTag, &wg) } } + log.Debug(pb.OperationID, "send msg cost time22 ", db.GetCurrentTimestampByMill()-newTime, pb.MsgData.ClientMsgID, "uidList : ", len(addUidList)) wg.Add(1) go rpc.sendMsgToGroup(addUidList, *pb, constant.OnlineStatus, &sendTag, &wg) wg.Wait() + newTime = db.GetCurrentTimestampByMill() // callback - if err := callbackAfterSendGroupMsg(pb); err != nil { - log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendGroupMsg failed", err.Error()) + callbackResp = callbackAfterSendGroupMsg(pb) + if callbackResp.ErrCode != 0 { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendGroupMsg resp: ", callbackResp) } if !sendTag { + log.NewWarn(pb.OperationID, "send tag is ", sendTag) return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) } else { if pb.MsgData.ContentType == constant.AtText { @@ -319,7 +373,12 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S conversationReq.UserIDList = pb.MsgData.AtUserIDList conversation.GroupAtType = constant.AtMe } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName, pb.OperationID) + if etcdConn == nil { + errMsg := pb.OperationID + "getcdv3.GetConn == nil" + log.NewError(pb.OperationID, errMsg) + return + } client := pbConversation.NewConversationClient(etcdConn) conversationReply, err := client.ModifyConversationField(context.Background(), &conversationReq) if err != nil { @@ -330,7 +389,12 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S if tag { conversationReq.UserIDList = utils.DifferenceString(atUserID, memberUserIDList) conversation.GroupAtType = constant.AtAll - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName, pb.OperationID) + if etcdConn == nil { + errMsg := pb.OperationID + "getcdv3.GetConn == nil" + log.NewError(pb.OperationID, errMsg) + return + } client := pbConversation.NewConversationClient(etcdConn) conversationReply, err := client.ModifyConversationField(context.Background(), &conversationReq) if err != nil { @@ -341,8 +405,8 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S } }() } + log.Debug(pb.OperationID, "send msg cost time3 ", db.GetCurrentTimestampByMill()-newTime, pb.MsgData.ClientMsgID) return returnMsg(&replay, pb, 0, "", msgToMQSingle.MsgData.ServerMsgID, msgToMQSingle.MsgData.SendTime) - } case constant.NotificationChatType: msgToMQSingle.MsgData = pb.MsgData @@ -360,22 +424,54 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) } } + + log.Debug(pb.OperationID, "send msg cost time ", db.GetCurrentTimestampByMill()-newTime, pb.MsgData.ClientMsgID) return returnMsg(&replay, pb, 0, "", msgToMQSingle.MsgData.ServerMsgID, msgToMQSingle.MsgData.SendTime) + case constant.SuperGroupChatType: + // callback + callbackResp := callbackBeforeSendGroupMsg(pb) + if callbackResp.ErrCode != 0 { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSuperGroupMsg resp: ", callbackResp) + } + if callbackResp.ActionCode != constant.ActionAllow { + if callbackResp.ErrCode == 0 { + callbackResp.ErrCode = 201 + } + log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSuperGroupMsg result", "end rpc and return", callbackResp) + return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0) + } + msgToMQSingle.MsgData = pb.MsgData + log.NewInfo(msgToMQSingle.OperationID, msgToMQSingle) + err1 := rpc.sendMsgToKafka(&msgToMQSingle, msgToMQSingle.MsgData.GroupID, constant.OnlineStatus) + if err1 != nil { + log.NewError(msgToMQSingle.OperationID, "kafka send msg err:RecvID", msgToMQSingle.MsgData.RecvID, msgToMQSingle.String()) + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } + + // callback + callbackResp = callbackAfterSendSingleMsg(pb) + if callbackResp.ErrCode != 0 { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendSuperGroupMsg resp: ", callbackResp) + } + return returnMsg(&replay, pb, 0, "", msgToMQSingle.MsgData.ServerMsgID, msgToMQSingle.MsgData.SendTime) + default: - return returnMsg(&replay, pb, 203, "unkonwn sessionType", "", 0) + return returnMsg(&replay, pb, 203, "unknown sessionType", "", 0) } } func (rpc *rpcChat) sendMsgToKafka(m *pbChat.MsgDataToMQ, key string, status string) error { switch status { case constant.OnlineStatus: - pid, offset, err := rpc.onlineProducer.SendMessage(m, key) + pid, offset, err := rpc.onlineProducer.SendMessage(m, key, m.OperationID) if err != nil { log.Error(m.OperationID, "kafka send failed", "send data", m.String(), "pid", pid, "offset", offset, "err", err.Error(), "key", key, status) + } else { + // log.NewWarn(m.OperationID, "sendMsgToKafka client msgID ", m.MsgData.ClientMsgID) } return err case constant.OfflineStatus: - pid, offset, err := rpc.offlineProducer.SendMessage(m, key) + pid, offset, err := rpc.onlineProducer.SendMessage(m, key, m.OperationID) if err != nil { log.Error(m.OperationID, "kafka send failed", "send data", m.String(), "pid", pid, "offset", offset, "err", err.Error(), "key", key, status) } @@ -398,13 +494,29 @@ func returnMsg(replay *pbChat.SendMsgResp, pb *pbChat.SendMsgReq, errCode int32, } func modifyMessageByUserMessageReceiveOpt(userID, sourceID string, sessionType int, pb *pbChat.SendMsgReq) bool { - conversationID := utils.GetConversationIDBySessionType(sourceID, sessionType) - opt, err := db.DB.GetSingleConversationRecvMsgOpt(userID, conversationID) - if err != nil && err != redis.ErrNil { - log.NewError(pb.OperationID, "GetSingleConversationMsgOpt from redis err", conversationID, pb.String(), err.Error()) - return true + opt, err := db.DB.GetUserGlobalMsgRecvOpt(userID) + if err != nil { + log.NewError(pb.OperationID, "GetUserGlobalMsgRecvOpt from redis err", userID, pb.String(), err.Error()) + } switch opt { + case constant.ReceiveMessage: + case constant.NotReceiveMessage: + return false + case constant.ReceiveNotNotifyMessage: + if pb.MsgData.Options == nil { + pb.MsgData.Options = make(map[string]bool, 10) + } + utils.SetSwitchFromOptions(pb.MsgData.Options, constant.IsOfflinePush, false) + return true + } + conversationID := utils.GetConversationIDBySessionType(sourceID, sessionType) + singleOpt, sErr := db.DB.GetSingleConversationRecvMsgOpt(userID, conversationID) + if sErr != nil && sErr != go_redis.Nil { + log.NewError(pb.OperationID, "GetSingleConversationMsgOpt from redis err", conversationID, pb.String(), sErr.Error()) + return true + } + switch singleOpt { case constant.ReceiveMessage: return true case constant.NotReceiveMessage: @@ -420,14 +532,39 @@ func modifyMessageByUserMessageReceiveOpt(userID, sourceID string, sessionType i return true } +func modifyMessageByUserMessageReceiveOptoptimization(userID, sourceID string, sessionType int, operationID string, options *map[string]bool) bool { + conversationID := utils.GetConversationIDBySessionType(sourceID, sessionType) + opt, err := db.DB.GetSingleConversationRecvMsgOpt(userID, conversationID) + if err != nil && err != go_redis.Nil { + log.NewError(operationID, "GetSingleConversationMsgOpt from redis err", userID, conversationID, err.Error()) + return true + } + + switch opt { + case constant.ReceiveMessage: + return true + case constant.NotReceiveMessage: + return false + case constant.ReceiveNotNotifyMessage: + if *options == nil { + *options = make(map[string]bool, 10) + } + utils.SetSwitchFromOptions(*options, constant.IsOfflinePush, false) + return true + } + return true +} + type NotificationMsg struct { - SendID string - RecvID string - Content []byte // open_im_sdk.TipsComm - MsgFrom int32 - ContentType int32 - SessionType int32 - OperationID string + SendID string + RecvID string + Content []byte // open_im_sdk.TipsComm + MsgFrom int32 + ContentType int32 + SessionType int32 + OperationID string + SenderNickname string + SenderFaceURL string } func Notification(n *NotificationMsg) { @@ -447,8 +584,10 @@ func Notification(n *NotificationMsg) { msg.CreateTime = utils.GetCurrentTimestampByMill() msg.ClientMsgID = utils.GetMsgID(n.SendID) msg.Options = make(map[string]bool, 7) + msg.SenderNickname = n.SenderNickname + msg.SenderFaceURL = n.SenderFaceURL switch n.SessionType { - case constant.GroupChatType: + case constant.GroupChatType, constant.SuperGroupChatType: msg.RecvID = "" msg.GroupID = n.RecvID } @@ -667,6 +806,10 @@ func Notification(n *NotificationMsg) { ex = config.Config.Notification.ConversationSetPrivate.OfflinePush.Ext reliabilityLevel = config.Config.Notification.ConversationSetPrivate.Conversation.ReliabilityLevel unReadCount = config.Config.Notification.ConversationSetPrivate.Conversation.UnreadCount + case constant.DeleteMessageNotification: + reliabilityLevel = constant.ReliableNotificationNoMsg + case constant.SuperGroupUpdateNotification: + reliabilityLevel = constant.UnreliableNotification } switch reliabilityLevel { case constant.UnreliableNotification: @@ -687,7 +830,13 @@ func Notification(n *NotificationMsg) { offlineInfo.Ex = ex msg.OfflinePushInfo = &offlineInfo req.MsgData = &msg - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return + } + client := pbChat.NewChatClient(etcdConn) reply, err := client.SendMsg(context.Background(), &req) if err != nil { @@ -737,6 +886,23 @@ func getOnlineAndOfflineUserIDList(memberList []string, m map[string][]string, o m[constant.OfflineStatus] = offlUserIDList } +func valueCopy(pb *pbChat.SendMsgReq) *pbChat.SendMsgReq { + offlinePushInfo := sdk_ws.OfflinePushInfo{} + if pb.MsgData.OfflinePushInfo != nil { + offlinePushInfo = *pb.MsgData.OfflinePushInfo + } + msgData := sdk_ws.MsgData{} + msgData = *pb.MsgData + msgData.OfflinePushInfo = &offlinePushInfo + + options := make(map[string]bool, 10) + for key, value := range pb.MsgData.Options { + options[key] = value + } + msgData.Options = options + return &pbChat.SendMsgReq{Token: pb.Token, OperationID: pb.OperationID, MsgData: &msgData} +} + func (rpc *rpcChat) sendMsgToGroup(list []string, pb pbChat.SendMsgReq, status string, sendTag *bool, wg *sync.WaitGroup) { // log.Debug(pb.OperationID, "split userID ", list) offlinePushInfo := sdk_ws.OfflinePushInfo{} @@ -772,3 +938,26 @@ func (rpc *rpcChat) sendMsgToGroup(list []string, pb pbChat.SendMsgReq, status s } wg.Done() } + +func (rpc *rpcChat) sendMsgToGroupOptimization(list []string, groupPB *pbChat.SendMsgReq, status string, sendTag *bool, wg *sync.WaitGroup) { + msgToMQGroup := pbChat.MsgDataToMQ{Token: groupPB.Token, OperationID: groupPB.OperationID, MsgData: groupPB.MsgData} + for _, v := range list { + groupPB.MsgData.RecvID = v + isSend := modifyMessageByUserMessageReceiveOpt(v, groupPB.MsgData.GroupID, constant.GroupChatType, groupPB) + if isSend { + if v == "" || groupPB.MsgData.SendID == "" { + log.Error(msgToMQGroup.OperationID, "sendMsgToGroupOptimization userID nil ", msgToMQGroup.String()) + continue + } + err := rpc.sendMsgToKafka(&msgToMQGroup, v, status) + if err != nil { + log.NewError(msgToMQGroup.OperationID, "kafka send msg err:UserId", v, msgToMQGroup.String()) + } else { + *sendTag = true + } + } else { + log.Debug(groupPB.OperationID, "not sendMsgToKafka, ", v) + } + } + wg.Done() +} diff --git a/internal/rpc/msg/super_group_notification.go b/internal/rpc/msg/super_group_notification.go new file mode 100644 index 000000000..9369c7910 --- /dev/null +++ b/internal/rpc/msg/super_group_notification.go @@ -0,0 +1,37 @@ +package msg + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + //sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + //"github.com/golang/protobuf/jsonpb" + //"github.com/golang/protobuf/proto" +) + +func SuperGroupNotification(operationID, sendID, recvID string) { + + //var tips sdk.TipsComm + //var err error + //marshaler := jsonpb.Marshaler{ + // OrigName: true, + // EnumsAsInts: false, + // EmitDefaults: false, + //} + //tips.JsonDetail, _ = marshaler.MarshalToString(m) + n := &NotificationMsg{ + SendID: sendID, + RecvID: recvID, + MsgFrom: constant.SysMsgType, + ContentType: constant.SuperGroupUpdateNotification, + SessionType: constant.SingleChatType, + OperationID: operationID, + } + //n.Content, err = proto.Marshal(&tips) + //if err != nil { + // log.NewError(operationID, utils.GetSelfFuncName(), "proto.Marshal failed") + // return + //} + log.NewInfo(operationID, utils.GetSelfFuncName(), string(n.Content)) + Notification(n) +} diff --git a/internal/rpc/msg/tag_send_msg.go b/internal/rpc/msg/tag_send_msg.go index 195640498..7354961db 100644 --- a/internal/rpc/msg/tag_send_msg.go +++ b/internal/rpc/msg/tag_send_msg.go @@ -27,12 +27,19 @@ func TagSendMessage(operationID string, user *db.User, recvID, content string, s msgData.SenderNickname = user.Nickname msgData.Options = map[string]bool{} msgData.Options[constant.IsSenderConversationUpdate] = false + msgData.Options[constant.IsSenderNotificationPush] = false msgData.CreateTime = utils.GetCurrentTimestampByMill() msgData.ClientMsgID = utils.GetMsgID(user.UserID) msgData.SenderPlatformID = senderPlatformID req.MsgData = &msgData req.OperationID = operationID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, operationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return + } + client := pbChat.NewChatClient(etcdConn) respPb, err := client.SendMsg(context.Background(), &req) if err != nil { diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index 1e76fa2b6..ace207322 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -14,12 +14,14 @@ import ( pbCommon "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" - "google.golang.org/grpc" "net" "strconv" "strings" "sync" "time" + "unsafe" + + "google.golang.org/grpc" ) type officeServer struct { @@ -27,15 +29,18 @@ type officeServer struct { rpcRegisterName string etcdSchema string etcdAddr []string + ch chan tagSendStruct } func NewOfficeServer(port int) *officeServer { log.NewPrivateLog(constant.LogFileName) + ch := make(chan tagSendStruct, 100000) return &officeServer{ rpcPort: port, rpcRegisterName: config.Config.RpcRegisterName.OpenImOfficeName, etcdSchema: config.Config.Etcd.EtcdSchema, etcdAddr: config.Config.Etcd.EtcdAddr, + ch: ch, } } @@ -56,23 +61,30 @@ func (s *officeServer) Run() { log.NewInfo("0", "listen network success, ", address, listener) defer listener.Close() //grpc server - srv := grpc.NewServer() + recvSize := 1024 * 1024 * 30 + sendSize := 1024 * 1024 * 30 + var options = []grpc.ServerOption{ + grpc.MaxRecvMsgSize(recvSize), + grpc.MaxSendMsgSize(sendSize), + } + srv := grpc.NewServer(options...) defer srv.GracefulStop() //Service registers with etcd pbOffice.RegisterOfficeServiceServer(srv, s) - rpcRegisterIP := "" + rpcRegisterIP := config.Config.RpcRegisterIP if config.Config.RpcRegisterIP == "" { rpcRegisterIP, err = utils.GetLocalIP() if err != nil { log.Error("", "GetLocalIP failed ", err.Error()) } } - + log.NewInfo("", "rpcRegisterIP", rpcRegisterIP) err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) if err != nil { log.NewError("0", "RegisterEtcd failed ", err.Error()) return } + go s.sendTagMsgRoutine() err = srv.Serve(listener) if err != nil { log.NewError("0", "Serve failed ", err.Error()) @@ -81,6 +93,25 @@ func (s *officeServer) Run() { log.NewInfo("0", "message cms rpc success") } +type tagSendStruct struct { + operationID string + user *db.User + userID string + content string + senderPlatformID int32 +} + +func (s *officeServer) sendTagMsgRoutine() { + log.NewInfo("", utils.GetSelfFuncName(), "start") + for { + select { + case v := <-s.ch: + msg.TagSendMessage(v.operationID, v.user, v.userID, v.content, v.senderPlatformID) + time.Sleep(time.Millisecond * 100) + } + } +} + func (s *officeServer) GetUserTags(_ context.Context, req *pbOffice.GetUserTagsReq) (resp *pbOffice.GetUserTagsResp, err error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req ", req.String()) resp = &pbOffice.GetUserTagsResp{ @@ -174,7 +205,15 @@ func (s *officeServer) SendMsg2Tag(_ context.Context, req *pbOffice.SendMsg2TagR } var groupUserIDList []string for _, groupID := range req.GroupList { - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + resp.CommonResp.ErrCode = constant.ErrInternal.ErrCode + resp.CommonResp.ErrMsg = errMsg + return resp, nil + } + cacheClient := pbCache.NewCacheClient(etcdConn) req := pbCache.GetGroupMemberIDListFromCacheReq{ OperationID: req.OperationID, @@ -207,6 +246,12 @@ func (s *officeServer) SendMsg2Tag(_ context.Context, req *pbOffice.SendMsg2TagR userIDList = append(userIDList[:i], userIDList[i+1:]...) } } + if unsafe.Sizeof(userIDList) > 1024*1024 { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "size", unsafe.Sizeof(userIDList)) + resp.CommonResp.ErrMsg = constant.ErrSendLimit.ErrMsg + resp.CommonResp.ErrCode = constant.ErrSendLimit.ErrCode + return + } log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "total userIDList result: ", userIDList) user, err := imdb.GetUserByUserID(req.SendID) if err != nil { @@ -215,30 +260,46 @@ func (s *officeServer) SendMsg2Tag(_ context.Context, req *pbOffice.SendMsg2TagR resp.CommonResp.ErrCode = constant.ErrDB.ErrCode return resp, nil } - var wg sync.WaitGroup - wg.Add(len(userIDList)) + var successUserIDList []string for _, userID := range userIDList { - go func(userID string) { - defer wg.Done() - msg.TagSendMessage(req.OperationID, user, userID, req.Content, req.SenderPlatformID) - }(userID) + t := tagSendStruct{ + operationID: req.OperationID, + user: user, + userID: userID, + content: req.Content, + senderPlatformID: req.SenderPlatformID, + } + select { + case s.ch <- t: + log.NewDebug(t.operationID, utils.GetSelfFuncName(), "msg: ", t, "send success") + successUserIDList = append(successUserIDList, userID) + // if channel is full, return grpc req + case <-time.After(1 * time.Second): + log.NewError(t.operationID, utils.GetSelfFuncName(), s.ch, "channel is full") + resp.CommonResp.ErrCode = constant.ErrSendLimit.ErrCode + resp.CommonResp.ErrMsg = constant.ErrSendLimit.ErrMsg + return resp, nil + } } - wg.Wait() - var tagSendLogs db.TagSendLog - wg.Add(len(userIDList)) - for _, userID := range userIDList { + var tagSendLogs db.TagSendLog + var wg sync.WaitGroup + wg.Add(len(successUserIDList)) + var lock sync.Mutex + for _, userID := range successUserIDList { go func(userID string) { defer wg.Done() userName, err := im_mysql_model.GetUserNameByUserID(userID) if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserNameByUserID failed", err.Error()) + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserNameByUserID failed", err.Error(), userID) return } + lock.Lock() tagSendLogs.UserList = append(tagSendLogs.UserList, db.TagUser{ UserID: userID, UserName: userName, }) + lock.Unlock() }(userID) } wg.Wait() @@ -548,9 +609,18 @@ func (s *officeServer) GetWorkMomentByID(_ context.Context, req *pbOffice.GetWor if !canSee { log.NewError(req.OperationID, utils.GetSelfFuncName(), "workMoments not access to user", canSee, workMoment, req.OpUserID) } + if err := utils.CopyStructFields(resp.WorkMoment, workMoment); err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields", err.Error()) } + user, err := imdb.GetUserByUserID(workMoment.UserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserByUserID failed", err.Error()) + } + if user != nil { + resp.WorkMoment.FaceURL = user.FaceURL + resp.WorkMoment.UserName = user.Nickname + } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) return resp, nil } @@ -573,6 +643,16 @@ func (s *officeServer) GetUserWorkMoments(_ context.Context, req *pbOffice.GetUs if err := utils.CopyStructFields(&resp.WorkMoments, workMoments); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } + for _, v := range resp.WorkMoments { + user, err := imdb.GetUserByUserID(v.UserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + } + if user != nil { + v.UserName = user.Nickname + v.FaceURL = user.FaceURL + } + } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) return resp, nil } @@ -590,6 +670,16 @@ func (s *officeServer) GetUserFriendWorkMoments(_ context.Context, req *pbOffice if err := utils.CopyStructFields(&resp.WorkMoments, workMoments); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } + for _, v := range resp.WorkMoments { + user, err := imdb.GetUserByUserID(v.UserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + } + if user != nil { + v.UserName = user.Nickname + v.FaceURL = user.FaceURL + } + } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) return resp, nil } diff --git a/internal/rpc/organization/organization.go b/internal/rpc/organization/organization.go index 35a67b04c..db423caa0 100644 --- a/internal/rpc/organization/organization.go +++ b/internal/rpc/organization/organization.go @@ -9,17 +9,18 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" - "Open_IM/pkg/proto/auth" + pbAuth "Open_IM/pkg/proto/auth" groupRpc "Open_IM/pkg/proto/group" rpc "Open_IM/pkg/proto/organization" open_im_sdk "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" - "google.golang.org/grpc" "net" "strconv" "strings" "time" + + "google.golang.org/grpc" ) type organizationServer struct { @@ -60,13 +61,14 @@ func (s *organizationServer) Run() { defer srv.GracefulStop() //Service registers with etcd rpc.RegisterOrganizationServer(srv, s) - rpcRegisterIP := "" + rpcRegisterIP := config.Config.RpcRegisterIP if config.Config.RpcRegisterIP == "" { rpcRegisterIP, err = utils.GetLocalIP() if err != nil { log.Error("", "GetLocalIP failed ", err.Error()) } } + log.NewInfo("", "rpcRegisterIP", rpcRegisterIP) err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) if err != nil { log.NewError("", "RegisterEtcd failed ", err.Error()) @@ -100,7 +102,7 @@ func (s *organizationServer) CreateDepartment(ctx context.Context, req *rpc.Crea log.Error(req.OperationID, errMsg) return &rpc.CreateDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil } - err, createdDepartment := imdb.GetDepartment(department.DepartmentID) + createdDepartment, err := imdb.GetDepartment(department.DepartmentID) if err != nil { errMsg := req.OperationID + " " + "GetDepartment failed " + err.Error() + department.DepartmentID log.Error(req.OperationID, errMsg) @@ -112,19 +114,29 @@ func (s *organizationServer) CreateDepartment(ctx context.Context, req *rpc.Crea log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) chat.OrganizationNotificationToAll(req.OpUserID, req.OperationID) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + resp.ErrCode = constant.ErrInternal.ErrCode + resp.ErrMsg = errMsg + return resp, nil + } client := groupRpc.NewGroupClient(etcdConn) createGroupReq := &groupRpc.CreateGroupReq{ - InitMemberList: nil, + InitMemberList: []*groupRpc.GroupAddMemberInfo{}, GroupInfo: &open_im_sdk.GroupInfo{ + Introduction: req.DepartmentInfo.Name, GroupName: req.DepartmentInfo.Name, FaceURL: req.DepartmentInfo.FaceURL, CreateTime: uint32(time.Now().Unix()), CreatorUserID: req.OpUserID, - GroupType: constant.DepartmentGroup, + GroupType: constant.NormalGroup, + OwnerUserID: req.OpUserID, }, OperationID: req.OperationID, OpUserID: req.OpUserID, + OwnerUserID: req.OpUserID, } createGroupResp, err := client.CreateGroup(context.Background(), createGroupReq) if err != nil { @@ -139,6 +151,9 @@ func (s *organizationServer) CreateDepartment(ctx context.Context, req *rpc.Crea resp.ErrMsg = constant.ErrDB.ErrMsg + " createGroup failed " + createGroupResp.ErrMsg return resp, nil } + if err := imdb.SetDepartmentRelatedGroupID(createGroupResp.GroupInfo.GroupID, department.DepartmentID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetDepartmentRelatedGroupID failed", err.Error()) + } return resp, nil } @@ -152,7 +167,6 @@ func (s *organizationServer) UpdateDepartment(ctx context.Context, req *rpc.Upda department := db.Department{} utils.CopyStructFields(&department, req.DepartmentInfo) - log.Debug(req.OperationID, "dst ", department, "src ", req.DepartmentInfo) if err := imdb.UpdateDepartment(&department, nil); err != nil { errMsg := req.OperationID + " " + "UpdateDepartment failed " + err.Error() @@ -220,21 +234,26 @@ func (s *organizationServer) CreateOrganizationUser(ctx context.Context, req *rp authReq := &pbAuth.UserRegisterReq{UserInfo: &open_im_sdk.UserInfo{}} utils.CopyStructFields(authReq.UserInfo, req.OrganizationUser) authReq.OperationID = req.OperationID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) - client := pbAuth.NewAuthClient(etcdConn) - - reply, err := client.UserRegister(context.Background(), authReq) - if err != nil { - errMsg := "UserRegister failed " + err.Error() - log.NewError(req.OperationID, errMsg) - return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + if req.IsRegister { + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}, nil + } + client := pbAuth.NewAuthClient(etcdConn) + reply, err := client.UserRegister(context.Background(), authReq) + if err != nil { + errMsg := "UserRegister failed " + err.Error() + log.NewError(req.OperationID, errMsg) + return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + if reply.CommonResp.ErrCode != 0 { + errMsg := "UserRegister failed " + reply.CommonResp.ErrMsg + log.NewError(req.OperationID, errMsg) + return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } } - if reply.CommonResp.ErrCode != 0 { - errMsg := "UserRegister failed " + reply.CommonResp.ErrMsg - log.NewError(req.OperationID, errMsg) - return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) if !token_verify.IsManagerUserID(req.OpUserID) { errMsg := req.OperationID + " " + req.OpUserID + " is not app manager" @@ -245,7 +264,7 @@ func (s *organizationServer) CreateOrganizationUser(ctx context.Context, req *rp utils.CopyStructFields(&organizationUser, req.OrganizationUser) organizationUser.Birth = utils.UnixSecondToTime(int64(req.OrganizationUser.Birth)) log.Debug(req.OperationID, "src ", *req.OrganizationUser, "dst ", organizationUser) - err = imdb.CreateOrganizationUser(&organizationUser) + err := imdb.CreateOrganizationUser(&organizationUser) if err != nil { errMsg := req.OperationID + " " + "CreateOrganizationUser failed " + err.Error() log.Error(req.OperationID, errMsg, organizationUser) @@ -262,7 +281,12 @@ func (s *organizationServer) UpdateOrganizationUser(ctx context.Context, req *rp authReq := &pbAuth.UserRegisterReq{UserInfo: &open_im_sdk.UserInfo{}} utils.CopyStructFields(authReq.UserInfo, req.OrganizationUser) authReq.OperationID = req.OperationID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &rpc.UpdateOrganizationUserResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}, nil + } client := pbAuth.NewAuthClient(etcdConn) reply, err := client.UserRegister(context.Background(), authReq) @@ -339,12 +363,14 @@ func (s *organizationServer) CreateDepartmentMember(ctx context.Context, req *rp func (s *organizationServer) GetDepartmentParentIDList(_ context.Context, req *rpc.GetDepartmentParentIDListReq) (resp *rpc.GetDepartmentParentIDListResp, err error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req.String()) resp = &rpc.GetDepartmentParentIDListResp{} - resp.ParentIDList, err = imdb.GetDepartmentParentIDList(req.DepartmentID) + parentIDList, err := imdb.GetDepartmentParentIDList(req.DepartmentID) if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetDepartmentParentIDList failed", err.Error()) resp.ErrMsg = constant.ErrDB.ErrMsg + ": " + err.Error() resp.ErrCode = constant.ErrDB.ErrCode return resp, nil } + resp.ParentIDList = parentIDList log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp:", resp.String()) return resp, nil } diff --git a/internal/rpc/statistics/statistics.go b/internal/rpc/statistics/statistics.go index b1811cb48..920fc9d73 100644 --- a/internal/rpc/statistics/statistics.go +++ b/internal/rpc/statistics/statistics.go @@ -67,7 +67,7 @@ func (s *statisticsServer) Run() { defer srv.GracefulStop() //Service registers with etcd pbStatistics.RegisterUserServer(srv, s) - rpcRegisterIP := "" + rpcRegisterIP := config.Config.RpcRegisterIP if config.Config.RpcRegisterIP == "" { rpcRegisterIP, err = utils.GetLocalIP() if err != nil { diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go index 90f983a05..c774a9c6e 100644 --- a/internal/rpc/user/user.go +++ b/internal/rpc/user/user.go @@ -7,7 +7,6 @@ import ( "Open_IM/pkg/common/db" imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" errors "Open_IM/pkg/common/http" - "Open_IM/pkg/common/log" "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" @@ -63,7 +62,7 @@ func (s *userServer) Run() { defer srv.GracefulStop() //Service registers with etcd pbUser.RegisterUserServer(srv, s) - rpcRegisterIP := "" + rpcRegisterIP := config.Config.RpcRegisterIP if config.Config.RpcRegisterIP == "" { rpcRegisterIP, err = utils.GetLocalIP() if err != nil { @@ -285,7 +284,7 @@ func (s *userServer) SetRecvMsgOpt(ctx context.Context, req *pbUser.SetRecvMsgOp stringList := strings.Split(req.ConversationID, "_") if len(stringList) > 1 { switch stringList[0] { - case "single_": + case "single": conversation.UserID = stringList[1] conversation.ConversationType = constant.SingleChatType case "group": @@ -384,12 +383,19 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserI if req.UserInfo.Birth != 0 { user.Birth = utils.UnixSecondToTime(int64(req.UserInfo.Birth)) } + err := imdb.UpdateUserInfo(user) if err != nil { log.NewError(req.OperationID, "UpdateUserInfo failed ", err.Error(), user) return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } + client := pbFriend.NewFriendClient(etcdConn) newReq := &pbFriend.GetFriendListReq{ CommID: &pbFriend.CommID{OperationID: req.OperationID, FromUserID: req.UserInfo.UserID, OpUserID: req.OpUserID}, @@ -410,10 +416,45 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserI if req.UserInfo.FaceURL != "" { go s.SyncJoinedGroupMemberFaceURL(req.UserInfo.UserID, req.UserInfo.FaceURL, req.OperationID, req.OpUserID) } - + //updateUserInfoToCacheReq := &cache.UpdateUserInfoToCacheReq{ + // OperationID: req.OperationID, + // UserInfoList: []*sdkws.UserInfo{req.UserInfo}, + //} + //cacheEtcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + //cacheClient := cache.NewCacheClient(cacheEtcdConn) + //resp, err := cacheClient.UpdateUserInfoToCache(context.Background(), updateUserInfoToCacheReq) + //if err != nil { + // log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), updateUserInfoToCacheReq.String()) + // return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrServer.ErrCode, ErrMsg: err.Error()}}, nil + //} + //if resp.CommonResp.ErrCode != 0 { + // log.NewError(req.OperationID, utils.GetSelfFuncName(), resp.String()) + // return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrServer.ErrCode, ErrMsg: resp.CommonResp.ErrMsg}}, nil + //} return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{}}, nil } +func (s *userServer) SetGlobalRecvMessageOpt(ctx context.Context, req *pbUser.SetGlobalRecvMessageOptReq) (*pbUser.SetGlobalRecvMessageOptResp, error) { + log.NewInfo(req.OperationID, "SetGlobalRecvMessageOpt args ", req.String()) + var user db.User + user.UserID = req.UserID + m := make(map[string]interface{}, 1) + + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), req.GlobalRecvMsgOpt, "set GlobalRecvMsgOpt") + m["global_recv_msg_opt"] = req.GlobalRecvMsgOpt + err := db.DB.SetUserGlobalMsgRecvOpt(user.UserID, req.GlobalRecvMsgOpt) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetGlobalRecvMessageOpt failed ", err.Error(), user) + return &pbUser.SetGlobalRecvMessageOptResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + err = imdb.UpdateUserInfoByMap(user, m) + if err != nil { + log.NewError(req.OperationID, "SetGlobalRecvMessageOpt failed ", err.Error(), user) + return &pbUser.SetGlobalRecvMessageOptResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + chat.UserInfoUpdatedNotification(req.OperationID, req.UserID, req.UserID) + return &pbUser.SetGlobalRecvMessageOptResp{CommonResp: &pbUser.CommonResp{}}, nil +} func (s *userServer) SyncJoinedGroupMemberFaceURL(userID string, faceURL string, operationID string, opUserID string) { joinedGroupIDList, err := imdb.GetJoinedGroupIDListByUserID(userID) if err != nil { diff --git a/internal/utils/jwt_token_test.go b/internal/utils/jwt_token_test.go index da53a2a36..fe7a6b320 100644 --- a/internal/utils/jwt_token_test.go +++ b/internal/utils/jwt_token_test.go @@ -38,7 +38,7 @@ func Test_CreateToken(t *testing.T) { platform := int32(1) now := time.Now().Unix() - tokenString, expiresAt, err := token_verify.CreateToken(uid, platform) + tokenString, expiresAt, err := token_verify.CreateToken(uid, int(platform)) assert.NotEmpty(t, tokenString) assert.Equal(t, expiresAt, 604800+now) @@ -48,7 +48,7 @@ func Test_CreateToken(t *testing.T) { func Test_VerifyToken(t *testing.T) { uid := "1" platform := int32(1) - tokenString, _, _ := token_verify.CreateToken(uid, platform) + tokenString, _, _ := token_verify.CreateToken(uid, int(platform)) result, _ := token_verify.VerifyToken(tokenString, uid) assert.True(t, result) result, _ = token_verify.VerifyToken(tokenString, "2") @@ -58,7 +58,7 @@ func Test_VerifyToken(t *testing.T) { func Test_ParseRedisInterfaceToken(t *testing.T) { uid := "1" platform := int32(1) - tokenString, _, _ := token_verify.CreateToken(uid, platform) + tokenString, _, _ := token_verify.CreateToken(uid, int(platform)) claims, err := token_verify.ParseRedisInterfaceToken([]uint8(tokenString)) assert.Nil(t, err) @@ -66,7 +66,7 @@ func Test_ParseRedisInterfaceToken(t *testing.T) { // timeout config.Config.TokenPolicy.AccessExpire = -80 - tokenString, _, _ = token_verify.CreateToken(uid, platform) + tokenString, _, _ = token_verify.CreateToken(uid, int(platform)) claims, err = token_verify.ParseRedisInterfaceToken([]uint8(tokenString)) assert.Equal(t, err, constant.ExpiredToken) assert.Nil(t, claims) @@ -75,7 +75,7 @@ func Test_ParseRedisInterfaceToken(t *testing.T) { func Test_ParseToken(t *testing.T) { uid := "1" platform := int32(1) - tokenString, _, _ := token_verify.CreateToken(uid, platform) + tokenString, _, _ := token_verify.CreateToken(uid, int(platform)) claims, err := token_verify.ParseToken(tokenString, "") if err == nil { assert.Equal(t, claims.UID, uid) diff --git a/pkg/base_info/auth_api_struct.go b/pkg/base_info/auth_api_struct.go index 431a00c2c..3b2fb2b13 100644 --- a/pkg/base_info/auth_api_struct.go +++ b/pkg/base_info/auth_api_struct.go @@ -38,6 +38,16 @@ type UserTokenResp struct { UserToken UserTokenInfo `json:"data"` } +type ForceLogoutReq struct { + Platform int32 `json:"platform" binding:"required,min=1,max=8"` + FromUserID string `json:"fromUserID" binding:"required,min=1,max=64"` + OperationID string `json:"operationID" binding:"required"` +} + +type ForceLogoutResp struct { + CommResp +} + type ParseTokenReq struct { OperationID string `json:"operationID" binding:"required"` } @@ -53,6 +63,6 @@ type ExpireTime struct { type ParseTokenResp struct { CommResp - Data map[string]interface{} `json:"data"` + Data map[string]interface{} `json:"data" swaggerignore:"true"` ExpireTime ExpireTime `json:"-"` } diff --git a/pkg/base_info/friend_api_struct.go b/pkg/base_info/friend_api_struct.go index 3c45c393e..e15bed380 100644 --- a/pkg/base_info/friend_api_struct.go +++ b/pkg/base_info/friend_api_struct.go @@ -60,7 +60,7 @@ type GetBlackListReq struct { type GetBlackListResp struct { CommResp BlackUserInfoList []*open_im_sdk.PublicUserInfo `json:"-"` - Data []map[string]interface{} `json:"data"` + Data []map[string]interface{} `json:"data" swaggerignore:"true"` } //type PublicUserInfo struct { @@ -102,7 +102,7 @@ type GetFriendsInfoReq struct { type GetFriendsInfoResp struct { CommResp FriendInfoList []*open_im_sdk.FriendInfo `json:"-"` - Data []map[string]interface{} `json:"data"` + Data []map[string]interface{} `json:"data" swaggerignore:"true"` } type GetFriendListReq struct { @@ -112,7 +112,7 @@ type GetFriendListReq struct { type GetFriendListResp struct { CommResp FriendInfoList []*open_im_sdk.FriendInfo `json:"-"` - Data []map[string]interface{} `json:"data"` + Data []map[string]interface{} `json:"data" swaggerignore:"true"` } type GetFriendApplyListReq struct { @@ -122,7 +122,7 @@ type GetFriendApplyListReq struct { type GetFriendApplyListResp struct { CommResp FriendRequestList []*open_im_sdk.FriendRequest `json:"-"` - Data []map[string]interface{} `json:"data"` + Data []map[string]interface{} `json:"data" swaggerignore:"true"` } type GetSelfApplyListReq struct { @@ -132,5 +132,5 @@ type GetSelfApplyListReq struct { type GetSelfApplyListResp struct { CommResp FriendRequestList []*open_im_sdk.FriendRequest `json:"-"` - Data []map[string]interface{} `json:"data"` + Data []map[string]interface{} `json:"data" swaggerignore:"true"` } diff --git a/pkg/base_info/group_api_struct.go b/pkg/base_info/group_api_struct.go index 169cb0b6e..dac6328ee 100644 --- a/pkg/base_info/group_api_struct.go +++ b/pkg/base_info/group_api_struct.go @@ -33,7 +33,7 @@ type GetGroupMembersInfoReq struct { type GetGroupMembersInfoResp struct { CommResp MemberList []*open_im_sdk.GroupMemberFullInfo `json:"-"` - Data []map[string]interface{} `json:"data"` + Data []map[string]interface{} `json:"data" swaggerignore:"true"` } type InviteUserToGroupReq struct { @@ -54,7 +54,7 @@ type GetJoinedGroupListReq struct { type GetJoinedGroupListResp struct { CommResp GroupInfoList []*open_im_sdk.GroupInfo `json:"-"` - Data []map[string]interface{} `json:"data"` + Data []map[string]interface{} `json:"data" swaggerignore:"true"` } type GetGroupMemberListReq struct { @@ -67,7 +67,7 @@ type GetGroupMemberListResp struct { CommResp NextSeq int32 `json:"nextSeq"` MemberList []*open_im_sdk.GroupMemberFullInfo `json:"-"` - Data []map[string]interface{} `json:"data"` + Data []map[string]interface{} `json:"data" swaggerignore:"true"` } type GetGroupAllMemberReq struct { @@ -77,7 +77,7 @@ type GetGroupAllMemberReq struct { type GetGroupAllMemberResp struct { CommResp MemberList []*open_im_sdk.GroupMemberFullInfo `json:"-"` - Data []map[string]interface{} `json:"data"` + Data []map[string]interface{} `json:"data" swaggerignore:"true"` } type CreateGroupReq struct { @@ -95,7 +95,7 @@ type CreateGroupReq struct { type CreateGroupResp struct { CommResp GroupInfo open_im_sdk.GroupInfo `json:"-"` - Data map[string]interface{} `json:"data"` + Data map[string]interface{} `json:"data" swaggerignore:"true"` } type GetGroupApplicationListReq struct { @@ -105,7 +105,7 @@ type GetGroupApplicationListReq struct { type GetGroupApplicationListResp struct { CommResp GroupRequestList []*open_im_sdk.GroupRequest `json:"-"` - Data []map[string]interface{} `json:"data"` + Data []map[string]interface{} `json:"data" swaggerignore:"true"` } type GetUserReqGroupApplicationListReq struct { @@ -125,9 +125,30 @@ type GetGroupInfoReq struct { type GetGroupInfoResp struct { CommResp GroupInfoList []*open_im_sdk.GroupInfo `json:"-"` - Data []map[string]interface{} `json:"data"` + Data []map[string]interface{} `json:"data" swaggerignore:"true"` } +//type GroupInfoAlias struct { +// open_im_sdk.GroupInfo +// NeedVerification int32 `protobuf:"bytes,13,opt,name=needVerification" json:"needVerification,omitempty"` +//} + +//type GroupInfoAlias struct { +// GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` +// GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"` +// Notification string `protobuf:"bytes,3,opt,name=notification" json:"notification,omitempty"` +// Introduction string `protobuf:"bytes,4,opt,name=introduction" json:"introduction,omitempty"` +// FaceURL string `protobuf:"bytes,5,opt,name=faceURL" json:"faceURL,omitempty"` +// OwnerUserID string `protobuf:"bytes,6,opt,name=ownerUserID" json:"ownerUserID,omitempty"` +// CreateTime uint32 `protobuf:"varint,7,opt,name=createTime" json:"createTime,omitempty"` +// MemberCount uint32 `protobuf:"varint,8,opt,name=memberCount" json:"memberCount,omitempty"` +// Ex string `protobuf:"bytes,9,opt,name=ex" json:"ex,omitempty"` +// Status int32 `protobuf:"varint,10,opt,name=status" json:"status,omitempty"` +// CreatorUserID string `protobuf:"bytes,11,opt,name=creatorUserID" json:"creatorUserID,omitempty"` +// GroupType int32 `protobuf:"varint,12,opt,name=groupType" json:"groupType,omitempty"` +// NeedVerification int32 `protobuf:"bytes,13,opt,name=needVerification" json:"needVerification,omitempty"` +//} + type ApplicationGroupResponseReq struct { OperationID string `json:"operationID" binding:"required"` GroupID string `json:"groupID" binding:"required"` @@ -157,14 +178,16 @@ type QuitGroupResp struct { } type SetGroupInfoReq struct { - GroupID string `json:"groupID" binding:"required"` - GroupName string `json:"groupName"` - Notification string `json:"notification"` - Introduction string `json:"introduction"` - FaceURL string `json:"faceURL"` - Ex string `json:"ex"` - OperationID string `json:"operationID" binding:"required"` + GroupID string `json:"groupID" binding:"required"` + GroupName string `json:"groupName"` + Notification string `json:"notification"` + Introduction string `json:"introduction"` + FaceURL string `json:"faceURL"` + Ex string `json:"ex"` + OperationID string `json:"operationID" binding:"required"` + NeedVerification *int32 `json:"needVerification" binding "oneof=0 1 2"` } + type SetGroupInfoResp struct { CommResp } @@ -232,3 +255,17 @@ type SetGroupMemberNicknameReq struct { type SetGroupMemberNicknameResp struct { CommResp } + +type SetGroupMemberInfoReq struct { + OperationID string `json:"operationID" binding:"required"` + GroupID string `json:"groupID" binding:"required"` + UserID string `json:"userID" binding:"required"` + Nickname *string `json:"nickname"` + FaceURL *string `json:"userGroupFaceUrl"` + RoleLevel *int32 `json:"roleLevel" validate:"gte=1,lte=3"` + Ex *string `json:"ex"` +} + +type SetGroupMemberInfoResp struct { + CommResp +} diff --git a/pkg/base_info/manage_api_struct.go b/pkg/base_info/manage_api_struct.go index 4b2061b57..5c249b3f7 100644 --- a/pkg/base_info/manage_api_struct.go +++ b/pkg/base_info/manage_api_struct.go @@ -3,6 +3,7 @@ package base_info import ( pbRelay "Open_IM/pkg/proto/relay" "Open_IM/pkg/proto/sdk_ws" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" pbUser "Open_IM/pkg/proto/user" ) @@ -38,7 +39,40 @@ type AccountCheckResp struct { ResultList []*pbUser.AccountCheckResp_SingleUserStatus `json:"data"` } +type ManagementSendMsg struct { + OperationID string `json:"operationID" binding:"required"` + SendID string `json:"sendID" binding:"required"` + GroupID string `json:"groupID" ` + SenderNickname string `json:"senderNickname" ` + SenderFaceURL string `json:"senderFaceURL" ` + SenderPlatformID int32 `json:"senderPlatformID"` + //ForceList []string `json:"forceList" ` + Content map[string]interface{} `json:"content" binding:"required" swaggerignore:"true"` + ContentType int32 `json:"contentType" binding:"required"` + SessionType int32 `json:"sessionType" binding:"required"` + IsOnlineOnly bool `json:"isOnlineOnly"` + OfflinePushInfo *open_im_sdk.OfflinePushInfo `json:"offlinePushInfo"` +} + +type ManagementSendMsgReq struct { + ManagementSendMsg + RecvID string `json:"recvID" ` +} + type ManagementSendMsgResp struct { CommResp ResultList server_api_params.UserSendMsgResp `json:"data"` } + +type ManagementBatchSendMsgReq struct { + ManagementSendMsg + RecvIDList []string `json:"recvIDList"` +} + +type ManagementBatchSendMsgResp struct { + CommResp + Data struct { + ResultList []server_api_params.UserSendMsgResp `json:"resultList"` + FailedIDList []string + } `json:"data"` +} diff --git a/pkg/base_info/msg.go b/pkg/base_info/msg.go index bc80cf304..153313f65 100644 --- a/pkg/base_info/msg.go +++ b/pkg/base_info/msg.go @@ -1,12 +1,20 @@ package base_info type DelMsgReq struct { - OpUserID string `json:"opUserID,omitempty"` - UserID string `json:"userID,omitempty"` - SeqList []uint32 `json:"seqList,omitempty"` - OperationID string `json:"operationID,omitempty"` + UserID string `json:"userID,omitempty" binding:"required"` + SeqList []uint32 `json:"seqList,omitempty" binding:"required"` + OperationID string `json:"operationID,omitempty" binding:"required"` } type DelMsgResp struct { CommResp } + +type CleanUpMsgReq struct { + UserID string `json:"userID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} + +type CleanUpMsgResp struct { + CommResp +} diff --git a/pkg/base_info/office_struct.go b/pkg/base_info/office_struct.go index e4dca230d..1e8e174bd 100644 --- a/pkg/base_info/office_struct.go +++ b/pkg/base_info/office_struct.go @@ -16,8 +16,8 @@ type GetUserTagsResp struct { } type CreateTagReq struct { - TagName string `json:"tagName" binding:"required"` - UserIDList []string `json:"userIDList" binding:"required"` + TagName string `json:"tagName" binding:"required"` // tag名称 + UserIDList []string `json:"userIDList" binding:"required"` // 用户ID列表 OperationID string `json:"operationID" binding:"required"` } diff --git a/pkg/base_info/organization_api_struct.go b/pkg/base_info/organization_api_struct.go index 31a9c038b..b3c77ad8f 100644 --- a/pkg/base_info/organization_api_struct.go +++ b/pkg/base_info/organization_api_struct.go @@ -9,7 +9,7 @@ type CreateDepartmentReq struct { type CreateDepartmentResp struct { CommResp Department *open_im_sdk.Department `json:"-"` - Data map[string]interface{} `json:"data"` + Data map[string]interface{} `json:"data" swaggerignore:"true"` } type UpdateDepartmentReq struct { @@ -28,7 +28,7 @@ type GetSubDepartmentReq struct { type GetSubDepartmentResp struct { CommResp DepartmentList []*open_im_sdk.Department `json:"-"` - Data []map[string]interface{} `json:"data"` + Data []map[string]interface{} `json:"data" swaggerignore:"true"` } type DeleteDepartmentReq struct { @@ -71,7 +71,7 @@ type GetUserInDepartmentReq struct { type GetUserInDepartmentResp struct { CommResp UserInDepartment *open_im_sdk.UserInDepartment `json:"-"` - Data map[string]interface{} `json:"data"` + Data map[string]interface{} `json:"data" swaggerignore:"true"` } type UpdateUserInDepartmentReq struct { @@ -97,7 +97,7 @@ type GetDepartmentMemberReq struct { type GetDepartmentMemberResp struct { CommResp UserInDepartmentList []*open_im_sdk.UserDepartmentMember `json:"-"` - Data []map[string]interface{} `json:"data"` + Data []map[string]interface{} `json:"data" swaggerignore:"true"` } type DeleteUserInDepartmentReq struct { diff --git a/pkg/base_info/public_struct.go b/pkg/base_info/public_struct.go index 2950dbea8..824f58043 100644 --- a/pkg/base_info/public_struct.go +++ b/pkg/base_info/public_struct.go @@ -6,8 +6,8 @@ import ( ) type ApiUserInfo struct { - UserID string `json:"userID" binding:"required,min=1,max=64"` - Nickname string `json:"nickname" binding:"omitempty,min=1,max=64"` + UserID string `json:"userID" binding:"required,min=1,max=64" swaggo:"true,用户ID,"` + Nickname string `json:"nickname" binding:"omitempty,min=1,max=64" swaggo:"true,my id,19"` FaceURL string `json:"faceURL" binding:"omitempty,max=1024"` Gender int32 `json:"gender" binding:"omitempty,oneof=0 1 2"` PhoneNumber string `json:"phoneNumber" binding:"omitempty,max=32"` diff --git a/pkg/base_info/super_group.go b/pkg/base_info/super_group.go new file mode 100644 index 000000000..8ea24e014 --- /dev/null +++ b/pkg/base_info/super_group.go @@ -0,0 +1,17 @@ +package base_info + +type GetJoinedSuperGroupListReq struct { + GetJoinedGroupListReq +} + +type GetJoinedSuperGroupListResp struct { + GetJoinedGroupListResp +} + +type GetSuperGroupsInfoReq struct { + GetGroupInfoReq +} + +type GetSuperGroupsInfoResp struct { + GetGroupInfoResp +} diff --git a/pkg/base_info/swagger_example.go b/pkg/base_info/swagger_example.go new file mode 100644 index 000000000..b56f26276 --- /dev/null +++ b/pkg/base_info/swagger_example.go @@ -0,0 +1,11 @@ +package base_info + +type Swagger400Resp struct { + ErrCode int32 `json:"errCode" example:"400"` + ErrMsg string `json:"errMsg" example:"err msg"` +} + +type Swagger500Resp struct { + ErrCode int32 `json:"errCode" example:"500"` + ErrMsg string `json:"errMsg" example:"err msg"` +} diff --git a/pkg/base_info/minio_api_struct.go b/pkg/base_info/third_api_struct.go similarity index 61% rename from pkg/base_info/minio_api_struct.go rename to pkg/base_info/third_api_struct.go index b553e22c7..72924e873 100644 --- a/pkg/base_info/minio_api_struct.go +++ b/pkg/base_info/third_api_struct.go @@ -19,13 +19,20 @@ type MinioUploadFileReq struct { FileType int `form:"fileType" binding:"required"` } -type MinioUploadFileResp struct { +type MinioUploadFile struct { URL string `json:"URL"` NewName string `json:"newName"` SnapshotURL string `json:"snapshotURL,omitempty"` SnapshotNewName string `json:"snapshotName,omitempty"` } +type MinioUploadFileResp struct { + CommResp + Data struct { + MinioUploadFile + } `json:"data"` +} + type UploadUpdateAppReq struct { OperationID string `form:"operationID" binding:"required"` Type int `form:"type" binding:"required"` @@ -57,3 +64,36 @@ type GetDownloadURLResp struct { UpdateLog string `json:"update_log"` } `json:"data"` } + +type GetRTCInvitationInfoReq struct { + OperationID string `json:"operationID" binding:"required"` + ClientMsgID string `json:"clientMsgID" binding:"required"` +} + +type GetRTCInvitationInfoResp struct { + CommResp + Data struct { + OpUserID string `json:"opUserID"` + Invitation struct { + InviterUserID string `json:"inviterUserID"` + InviteeUserIDList []string `json:"inviteeUserIDList"` + GroupID string `json:"groupID"` + RoomID string `json:"roomID"` + Timeout int32 `json:"timeout"` + MediaType string `json:"mediaType"` + SessionType int32 `json:"sessionType"` + InitiateTime int32 `json:"initiateTime"` + PlatformID int32 `json:"platformID"` + CustomData string `json:"customData"` + } `json:"invitation"` + OfflinePushInfo struct{} `json:"offlinePushInfo"` + } `json:"data"` +} + +type GetRTCInvitationInfoStartAppReq struct { + OperationID string `json:"operationID" binding:"required"` +} + +type GetRTCInvitationInfoStartAppResp struct { + GetRTCInvitationInfoResp +} diff --git a/pkg/base_info/user_api_struct.go b/pkg/base_info/user_api_struct.go index b517f24de..09e19bd6b 100644 --- a/pkg/base_info/user_api_struct.go +++ b/pkg/base_info/user_api_struct.go @@ -11,14 +11,20 @@ type GetUsersInfoReq struct { type GetUsersInfoResp struct { CommResp UserInfoList []*open_im_sdk.PublicUserInfo `json:"-"` - Data []map[string]interface{} `json:"data"` + Data []map[string]interface{} `json:"data" swaggerignore:"true"` } type UpdateSelfUserInfoReq struct { ApiUserInfo OperationID string `json:"operationID" binding:"required"` } - +type SetGlobalRecvMessageOptReq struct { + OperationID string `json:"operationID" binding:"required"` + GlobalRecvMsgOpt *int32 `json:"globalRecvMsgOpt" binding:"omitempty,oneof=0 1 2"` +} +type SetGlobalRecvMessageOptResp struct { + CommResp +} type UpdateUserInfoResp struct { CommResp } @@ -30,7 +36,7 @@ type GetSelfUserInfoReq struct { type GetSelfUserInfoResp struct { CommResp UserInfo *open_im_sdk.UserInfo `json:"-"` - Data map[string]interface{} `json:"data"` + Data map[string]interface{} `json:"data" swaggerignore:"true"` } type GetFriendIDListFromCacheReq struct { diff --git a/pkg/base_info/work_moments_struct.go b/pkg/base_info/work_moments_struct.go index 34f2df8bd..1e09d849f 100644 --- a/pkg/base_info/work_moments_struct.go +++ b/pkg/base_info/work_moments_struct.go @@ -12,7 +12,8 @@ type CreateOneWorkMomentResp struct { } type DeleteOneWorkMomentReq struct { - office.DeleteOneWorkMomentReq + WorkMomentID string `json:"workMomentID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` } type DeleteOneWorkMomentResp struct { @@ -21,7 +22,8 @@ type DeleteOneWorkMomentResp struct { } type LikeOneWorkMomentReq struct { - office.LikeOneWorkMomentReq + WorkMomentID string `json:"workMomentID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` } type LikeOneWorkMomentResp struct { @@ -30,7 +32,10 @@ type LikeOneWorkMomentResp struct { } type CommentOneWorkMomentReq struct { - office.CommentOneWorkMomentReq + WorkMomentID string `json:"workMomentID" binding:"required"` + ReplyUserID string `json:"replyUserID"` + Content string `json:"content" binding:"required"` + OperationID string `json:"operationID" binding:"required"` } type CommentOneWorkMomentResp struct { @@ -39,7 +44,9 @@ type CommentOneWorkMomentResp struct { } type DeleteCommentReq struct { - office.DeleteCommentReq + WorkMomentID string `json:"workMomentID" binding:"required"` + ContentID string `json:"contentID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` } type DeleteCommentResp struct { @@ -54,7 +61,8 @@ type WorkMomentsUserCommonReq struct { } type GetWorkMomentByIDReq struct { - office.GetWorkMomentByIDReq + WorkMomentID string `json:"workMomentID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` } type WorkMoment struct { diff --git a/pkg/call_back_struct/common.go b/pkg/call_back_struct/common.go index bc9ad5dac..d40315d7f 100644 --- a/pkg/call_back_struct/common.go +++ b/pkg/call_back_struct/common.go @@ -1,19 +1,21 @@ package call_back_struct type CommonCallbackReq struct { - SendID string `json:"sendID"` - CallbackCommand string `json:"callbackCommand"` - ServerMsgID string `json:"serverMsgID"` - ClientMsgID string `json:"clientMsgID"` - OperationID string `json:"operationID"` - SenderPlatformID int32 `json:"senderPlatformID"` - SenderNickname string `json:"senderNickname"` - SessionType int32 `json:"sessionType"` - MsgFrom int32 `json:"msgFrom"` - ContentType int32 `json:"contentType"` - Status int32 `json:"status"` - CreateTime int64 `json:"createTime"` - Content string `json:"content"` + SendID string `json:"sendID"` + CallbackCommand string `json:"callbackCommand"` + ServerMsgID string `json:"serverMsgID"` + ClientMsgID string `json:"clientMsgID"` + OperationID string `json:"operationID"` + SenderPlatformID int32 `json:"senderPlatformID"` + SenderNickname string `json:"senderNickname"` + SessionType int32 `json:"sessionType"` + MsgFrom int32 `json:"msgFrom"` + ContentType int32 `json:"contentType"` + Status int32 `json:"status"` + CreateTime int64 `json:"createTime"` + Content string `json:"content"` + AtUserIDList []string `json:"atUserList"` + SenderFaceURL string `json:"faceURL"` } type CommonCallbackResp struct { @@ -22,3 +24,11 @@ type CommonCallbackResp struct { ErrMsg string `json:"errMsg"` OperationID string `json:"operationID"` } + +type UserStatusCallbackReq struct { + CallbackCommand string `json:"callbackCommand"` + OperationID string `json:"operationID"` + UserID string `json:"userID"` + PlatformID int32 `json:"platformID"` + Platform string `json:"platform"` +} diff --git a/pkg/call_back_struct/message.go b/pkg/call_back_struct/message.go index 31c215ea2..65f281bb8 100644 --- a/pkg/call_back_struct/message.go +++ b/pkg/call_back_struct/message.go @@ -1,22 +1,21 @@ package call_back_struct - type CallbackBeforeSendSingleMsgReq struct { CommonCallbackReq - RecvID string `json:"recvID"` + RecvID string `json:"recvID"` } type CallbackBeforeSendSingleMsgResp struct { - CommonCallbackResp + *CommonCallbackResp } type CallbackAfterSendSingleMsgReq struct { CommonCallbackReq - RecvID string `json:"recvID"` + RecvID string `json:"recvID"` } type CallbackAfterSendSingleMsgResp struct { - CommonCallbackResp + *CommonCallbackResp } type CallbackBeforeSendGroupMsgReq struct { @@ -25,7 +24,7 @@ type CallbackBeforeSendGroupMsgReq struct { } type CallbackBeforeSendGroupMsgResp struct { - CommonCallbackResp + *CommonCallbackResp } type CallbackAfterSendGroupMsgReq struct { @@ -34,7 +33,7 @@ type CallbackAfterSendGroupMsgReq struct { } type CallbackAfterSendGroupMsgResp struct { - CommonCallbackResp + *CommonCallbackResp } type CallbackWordFilterReq struct { @@ -42,6 +41,6 @@ type CallbackWordFilterReq struct { } type CallbackWordFilterResp struct { - CommonCallbackResp + *CommonCallbackResp Content string `json:"content"` } diff --git a/pkg/call_back_struct/msg_gateway.go b/pkg/call_back_struct/msg_gateway.go new file mode 100644 index 000000000..2fba45114 --- /dev/null +++ b/pkg/call_back_struct/msg_gateway.go @@ -0,0 +1,20 @@ +package call_back_struct + +type CallbackUserOnlineReq struct { + UserStatusCallbackReq + Token string `json:"token"` + Seq int `json:"seq"` +} + +type CallbackUserOnlineResp struct { + CommonCallbackResp +} + +type CallbackUserOfflineReq struct { + UserStatusCallbackReq + Seq int `json:"seq"` +} + +type CallbackUserOfflineResp struct { + CommonCallbackResp +} diff --git a/pkg/call_back_struct/push.go b/pkg/call_back_struct/push.go new file mode 100644 index 000000000..1f6d1c2a4 --- /dev/null +++ b/pkg/call_back_struct/push.go @@ -0,0 +1,19 @@ +package call_back_struct + +import commonPb "Open_IM/pkg/proto/sdk_ws" + +type CallbackOfflinePushReq struct { + UserStatusCallbackReq + *commonPb.OfflinePushInfo + //CommonCallbackReq + SendID string `json:"sendID"` + GroupID string `json:"groupID"` + ContentType int32 `json:"contentType"` + SessionType int32 `json:"sessionType"` + AtUserIDList []string `json:"atUserIDList"` + Content string `json` +} + +type CallbackOfflinePushResp struct { + *CommonCallbackResp +} diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index e898e5aa6..d092727ec 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -1,6 +1,7 @@ package config import ( + "fmt" "io/ioutil" "os" "path/filepath" @@ -85,32 +86,40 @@ type config struct { DBMaxLifeTime int `yaml:"dbMaxLifeTime"` } Mongo struct { - DBUri string `yaml:"dbUri"` - DBAddress []string `yaml:"dbAddress"` - DBDirect bool `yaml:"dbDirect"` - DBTimeout int `yaml:"dbTimeout"` - DBDatabase string `yaml:"dbDatabase"` - DBSource string `yaml:"dbSource"` - DBUserName string `yaml:"dbUserName"` - DBPassword string `yaml:"dbPassword"` - DBMaxPoolSize int `yaml:"dbMaxPoolSize"` - DBRetainChatRecords int `yaml:"dbRetainChatRecords"` + DBUri string `yaml:"dbUri"` + DBAddress string `yaml:"dbAddress"` + DBDirect bool `yaml:"dbDirect"` + DBTimeout int `yaml:"dbTimeout"` + DBDatabase string `yaml:"dbDatabase"` + DBSource string `yaml:"dbSource"` + DBUserName string `yaml:"dbUserName"` + DBPassword string `yaml:"dbPassword"` + DBMaxPoolSize int `yaml:"dbMaxPoolSize"` + DBRetainChatRecords int `yaml:"dbRetainChatRecords"` } Redis struct { - DBAddress string `yaml:"dbAddress"` - DBMaxIdle int `yaml:"dbMaxIdle"` - DBMaxActive int `yaml:"dbMaxActive"` - DBIdleTimeout int `yaml:"dbIdleTimeout"` - DBPassWord string `yaml:"dbPassWord"` + DBAddress []string `yaml:"dbAddress"` + DBMaxIdle int `yaml:"dbMaxIdle"` + DBMaxActive int `yaml:"dbMaxActive"` + DBIdleTimeout int `yaml:"dbIdleTimeout"` + DBPassWord string `yaml:"dbPassWord"` + EnableCluster bool `yaml:"enableCluster"` } RpcPort struct { - OpenImUserPort []int `yaml:"openImUserPort"` - openImFriendPort []int `yaml:"openImFriendPort"` - RpcMessagePort []int `yaml:"rpcMessagePort"` - RpcPushMessagePort []int `yaml:"rpcPushMessagePort"` - OpenImGroupPort []int `yaml:"openImGroupPort"` - RpcModifyUserInfoPort []int `yaml:"rpcModifyUserInfoPort"` - RpcGetTokenPort []int `yaml:"rpcGetTokenPort"` + OpenImUserPort []int `yaml:"openImUserPort"` + OpenImFriendPort []int `yaml:"openImFriendPort"` + OpenImMessagePort []int `yaml:"openImMessagePort"` + OpenImMessageGatewayPort []int `yaml:"openImMessageGatewayPort"` + OpenImGroupPort []int `yaml:"openImGroupPort"` + OpenImAuthPort []int `yaml:"openImAuthPort"` + OpenImPushPort []int `yaml:"openImPushPort"` + OpenImStatisticsPort []int `yaml:"openImStatisticsPort"` + OpenImMessageCmsPort []int `yaml:"openImMessageCmsPort"` + OpenImAdminCmsPort []int `yaml:"openImAdminCmsPort"` + OpenImOfficePort []int `yaml:"openImOfficePort"` + OpenImOrganizationPort []int `yaml:"openImOrganizationPort"` + OpenImConversationPort []int `yaml:"openImConversationPort"` + OpenImCachePort []int `yaml:"openImCachePort"` } RpcRegisterName struct { OpenImStatisticsName string `yaml:"openImStatisticsName"` @@ -183,8 +192,9 @@ type config struct { } } Manager struct { - AppManagerUid []string `yaml:"appManagerUid"` - Secrets []string `yaml:"secrets"` + AppManagerUid []string `yaml:"appManagerUid"` + Secrets []string `yaml:"secrets"` + AppSysNotificationName string `yaml:"appSysNotificationName"` } Kafka struct { @@ -196,20 +206,28 @@ type config struct { Addr []string `yaml:"addr"` Topic string `yaml:"topic"` } + MsgToMongo struct { + Addr []string `yaml:"addr"` + Topic string `yaml:"topic"` + } Ms2pschat struct { Addr []string `yaml:"addr"` Topic string `yaml:"topic"` } ConsumerGroupID struct { - MsgToMongo string `yaml:"msgToMongo"` - MsgToMongoOffline string `yaml:"msgToMongoOffline"` - MsgToMySql string `yaml:"msgToMySql"` - MsgToPush string `yaml:"msgToPush"` + MsgToRedis string `yaml:"msgToTransfer"` + MsgToMongo string `yaml:"msgToMongo"` + MsgToMySql string `yaml:"msgToMySql"` + MsgToPush string `yaml:"msgToPush"` } } - Secret string `yaml:"secret"` - MultiLoginPolicy int `yaml:"multiloginpolicy"` - ChatPersistenceMysql bool `yaml:"chatPersistenceMysql"` + Secret string `yaml:"secret"` + MultiLoginPolicy int `yaml:"multiloginpolicy"` + ChatPersistenceMysql bool `yaml:"chatpersistencemysql"` + ReliableStorage bool `yaml:"reliablestorage"` + MsgCacheTimeout int `yaml:"msgCacheTimeout"` + GroupMessageHasReadReceiptEnable bool `yaml:"groupMessageHasReadReceiptEnable"` + SingleMessageHasReadReceiptEnable bool `yaml:"singleMessageHasReadReceiptEnable"` TokenPolicy struct { AccessSecret string `yaml:"accessSecret"` @@ -221,15 +239,19 @@ type config struct { IOSPush struct { PushSound string `yaml:"pushSound"` BadgeCount bool `yaml:"badgeCount"` + Production bool `yaml:"production"` } Callback struct { CallbackUrl string `yaml:"callbackUrl"` - CallbackBeforeSendSingleMsg callBackConfig `yaml:"callbackbeforeSendSingleMsg"` + CallbackBeforeSendSingleMsg callBackConfig `yaml:"callbackBeforeSendSingleMsg"` CallbackAfterSendSingleMsg callBackConfig `yaml:"callbackAfterSendSingleMsg"` CallbackBeforeSendGroupMsg callBackConfig `yaml:"callbackBeforeSendGroupMsg"` CallbackAfterSendGroupMsg callBackConfig `yaml:"callbackAfterSendGroupMsg"` CallbackWordFilter callBackConfig `yaml:"callbackWordFilter"` + CallbackUserOnline callBackConfig `yaml:"callbackUserOnline"` + CallbackUserOffline callBackConfig `yaml:"callbackUserOffline"` + CallbackOfflinePush callBackConfig `yaml:"callbackOfflinePush"` } `yaml:"callback"` Notification struct { ///////////////////////group///////////////////////////// @@ -327,6 +349,16 @@ type config struct { OfflinePush POfflinePush `yaml:"offlinePush"` DefaultTips PDefaultTips `yaml:"defaultTips"` } `yaml:"groupMemberInfoSet"` + GroupMemberSetToAdmin struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupMemberSetToAdmin"` + GroupMemberSetToOrdinary struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupMemberSetToOrdinaryUser"` OrganizationChanged struct { Conversation PConversation `yaml:"conversation"` OfflinePush POfflinePush `yaml:"offlinePush"` @@ -407,6 +439,11 @@ type config struct { OfflinePush POfflinePush `yaml:"offlinePush"` DefaultTips PDefaultTips `yaml:"defaultTips"` } `yaml:"joinDepartmentNotification"` + Signal struct { + OfflinePush struct { + Title string `yaml:"title"` + } `yaml:"offlinePush"` + } `yaml:"signal"` } Demo struct { Port []int `yaml:"openImDemoPort"` @@ -416,6 +453,16 @@ type config struct { AccessKeySecret string `yaml:"accessKeySecret"` SignName string `yaml:"signName"` VerificationCodeTemplateCode string `yaml:"verificationCodeTemplateCode"` + Enable bool `yaml:"enable"` + } + TencentSMS struct { + AppID string `yaml:"appID"` + Region string `yaml:"region"` + SecretID string `yaml:"secretID"` + SecretKey string `yaml:"secretKey"` + SignName string `yaml:"signName"` + VerificationCodeTemplateCode string `yaml:"verificationCodeTemplateCode"` + Enable bool `yaml:"enable"` } SuperCode string `yaml:"superCode"` CodeTTL int `yaml:"codeTTL"` @@ -427,10 +474,10 @@ type config struct { SmtpPort int `yaml:"smtpPort"` } TestDepartMentID string `yaml:"testDepartMentID"` + ImAPIURL string `yaml:"imAPIURL"` } Rtc struct { - Port int `yaml:"port"` - Address string `yaml:"address"` + SignalTimeout string `yaml:"signalTimeout"` } `yaml:"rtc"` } type PConversation struct { @@ -450,6 +497,8 @@ type PDefaultTips struct { func init() { cfgName := os.Getenv("CONFIG_NAME") + fmt.Println(Root, cfgName) + if len(cfgName) == 0 { cfgName = Root + "/config/config.yaml" } diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index 33e350003..fdb1dcb83 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -28,26 +28,28 @@ const ( ///ContentType //UserRelated - Text = 101 - Picture = 102 - Voice = 103 - Video = 104 - File = 105 - AtText = 106 - Merger = 107 - Card = 108 - Location = 109 - Custom = 110 - Revoke = 111 - HasReadReceipt = 112 - Typing = 113 - Quote = 114 - Common = 200 - GroupMsg = 201 + Text = 101 + Picture = 102 + Voice = 103 + Video = 104 + File = 105 + AtText = 106 + Merger = 107 + Card = 108 + Location = 109 + Custom = 110 + Revoke = 111 + HasReadReceipt = 112 + Typing = 113 + Quote = 114 + GroupHasReadReceipt = 116 + Common = 200 + GroupMsg = 201 + SignalMsg = 202 //SysRelated - NotificationBegin = 1000 - + NotificationBegin = 1000 + DeleteMessageNotification = 1100 FriendApplicationApprovedNotification = 1201 //add_friend_response FriendApplicationRejectedNotification = 1202 //add_friend_response FriendApplicationNotification = 1203 //add_friend @@ -66,26 +68,32 @@ const ( GroupNotificationBegin = 1500 - GroupCreatedNotification = 1501 - GroupInfoSetNotification = 1502 - JoinGroupApplicationNotification = 1503 - MemberQuitNotification = 1504 - GroupApplicationAcceptedNotification = 1505 - GroupApplicationRejectedNotification = 1506 - GroupOwnerTransferredNotification = 1507 - MemberKickedNotification = 1508 - MemberInvitedNotification = 1509 - MemberEnterNotification = 1510 - GroupDismissedNotification = 1511 - GroupMemberMutedNotification = 1512 - GroupMemberCancelMutedNotification = 1513 - GroupMutedNotification = 1514 - GroupCancelMutedNotification = 1515 - GroupMemberInfoSetNotification = 1516 + GroupCreatedNotification = 1501 + GroupInfoSetNotification = 1502 + JoinGroupApplicationNotification = 1503 + MemberQuitNotification = 1504 + GroupApplicationAcceptedNotification = 1505 + GroupApplicationRejectedNotification = 1506 + GroupOwnerTransferredNotification = 1507 + MemberKickedNotification = 1508 + MemberInvitedNotification = 1509 + MemberEnterNotification = 1510 + GroupDismissedNotification = 1511 + GroupMemberMutedNotification = 1512 + GroupMemberCancelMutedNotification = 1513 + GroupMutedNotification = 1514 + GroupCancelMutedNotification = 1515 + GroupMemberInfoSetNotification = 1516 + GroupMemberSetToAdminNotification = 1517 + GroupMemberSetToOrdinaryUserNotification = 1518 SignalingNotificationBegin = 1600 SignalingNotification = 1601 - SignalingNotificationEnd = 1699 + SignalingNotificationEnd = 1649 + + SuperGroupNotificationBegin = 1650 + SuperGroupUpdateNotification = 1651 + SuperGroupNotificationEnd = 1699 ConversationPrivateChatNotification = 1701 @@ -94,7 +102,7 @@ const ( WorkMomentNotificationBegin = 1900 WorkMomentNotification = 1901 - NotificationEnd = 2000 + NotificationEnd = 3000 //status MsgNormal = 1 @@ -105,9 +113,9 @@ const ( SysMsgType = 200 //SessionType - SingleChatType = 1 - GroupChatType = 2 - + SingleChatType = 1 + GroupChatType = 2 + SuperGroupChatType = 3 NotificationChatType = 4 //token NormalToken = 0 @@ -144,6 +152,7 @@ const ( IsSenderSync = "senderSync" IsNotPrivate = "notPrivate" IsSenderConversationUpdate = "senderConversationUpdate" + IsSenderNotificationPush = "senderNotificationPush" //GroupStatus GroupOk = 0 @@ -153,7 +162,8 @@ const ( //GroupType NormalGroup = 0 - DepartmentGroup = 1 + SuperGroup = 1 + DepartmentGroup = 2 GroupBaned = 3 GroupBanPrivateChat = 4 @@ -176,6 +186,9 @@ const ( CallbackBeforeSendGroupMsgCommand = "callbackBeforeSendGroupMsgCommand" CallbackAfterSendGroupMsgCommand = "callbackAfterSendGroupMsgCommand" CallbackWordFilterCommand = "callbackWordFilterCommand" + CallbackUserOnlineCommand = "callbackUserOnlineCommand" + CallbackUserOfflineCommand = "callbackUserOfflineCommand" + CallbackOfflinePushCommand = "callbackOfflinePushCommand" //callback actionCode ActionAllow = 0 ActionForbidden = 1 @@ -200,22 +213,24 @@ const ( WorkMomentAtUserNotification = 2 ) const ( - AtAllString = "AtAllTag" - AtNormal = 0 - AtMe = 1 - AtAll = 2 - AtAllAtMe = 3 + AtAllString = "AtAllTag" + AtNormal = 0 + AtMe = 1 + AtAll = 2 + AtAllAtMe = 3 + GroupNotification = 4 ) var ContentType2PushContent = map[int64]string{ - Picture: "[图片]", - Voice: "[语音]", - Video: "[视频]", - File: "[文件]", - Text: "你收到了一条文本消息", - AtText: "[有人@你]", - GroupMsg: "你收到一条群聊消息", - Common: "你收到一条新消息", + Picture: "[图片]", + Voice: "[语音]", + Video: "[视频]", + File: "[文件]", + Text: "你收到了一条文本消息", + AtText: "[有人@你]", + GroupMsg: "你收到一条群聊消息", + Common: "你收到一条新消息", + SignalMsg: "音视频通话邀请", } const ( @@ -252,6 +267,12 @@ const ( ReliableNotificationMsg = 3 ) +const ( + ApplyNeedVerificationInviteDirectly = 0 // 申请需要同意 邀请直接进 + AllNeedVerification = 1 //所有人进群需要验证,除了群主管理员邀请进群 + Directly = 2 //直接进群 +) + const FriendAcceptTip = "You have successfully become friends, so start chatting" func GroupIsBanChat(status int32) bool { @@ -268,8 +289,12 @@ func GroupIsBanPrivateChat(status int32) bool { return true } -const BigVersion = "v3" +const ( + TokenKicked = 1001 +) + +const BigVersion = "v2" const LogFileName = "OpenIM.log" -const StatisticsTimeInterval = 300 +const StatisticsTimeInterval = 60 diff --git a/pkg/common/constant/error.go b/pkg/common/constant/error.go index c8aca5fe6..10d8a219c 100644 --- a/pkg/common/constant/error.go +++ b/pkg/common/constant/error.go @@ -12,63 +12,44 @@ var ( OK = ErrInfo{0, ""} ErrServer = ErrInfo{500, "server error"} - // ErrMysql = ErrInfo{100, ""} - // ErrMongo = ErrInfo{110, ""} - // ErrRedis = ErrInfo{120, ""} ErrParseToken = ErrInfo{700, ParseTokenMsg.Error()} - // ErrCreateToken = ErrInfo{201, "Create token failed"} - // ErrAppServerKey = ErrInfo{300, "key error"} + ErrTencentCredential = ErrInfo{400, ThirdPartyMsg.Error()} - // ErrorUserRegister = ErrInfo{600, "User registration failed"} - // ErrAccountExists = ErrInfo{601, "The account is already registered and cannot be registered again"} - // ErrUserPassword = ErrInfo{602, "User password error"} - // ErrRefreshToken = ErrInfo{605, "Failed to refresh token"} - // ErrAddFriend = ErrInfo{606, "Failed to add friends"} - // ErrAgreeToAddFriend = ErrInfo{607, "Failed to agree application"} - // ErrAddFriendToBlack = ErrInfo{608, "Failed to add friends to the blacklist"} - // ErrGetBlackList = ErrInfo{609, "Failed to get blacklist"} - // ErrDeleteFriend = ErrInfo{610, "Failed to delete friend"} - // ErrGetFriendApplyList = ErrInfo{611, "Failed to get friend application list"} - // ErrGetFriendList = ErrInfo{612, "Failed to get friend list"} - // ErrRemoveBlackList = ErrInfo{613, "Failed to remove blacklist"} - // ErrSearchUserInfo = ErrInfo{614, "Can't find the user information"} - // ErrDelAppleDeviceToken = ErrInfo{615, ""} - // ErrModifyUserInfo = ErrInfo{616, "update user some attribute failed"} - // ErrSetFriendComment = ErrInfo{617, "set friend comment failed"} - // ErrSearchUserInfoFromTheGroup = ErrInfo{618, "There is no such group or the user not in the group"} - // ErrCreateGroup = ErrInfo{619, "create group chat failed"} - // ErrJoinGroupApplication = ErrInfo{620, "Failed to apply to join the group"} - // ErrQuitGroup = ErrInfo{621, "Failed to quit the group"} - // ErrSetGroupInfo = ErrInfo{622, "Failed to set group info"} - // ErrParam = ErrInfo{700, "param failed"} - ErrTokenExpired = ErrInfo{701, TokenExpiredMsg.Error()} - ErrTokenInvalid = ErrInfo{702, TokenInvalidMsg.Error()} - ErrTokenMalformed = ErrInfo{703, TokenMalformedMsg.Error()} - ErrTokenNotValidYet = ErrInfo{704, TokenNotValidYetMsg.Error()} - ErrTokenUnknown = ErrInfo{705, TokenUnknownMsg.Error()} - ErrTokenKicked = ErrInfo{706, TokenUserKickedMsg.Error()} + ErrTokenExpired = ErrInfo{701, TokenExpiredMsg.Error()} + ErrTokenInvalid = ErrInfo{702, TokenInvalidMsg.Error()} + ErrTokenMalformed = ErrInfo{703, TokenMalformedMsg.Error()} + ErrTokenNotValidYet = ErrInfo{704, TokenNotValidYetMsg.Error()} + ErrTokenUnknown = ErrInfo{705, TokenUnknownMsg.Error()} + ErrTokenKicked = ErrInfo{706, TokenUserKickedMsg.Error()} + ErrTokenDifferentPlatformID = ErrInfo{707, TokenDifferentPlatformIDMsg.Error()} + ErrTokenDifferentUserID = ErrInfo{708, TokenDifferentUserIDMsg.Error()} - ErrAccess = ErrInfo{ErrCode: 801, ErrMsg: AccessMsg.Error()} - ErrDB = ErrInfo{ErrCode: 802, ErrMsg: DBMsg.Error()} - ErrArgs = ErrInfo{ErrCode: 803, ErrMsg: ArgsMsg.Error()} - ErrStatus = ErrInfo{ErrCode: 804, ErrMsg: StatusMsg.Error()} - ErrCallback = ErrInfo{ErrCode: 809, ErrMsg: CallBackMsg.Error()} + ErrAccess = ErrInfo{ErrCode: 801, ErrMsg: AccessMsg.Error()} + ErrDB = ErrInfo{ErrCode: 802, ErrMsg: DBMsg.Error()} + ErrArgs = ErrInfo{ErrCode: 803, ErrMsg: ArgsMsg.Error()} + ErrStatus = ErrInfo{ErrCode: 804, ErrMsg: StatusMsg.Error()} + ErrCallback = ErrInfo{ErrCode: 809, ErrMsg: CallBackMsg.Error()} + ErrSendLimit = ErrInfo{ErrCode: 810, ErrMsg: "send msg limit, to many request, try again later"} + ErrMessageHasReadDisable = ErrInfo{ErrCode: 811, ErrMsg: "message has read disable"} + ErrInternal = ErrInfo{ErrCode: 812, ErrMsg: "internal error"} ) var ( - ParseTokenMsg = errors.New("parse token failed") - TokenExpiredMsg = errors.New("token is timed out, please log in again") - TokenInvalidMsg = errors.New("token has been invalidated") - TokenNotValidYetMsg = errors.New("token not active yet") - TokenMalformedMsg = errors.New("that's not even a token") - TokenUnknownMsg = errors.New("couldn't handle this token") - TokenUserKickedMsg = errors.New("user has been kicked") - AccessMsg = errors.New("no permission") - StatusMsg = errors.New("status is abnormal") - DBMsg = errors.New("db failed") - ArgsMsg = errors.New("args failed") - CallBackMsg = errors.New("callback failed") + ParseTokenMsg = errors.New("parse token failed") + TokenExpiredMsg = errors.New("token is timed out, please log in again") + TokenInvalidMsg = errors.New("token has been invalidated") + TokenNotValidYetMsg = errors.New("token not active yet") + TokenMalformedMsg = errors.New("that's not even a token") + TokenUnknownMsg = errors.New("couldn't handle this token") + TokenUserKickedMsg = errors.New("user has been kicked") + TokenDifferentPlatformIDMsg = errors.New("different platformID") + TokenDifferentUserIDMsg = errors.New("different userID") + AccessMsg = errors.New("no permission") + StatusMsg = errors.New("status is abnormal") + DBMsg = errors.New("db failed") + ArgsMsg = errors.New("args failed") + CallBackMsg = errors.New("callback failed") ThirdPartyMsg = errors.New("third party error") ) diff --git a/pkg/common/constant/platform_number_id_to_name.go b/pkg/common/constant/platform_number_id_to_name.go index c3a970b69..cac93dea8 100644 --- a/pkg/common/constant/platform_number_id_to_name.go +++ b/pkg/common/constant/platform_number_id_to_name.go @@ -27,7 +27,7 @@ const ( TerminalMobile = "Mobile" ) -var PlatformID2Name = map[int32]string{ +var PlatformID2Name = map[int]string{ IOSPlatformID: IOSPlatformStr, AndroidPlatformID: AndroidPlatformStr, WindowsPlatformID: WindowsPlatformStr, @@ -36,7 +36,7 @@ var PlatformID2Name = map[int32]string{ MiniWebPlatformID: MiniWebPlatformStr, LinuxPlatformID: LinuxPlatformStr, } -var PlatformName2ID = map[string]int32{ +var PlatformName2ID = map[string]int{ IOSPlatformStr: IOSPlatformID, AndroidPlatformStr: AndroidPlatformID, WindowsPlatformStr: WindowsPlatformID, @@ -55,10 +55,10 @@ var Platform2class = map[string]string{ LinuxPlatformStr: TerminalPC, } -func PlatformIDToName(num int32) string { +func PlatformIDToName(num int) string { return PlatformID2Name[num] } -func PlatformNameToID(name string) int32 { +func PlatformNameToID(name string) int { return PlatformName2ID[name] } func PlatformNameToClass(name string) string { diff --git a/pkg/common/db/RedisModel.go b/pkg/common/db/RedisModel.go new file mode 100644 index 000000000..c96fe08b4 --- /dev/null +++ b/pkg/common/db/RedisModel.go @@ -0,0 +1,429 @@ +package db + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + log2 "Open_IM/pkg/common/log" + pbChat "Open_IM/pkg/proto/chat" + pbRtc "Open_IM/pkg/proto/rtc" + pbCommon "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "encoding/json" + "errors" + "fmt" + go_redis "github.com/go-redis/redis/v8" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" + "strconv" + "time" +) +const ( + accountTempCode = "ACCOUNT_TEMP_CODE" + resetPwdTempCode = "RESET_PWD_TEMP_CODE" + userIncrSeq = "REDIS_USER_INCR_SEQ:" // user incr seq + appleDeviceToken = "DEVICE_TOKEN" + userMinSeq = "REDIS_USER_MIN_SEQ:" + uidPidToken = "UID_PID_TOKEN_STATUS:" + conversationReceiveMessageOpt = "CON_RECV_MSG_OPT:" + getuiToken = "GETUI_TOKEN" + userInfoCache = "USER_INFO_CACHE:" + friendRelationCache = "FRIEND_RELATION_CACHE:" + blackListCache = "BLACK_LIST_CACHE:" + groupCache = "GROUP_CACHE:" + messageCache = "MESSAGE_CACHE:" + SignalCache = "SIGNAL_CACHE:" + SignalListCache = "SIGNAL_LIST_CACHE:" + GlobalMsgRecvOpt = "GLOBAL_MSG_RECV_OPT" +) + + +//func (d * DataBases)pubMessage(channel, msg string) { +// d.rdb.Publish(context.Background(),channel,msg) +//} +//func (d * DataBases)pubMessage(channel, msg string) { +// d.rdb.Publish(context.Background(),channel,msg) +//} +func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error) { + key := accountTempCode + account + n, err := d.rdb.Exists(context.Background(), key).Result() + if n > 0 { + return true, err + } else { + return false, err + } +} +func (d *DataBases) SetAccountCode(account string, code, ttl int) (err error) { + key := accountTempCode + account + return d.rdb.Set(context.Background(), key, code, time.Duration(ttl)*time.Second).Err() +} +func (d *DataBases) GetAccountCode(account string) (string, error) { + key := accountTempCode + account + return d.rdb.Get(context.Background(), key).Result() +} + +//Perform seq auto-increment operation of user messages +func (d *DataBases) IncrUserSeq(uid string) (uint64, error) { + key := userIncrSeq + uid + seq, err := d.rdb.Incr(context.Background(), key).Result() + return uint64(seq), err +} + +//Get the largest Seq +func (d *DataBases) GetUserMaxSeq(uid string) (uint64, error) { + key := userIncrSeq + uid + seq, err := d.rdb.Get(context.Background(), key).Result() + return uint64(utils.StringToInt(seq)), err +} + +//set the largest Seq +func (d *DataBases) SetUserMaxSeq(uid string, maxSeq uint64) error { + key := userIncrSeq + uid + return d.rdb.Set(context.Background(), key, maxSeq, 0).Err() +} + +//Set the user's minimum seq +func (d *DataBases) SetUserMinSeq(uid string, minSeq uint32) (err error) { + key := userMinSeq + uid + return d.rdb.Set(context.Background(), key, minSeq, 0).Err() +} + +//Get the smallest Seq +func (d *DataBases) GetUserMinSeq(uid string) (uint64, error) { + key := userMinSeq + uid + seq, err := d.rdb.Get(context.Background(), key).Result() + return uint64(utils.StringToInt(seq)), err +} + +//Store userid and platform class to redis +func (d *DataBases) AddTokenFlag(userID string, platformID int, token string, flag int) error { + key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) + log2.NewDebug("", "add token key is ", key) + return d.rdb.HSet(context.Background(), key, token, flag).Err() +} + +func (d *DataBases) GetTokenMapByUidPid(userID, platformID string) (map[string]int, error) { + key := uidPidToken + userID + ":" + platformID + log2.NewDebug("", "get token key is ", key) + m, err := d.rdb.HGetAll(context.Background(), key).Result() + mm := make(map[string]int) + for k, v := range m { + mm[k] = utils.StringToInt(v) + } + return mm, err +} +func (d *DataBases) SetTokenMapByUidPid(userID string, platformID int, m map[string]int) error { + key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) + mm := make(map[string]interface{}) + for k, v := range m { + mm[k] = v + } + return d.rdb.HSet(context.Background(), key, mm).Err() +} +func (d *DataBases) DeleteTokenByUidPid(userID string, platformID int, fields []string) error { + key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) + return d.rdb.HDel(context.Background(), key, fields...).Err() +} +func (d *DataBases) SetSingleConversationRecvMsgOpt(userID, conversationID string, opt int32) error { + key := conversationReceiveMessageOpt + userID + return d.rdb.HSet(context.Background(), key, conversationID, opt).Err() +} + +func (d *DataBases) GetSingleConversationRecvMsgOpt(userID, conversationID string) (int, error) { + key := conversationReceiveMessageOpt + userID + result, err := d.rdb.HGet(context.Background(), key, conversationID).Result() + return utils.StringToInt(result), err +} +func (d *DataBases) SetUserGlobalMsgRecvOpt(userID string, opt int32) error { + key := conversationReceiveMessageOpt + userID + return d.rdb.HSet(context.Background(), key, GlobalMsgRecvOpt, opt).Err() +} +func (d *DataBases) GetUserGlobalMsgRecvOpt(userID string) (int, error) { + key := conversationReceiveMessageOpt + userID + result, err := d.rdb.HGet(context.Background(), key, GlobalMsgRecvOpt).Result() + if err != nil { + if err == go_redis.Nil { + return 0, nil + } else { + return 0, err + } + } + return utils.StringToInt(result), err +} +func (d *DataBases) GetMessageListBySeq(userID string, seqList []uint32, operationID string) (seqMsg []*pbCommon.MsgData, failedSeqList []uint32, errResult error) { + for _, v := range seqList { + //MESSAGE_CACHE:169.254.225.224_reliability1653387820_0_1 + key := messageCache + userID + "_" + strconv.Itoa(int(v)) + + result, err := d.rdb.Get(context.Background(), key).Result() + if err != nil { + errResult = err + failedSeqList = append(failedSeqList, v) + log2.NewWarn(operationID, "redis get message error:", err.Error(), v) + } else { + msg := pbCommon.MsgData{} + err = jsonpb.UnmarshalString(result, &msg) + if err != nil { + errResult = err + failedSeqList = append(failedSeqList, v) + log2.NewWarn(operationID, "Unmarshal err", result, err.Error()) + } else { + log2.NewDebug(operationID, "redis get msg is ", msg.String()) + seqMsg = append(seqMsg, &msg) + } + + } + } + return seqMsg, failedSeqList, errResult +} +func (d *DataBases) SetMessageToCache(msgList []*pbChat.MsgDataToMQ, uid string, operationID string) error { + ctx := context.Background() + pipe := d.rdb.Pipeline() + var failedList []pbChat.MsgDataToMQ + for _, msg := range msgList { + key := messageCache + uid + "_" + strconv.Itoa(int(msg.MsgData.Seq)) + s, err := utils.Pb2String(msg.MsgData) + if err != nil { + log2.NewWarn(operationID, utils.GetSelfFuncName(), "Pb2String failed", msg.MsgData.String(), uid, err.Error()) + continue + } + log2.NewDebug(operationID, "convert string is ", s) + err = pipe.Set(ctx, key, s, time.Duration(config.Config.MsgCacheTimeout)*time.Second).Err() + //err = d.rdb.HMSet(context.Background(), "12", map[string]interface{}{"1": 2, "343": false}).Err() + if err != nil { + log2.NewWarn(operationID, utils.GetSelfFuncName(), "redis failed", "args:", key, *msg, uid, s, err.Error()) + failedList = append(failedList, *msg) + } + } + if len(failedList) != 0 { + return errors.New(fmt.Sprintf("set msg to cache failed, failed lists: %q,%s", failedList, operationID)) + } + _, err := pipe.Exec(ctx) + return err +} + +func (d *DataBases) CleanUpOneUserAllMsgFromRedis(userID string, operationID string) error { + ctx := context.Background() + key := messageCache + userID + "_" + "*" + vals, err := d.rdb.Keys(ctx, key).Result() + log2.Debug(operationID, "vals: ", vals) + if err == go_redis.Nil { + return nil + } + if err != nil { + return utils.Wrap(err, "") + } + if err = d.rdb.Del(ctx, vals...).Err(); err != nil { + return utils.Wrap(err, "") + } + return nil +} + +func (d *DataBases) HandleSignalInfo(operationID string, msg *pbCommon.MsgData) error { + req := &pbRtc.SignalReq{} + if err := proto.Unmarshal(msg.Content, req); err != nil { + return err + } + //log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "SignalReq: ", req.String()) + var inviteeUserIDList []string + var isInviteSignal bool + switch signalInfo := req.Payload.(type) { + case *pbRtc.SignalReq_Invite: + inviteeUserIDList = signalInfo.Invite.Invitation.InviteeUserIDList + isInviteSignal = true + case *pbRtc.SignalReq_InviteInGroup: + inviteeUserIDList = signalInfo.InviteInGroup.Invitation.InviteeUserIDList + isInviteSignal = true + case *pbRtc.SignalReq_HungUp, *pbRtc.SignalReq_Cancel, *pbRtc.SignalReq_Reject, *pbRtc.SignalReq_Accept: + return errors.New("signalInfo do not need offlinePush") + default: + log2.NewDebug(operationID, utils.GetSelfFuncName(), "req invalid type", string(msg.Content)) + return nil + } + if isInviteSignal { + log2.NewInfo(operationID, utils.GetSelfFuncName(), "invite userID list:", inviteeUserIDList) + for _, userID := range inviteeUserIDList { + log2.NewInfo(operationID, utils.GetSelfFuncName(), "invite userID:", userID) + timeout, err := strconv.Atoi(config.Config.Rtc.SignalTimeout) + if err != nil { + return err + } + keyList := SignalListCache + userID + err = d.rdb.LPush(context.Background(), keyList, msg.ClientMsgID).Err() + if err != nil { + return err + } + err = d.rdb.Expire(context.Background(), keyList, time.Duration(timeout)*time.Second).Err() + if err != nil { + return err + } + key := SignalCache + msg.ClientMsgID + err = d.rdb.Set(context.Background(), key, msg.Content, time.Duration(timeout)*time.Second).Err() + if err != nil { + return err + } + } + } + return nil +} + +func (d *DataBases) GetSignalInfoFromCacheByClientMsgID(clientMsgID string) (invitationInfo *pbRtc.SignalInviteReq, err error) { + key := SignalCache + clientMsgID + invitationInfo = &pbRtc.SignalInviteReq{} + bytes, err := d.rdb.Get(context.Background(), key).Bytes() + if err != nil { + return nil, err + } + req := &pbRtc.SignalReq{} + if err = proto.Unmarshal(bytes, req); err != nil { + return nil, err + } + switch req2 := req.Payload.(type) { + case *pbRtc.SignalReq_Invite: + invitationInfo.Invitation = req2.Invite.Invitation + invitationInfo.OpUserID = req2.Invite.OpUserID + case *pbRtc.SignalReq_InviteInGroup: + invitationInfo.Invitation = req2.InviteInGroup.Invitation + invitationInfo.OpUserID = req2.InviteInGroup.OpUserID + } + return invitationInfo, err +} + +func (d *DataBases) GetAvailableSignalInvitationInfo(userID string) (invitationInfo *pbRtc.SignalInviteReq, err error) { + keyList := SignalListCache + userID + result := d.rdb.LPop(context.Background(), keyList) + if err = result.Err(); err != nil { + return nil, utils.Wrap(err, "GetAvailableSignalInvitationInfo failed") + } + key, err := result.Result() + if err != nil { + return nil, utils.Wrap(err, "GetAvailableSignalInvitationInfo failed") + } + log2.NewDebug("", utils.GetSelfFuncName(), result, result.String()) + invitationInfo, err = d.GetSignalInfoFromCacheByClientMsgID(key) + if err != nil { + return nil, utils.Wrap(err, "GetSignalInfoFromCacheByClientMsgID") + } + err = d.DelUserSignalList(userID) + if err != nil { + return nil, utils.Wrap(err, "GetSignalInfoFromCacheByClientMsgID") + } + return invitationInfo, nil +} + +func (d *DataBases) DelUserSignalList(userID string) error { + keyList := SignalListCache + userID + err := d.rdb.Del(context.Background(), keyList).Err() + return err +} + +func (d *DataBases) DelMsgFromCache(uid string, seqList []uint32, operationID string) { + for _, seq := range seqList { + key := messageCache + uid + "_" + strconv.Itoa(int(seq)) + result := d.rdb.Get(context.Background(), key).String() + var msg pbCommon.MsgData + if err := utils.String2Pb(result, &msg); err != nil { + log2.Error(operationID, utils.GetSelfFuncName(), "String2Pb failed", msg, err.Error()) + continue + } + msg.Status = constant.MsgDeleted + s, err := utils.Pb2String(&msg) + if err != nil { + log2.Error(operationID, utils.GetSelfFuncName(), "Pb2String failed", msg, err.Error()) + continue + } + if err := d.rdb.Set(context.Background(), key, s, time.Duration(config.Config.MsgCacheTimeout)*time.Second).Err(); err != nil { + log2.Error(operationID, utils.GetSelfFuncName(), "Set failed", err.Error()) + } + } +} + +func (d *DataBases) SetGetuiToken(token string, expireTime int64) error { + return d.rdb.Set(context.Background(), getuiToken, token, time.Duration(expireTime)*time.Second).Err() +} + +func (d *DataBases) GetGetuiToken() (string, error) { + result := d.rdb.Get(context.Background(), getuiToken) + return result.String(), result.Err() +} + +func (d *DataBases) AddFriendToCache(userID string, friendIDList ...string) error { + var IDList []interface{} + for _, id := range friendIDList { + IDList = append(IDList, id) + } + return d.rdb.SAdd(context.Background(), friendRelationCache+userID, IDList...).Err() +} + +func (d *DataBases) ReduceFriendToCache(userID string, friendIDList ...string) error { + var IDList []interface{} + for _, id := range friendIDList { + IDList = append(IDList, id) + } + return d.rdb.SRem(context.Background(), friendRelationCache+userID, IDList...).Err() +} + +func (d *DataBases) GetFriendIDListFromCache(userID string) ([]string, error) { + result := d.rdb.SMembers(context.Background(), friendRelationCache+userID) + return result.Result() +} + +func (d *DataBases) AddBlackUserToCache(userID string, blackList ...string) error { + var IDList []interface{} + for _, id := range blackList { + IDList = append(IDList, id) + } + return d.rdb.SAdd(context.Background(), blackListCache+userID, IDList...).Err() +} + +func (d *DataBases) ReduceBlackUserFromCache(userID string, blackList ...string) error { + var IDList []interface{} + for _, id := range blackList { + IDList = append(IDList, id) + } + return d.rdb.SRem(context.Background(), blackListCache+userID, IDList...).Err() +} + +func (d *DataBases) GetBlackListFromCache(userID string) ([]string, error) { + result := d.rdb.SMembers(context.Background(), blackListCache+userID) + return result.Result() +} + +func (d *DataBases) AddGroupMemberToCache(groupID string, userIDList ...string) error { + var IDList []interface{} + for _, id := range userIDList { + IDList = append(IDList, id) + } + return d.rdb.SAdd(context.Background(), groupCache+groupID, IDList...).Err() +} + +func (d *DataBases) ReduceGroupMemberFromCache(groupID string, userIDList ...string) error { + var IDList []interface{} + for _, id := range userIDList { + IDList = append(IDList, id) + } + return d.rdb.SRem(context.Background(), groupCache+groupID, IDList...).Err() +} + +func (d *DataBases) GetGroupMemberIDListFromCache(groupID string) ([]string, error) { + result := d.rdb.SMembers(context.Background(), groupCache+groupID) + return result.Result() +} + +func (d *DataBases) SetUserInfoToCache(userID string, m map[string]interface{}) error { + return d.rdb.HSet(context.Background(), userInfoCache+userID, m).Err() +} + +func (d *DataBases) GetUserInfoFromCache(userID string) (*pbCommon.UserInfo, error) { + result, err := d.rdb.HGetAll(context.Background(), userInfoCache+userID).Result() + bytes, err := json.Marshal(result) + if err != nil { + return nil, err + } + userInfo := &pbCommon.UserInfo{} + if err := proto.Unmarshal(bytes, userInfo); err != nil { + return nil, err + } + err = json.Unmarshal(bytes, userInfo) + return userInfo, err +} diff --git a/pkg/common/db/batch_insert_chat.go b/pkg/common/db/batch_insert_chat.go new file mode 100644 index 000000000..c6b57201f --- /dev/null +++ b/pkg/common/db/batch_insert_chat.go @@ -0,0 +1,256 @@ +package db + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + pbMsg "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" + "context" + "errors" + go_redis "github.com/go-redis/redis/v8" + "github.com/golang/protobuf/proto" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" +) + +func (d *DataBases) BatchDeleteChat2DB(userID string, msgList []*pbMsg.MsgDataToMQ, operationID string) { + +} + +func (d *DataBases) BatchInsertChat2DB(userID string, msgList []*pbMsg.MsgDataToMQ, operationID string, currentMaxSeq uint64) error { + newTime := getCurrentTimestampByMill() + if len(msgList) > GetSingleGocMsgNum() { + return errors.New("too large") + } + isInit := false + var remain uint64 + blk0 := uint64(GetSingleGocMsgNum() - 1) + if currentMaxSeq < uint64(GetSingleGocMsgNum()) { + remain = blk0 - currentMaxSeq + } else { + excludeBlk0 := currentMaxSeq - blk0 + remain = (uint64(GetSingleGocMsgNum()) - (excludeBlk0 % uint64(GetSingleGocMsgNum()))) % uint64(GetSingleGocMsgNum()) + } + insertCounter := uint64(0) + msgListToMongo := make([]MsgInfo, 0) + msgListToMongoNext := make([]MsgInfo, 0) + seqUid := "" + seqUidNext := "" + log.Debug(operationID, "remain ", remain, "insertCounter ", insertCounter, "currentMaxSeq ", currentMaxSeq, userID, len(msgList)) + var err error + for _, m := range msgList { + log.Debug(operationID, "msg node ", m.String(), m.MsgData.ClientMsgID) + currentMaxSeq++ + sMsg := MsgInfo{} + sMsg.SendTime = m.MsgData.SendTime + m.MsgData.Seq = uint32(currentMaxSeq) + if sMsg.Msg, err = proto.Marshal(m.MsgData); err != nil { + return utils.Wrap(err, "") + } + if isInit { + msgListToMongoNext = append(msgListToMongoNext, sMsg) + seqUidNext = getSeqUid(userID, uint32(currentMaxSeq)) + log.Debug(operationID, "msgListToMongoNext ", seqUidNext, m.MsgData.Seq, m.MsgData.ClientMsgID, insertCounter, remain) + continue + } + if insertCounter < remain { + msgListToMongo = append(msgListToMongo, sMsg) + insertCounter++ + seqUid = getSeqUid(userID, uint32(currentMaxSeq)) + log.Debug(operationID, "msgListToMongo ", seqUid, m.MsgData.Seq, m.MsgData.ClientMsgID, insertCounter, remain) + } else { + msgListToMongoNext = append(msgListToMongoNext, sMsg) + seqUidNext = getSeqUid(userID, uint32(currentMaxSeq)) + log.Debug(operationID, "msgListToMongoNext ", seqUidNext, m.MsgData.Seq, m.MsgData.ClientMsgID, insertCounter, remain) + } + } + + ctx := context.Background() + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat) + + if seqUid != "" { + filter := bson.M{"uid": seqUid} + log.NewDebug(operationID, "filter ", seqUid, "list ", msgListToMongo) + err := c.FindOneAndUpdate(ctx, filter, bson.M{"$push": bson.M{"msg": bson.M{"$each": msgListToMongo}}}).Err() + if err != nil { + if err == mongo.ErrNoDocuments { + filter := bson.M{"uid": seqUid} + sChat := UserChat{} + sChat.UID = seqUid + sChat.Msg = msgListToMongo + log.NewDebug(operationID, "filter ", seqUid, "list ", msgListToMongo) + if _, err = c.InsertOne(ctx, &sChat); err != nil { + log.NewError(operationID, "InsertOne failed", filter, err.Error(), sChat) + return utils.Wrap(err, "") + } + } else { + log.Error(operationID, "FindOneAndUpdate failed ", err.Error(), filter) + return utils.Wrap(err, "") + } + } + } + if seqUidNext != "" { + filter := bson.M{"uid": seqUidNext} + sChat := UserChat{} + sChat.UID = seqUidNext + sChat.Msg = msgListToMongoNext + log.NewDebug(operationID, "filter ", seqUidNext, "list ", msgListToMongoNext) + if _, err = c.InsertOne(ctx, &sChat); err != nil { + log.NewError(operationID, "InsertOne failed", filter, err.Error(), sChat) + return utils.Wrap(err, "") + } + } + log.NewWarn(operationID, "batch mgo cost time ", getCurrentTimestampByMill()-newTime, userID, len(msgList)) + return nil +} + +func (d *DataBases) BatchInsertChat2Cache(userID string, msgList []*pbMsg.MsgDataToMQ, operationID string) (error, uint64) { + newTime := getCurrentTimestampByMill() + if len(msgList) > GetSingleGocMsgNum() { + return errors.New("too large"), 0 + } + currentMaxSeq, err := d.GetUserMaxSeq(userID) + if err == nil { + + } else if err == go_redis.Nil { + currentMaxSeq = 0 + } else { + return utils.Wrap(err, ""), 0 + } + lastMaxSeq := currentMaxSeq + + for _, m := range msgList { + log.Debug(operationID, "msg node ", m.String(), m.MsgData.ClientMsgID) + currentMaxSeq++ + sMsg := MsgInfo{} + sMsg.SendTime = m.MsgData.SendTime + m.MsgData.Seq = uint32(currentMaxSeq) + } + log.Debug(operationID, "SetMessageToCache ", userID, len(msgList)) + err = d.SetMessageToCache(msgList, userID, operationID) + if err != nil { + log.Error(operationID, "setMessageToCache failed, continue ", err.Error(), len(msgList), userID) + } + log.NewWarn(operationID, "batch to redis cost time ", getCurrentTimestampByMill()-newTime, userID, len(msgList)) + return utils.Wrap(d.SetUserMaxSeq(userID, uint64(currentMaxSeq)), ""), lastMaxSeq +} + +//func (d *DataBases) BatchInsertChatBoth(userID string, msgList []*pbMsg.MsgDataToMQ, operationID string) (error, uint64) { +// err, lastMaxSeq := d.BatchInsertChat2Cache(userID, msgList, operationID) +// if err != nil { +// log.Error(operationID, "BatchInsertChat2Cache failed ", err.Error(), userID, len(msgList)) +// return err, 0 +// } +// for { +// if runtime.NumGoroutine() > 50000 { +// log.NewWarn(operationID, "too many NumGoroutine ", runtime.NumGoroutine()) +// time.Sleep(10 * time.Millisecond) +// } else { +// break +// } +// } +// return nil, lastMaxSeq +//} + +func (d *DataBases) BatchInsertChat(userID string, msgList []*pbMsg.MsgDataToMQ, operationID string) error { + newTime := getCurrentTimestampByMill() + if len(msgList) > GetSingleGocMsgNum() { + return errors.New("too large") + } + isInit := false + currentMaxSeq, err := d.GetUserMaxSeq(userID) + if err == nil { + + } else if err == go_redis.Nil { + isInit = true + currentMaxSeq = 0 + } else { + return utils.Wrap(err, "") + } + var remain uint64 + //if currentMaxSeq < uint64(GetSingleGocMsgNum()) { + // remain = uint64(GetSingleGocMsgNum()-1) - (currentMaxSeq % uint64(GetSingleGocMsgNum())) + //} else { + // remain = uint64(GetSingleGocMsgNum()) - ((currentMaxSeq - (uint64(GetSingleGocMsgNum()) - 1)) % uint64(GetSingleGocMsgNum())) + //} + + blk0 := uint64(GetSingleGocMsgNum() - 1) + if currentMaxSeq < uint64(GetSingleGocMsgNum()) { + remain = blk0 - currentMaxSeq + } else { + excludeBlk0 := currentMaxSeq - blk0 + remain = (uint64(GetSingleGocMsgNum()) - (excludeBlk0 % uint64(GetSingleGocMsgNum()))) % uint64(GetSingleGocMsgNum()) + } + + insertCounter := uint64(0) + msgListToMongo := make([]MsgInfo, 0) + msgListToMongoNext := make([]MsgInfo, 0) + seqUid := "" + seqUidNext := "" + log.Debug(operationID, "remain ", remain, "insertCounter ", insertCounter, "currentMaxSeq ", currentMaxSeq, userID, len(msgList)) + //4998 remain ==1 + //4999 + for _, m := range msgList { + log.Debug(operationID, "msg node ", m.String(), m.MsgData.ClientMsgID) + currentMaxSeq++ + sMsg := MsgInfo{} + sMsg.SendTime = m.MsgData.SendTime + m.MsgData.Seq = uint32(currentMaxSeq) + if sMsg.Msg, err = proto.Marshal(m.MsgData); err != nil { + return utils.Wrap(err, "") + } + if isInit { + msgListToMongoNext = append(msgListToMongoNext, sMsg) + seqUidNext = getSeqUid(userID, uint32(currentMaxSeq)) + log.Debug(operationID, "msgListToMongoNext ", seqUidNext, m.MsgData.Seq, m.MsgData.ClientMsgID, insertCounter, remain) + continue + } + if insertCounter < remain { + msgListToMongo = append(msgListToMongo, sMsg) + insertCounter++ + seqUid = getSeqUid(userID, uint32(currentMaxSeq)) + log.Debug(operationID, "msgListToMongo ", seqUid, m.MsgData.Seq, m.MsgData.ClientMsgID, insertCounter, remain) + } else { + msgListToMongoNext = append(msgListToMongoNext, sMsg) + seqUidNext = getSeqUid(userID, uint32(currentMaxSeq)) + log.Debug(operationID, "msgListToMongoNext ", seqUidNext, m.MsgData.Seq, m.MsgData.ClientMsgID, insertCounter, remain) + } + } + // ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + + ctx := context.Background() + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat) + + if seqUid != "" { + filter := bson.M{"uid": seqUid} + log.NewDebug(operationID, "filter ", seqUid, "list ", msgListToMongo) + err := c.FindOneAndUpdate(ctx, filter, bson.M{"$push": bson.M{"msg": bson.M{"$each": msgListToMongo}}}).Err() + if err != nil { + log.Error(operationID, "FindOneAndUpdate failed ", err.Error(), filter) + return utils.Wrap(err, "") + } + } + if seqUidNext != "" { + filter := bson.M{"uid": seqUidNext} + sChat := UserChat{} + sChat.UID = seqUidNext + sChat.Msg = msgListToMongoNext + log.NewDebug(operationID, "filter ", seqUidNext, "list ", msgListToMongoNext) + if _, err = c.InsertOne(ctx, &sChat); err != nil { + log.NewError(operationID, "InsertOne failed", filter, err.Error(), sChat) + return utils.Wrap(err, "") + } + } + log.NewWarn(operationID, "batch mgo cost time ", getCurrentTimestampByMill()-newTime, userID, len(msgList)) + return utils.Wrap(d.SetUserMaxSeq(userID, uint64(currentMaxSeq)), "") +} + +//func (d *DataBases)setMessageToCache(msgList []*pbMsg.MsgDataToMQ, uid string) (err error) { +// +//} + +func (d *DataBases) GetFromCacheAndInsertDB(msgUserIDPrefix string) { + //get value from redis + + //batch insert to db +} diff --git a/pkg/common/db/model.go b/pkg/common/db/model.go index 6edf36b8a..61912b670 100644 --- a/pkg/common/db/model.go +++ b/pkg/common/db/model.go @@ -8,11 +8,9 @@ import ( //"Open_IM/pkg/common/log" "Open_IM/pkg/utils" "fmt" + go_redis "github.com/go-redis/redis/v8" "go.mongodb.org/mongo-driver/mongo/options" - // "context" - // "fmt" - "github.com/garyburd/redigo/redis" "gopkg.in/mgo.v2" "time" @@ -20,15 +18,24 @@ import ( //"go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" // "go.mongodb.org/mongo-driver/mongo/options" + //go_redis "github.com/go-redis/redis/v8" ) var DB DataBases type DataBases struct { - MysqlDB mysqlDB - mgoSession *mgo.Session - redisPool *redis.Pool + MysqlDB mysqlDB + mgoSession *mgo.Session + //redisPool *redis.Pool mongoClient *mongo.Client + rdb go_redis.UniversalClient +} + +type RedisClient struct { + client *go_redis.Client + cluster *go_redis.ClusterClient + go_redis.UniversalClient + enableCluster bool } func key(dbAddress, dbName string) string { @@ -49,11 +56,11 @@ func init() { uri = config.Config.Mongo.DBUri } else { if config.Config.Mongo.DBPassword != "" && config.Config.Mongo.DBUserName != "" { - uri = fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d", config.Config.Mongo.DBUserName, config.Config.Mongo.DBPassword, config.Config.Mongo.DBAddress[0], + uri = fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d", config.Config.Mongo.DBUserName, config.Config.Mongo.DBPassword, config.Config.Mongo.DBAddress, config.Config.Mongo.DBDatabase, config.Config.Mongo.DBMaxPoolSize) } else { uri = fmt.Sprintf("mongodb://%s/%s/?maxPoolSize=%d", - config.Config.Mongo.DBAddress[0], config.Config.Mongo.DBDatabase, + config.Config.Mongo.DBAddress, config.Config.Mongo.DBDatabase, config.Config.Mongo.DBMaxPoolSize) } } @@ -96,21 +103,44 @@ func init() { DB.mongoClient = mongoClient // redis pool init - DB.redisPool = &redis.Pool{ - MaxIdle: config.Config.Redis.DBMaxIdle, - MaxActive: config.Config.Redis.DBMaxActive, - IdleTimeout: time.Duration(config.Config.Redis.DBIdleTimeout) * time.Second, - Dial: func() (redis.Conn, error) { - return redis.Dial( - "tcp", - config.Config.Redis.DBAddress, - redis.DialReadTimeout(time.Duration(1000)*time.Millisecond), - redis.DialWriteTimeout(time.Duration(1000)*time.Millisecond), - redis.DialConnectTimeout(time.Duration(1000)*time.Millisecond), - redis.DialDatabase(0), - redis.DialPassword(config.Config.Redis.DBPassWord), - ) - }, + //DB.redisPool = &redis.Pool{ + // MaxIdle: config.Config.Redis.DBMaxIdle, + // MaxActive: config.Config.Redis.DBMaxActive, + // IdleTimeout: time.Duration(config.Config.Redis.DBIdleTimeout) * time.Second, + // Dial: func() (redis.Conn, error) { + // return redis.Dial( + // "tcp", + // config.Config.Redis.DBAddress, + // redis.DialReadTimeout(time.Duration(1000)*time.Millisecond), + // redis.DialWriteTimeout(time.Duration(1000)*time.Millisecond), + // redis.DialConnectTimeout(time.Duration(1000)*time.Millisecond), + // redis.DialDatabase(0), + // redis.DialPassword(config.Config.Redis.DBPassWord), + // ) + // }, + //} + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + if config.Config.Redis.EnableCluster { + DB.rdb = go_redis.NewClusterClient(&go_redis.ClusterOptions{ + Addrs: config.Config.Redis.DBAddress, + PoolSize: 50, + }) + _, err = DB.rdb.Ping(ctx).Result() + if err != nil { + panic(err.Error()) + } + } else { + DB.rdb = go_redis.NewClient(&go_redis.Options{ + Addr: config.Config.Redis.DBAddress[0], + Password: config.Config.Redis.DBPassWord, // no password set + DB: 0, // use default DB + PoolSize: 100, // 连接池大小 + }) + _, err = DB.rdb.Ping(ctx).Result() + if err != nil { + panic(err.Error()) + } } } diff --git a/pkg/common/db/model_struct.go b/pkg/common/db/model_struct.go index b0854169e..b256a2161 100644 --- a/pkg/common/db/model_struct.go +++ b/pkg/common/db/model_struct.go @@ -6,6 +6,8 @@ type Register struct { Account string `gorm:"column:account;primary_key;type:char(255)" json:"account"` Password string `gorm:"column:password;type:varchar(255)" json:"password"` Ex string `gorm:"column:ex;size:1024" json:"ex"` + UserID string `gorm:"column:user_id;type:varchar(255)" json:"userID"` + AreaCode string `gorm:"column:area_code;type:varchar(255)"` } // @@ -75,16 +77,17 @@ func (FriendRequest) TableName() string { type Group struct { //`json:"operationID" binding:"required"` //`protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` `json:"operationID" binding:"required"` - GroupID string `gorm:"column:group_id;primary_key;size:64" json:"groupID" binding:"required"` - GroupName string `gorm:"column:name;size:255" json:"groupName"` - Notification string `gorm:"column:notification;size:255" json:"notification"` - Introduction string `gorm:"column:introduction;size:255" json:"introduction"` - FaceURL string `gorm:"column:face_url;size:255" json:"faceURL"` - CreateTime time.Time `gorm:"column:create_time"` - Ex string `gorm:"column:ex" json:"ex;size:1024" json:"ex"` - Status int32 `gorm:"column:status"` - CreatorUserID string `gorm:"column:creator_user_id;size:64"` - GroupType int32 `gorm:"column:group_type"` + GroupID string `gorm:"column:group_id;primary_key;size:64" json:"groupID" binding:"required"` + GroupName string `gorm:"column:name;size:255" json:"groupName"` + Notification string `gorm:"column:notification;size:255" json:"notification"` + Introduction string `gorm:"column:introduction;size:255" json:"introduction"` + FaceURL string `gorm:"column:face_url;size:255" json:"faceURL"` + CreateTime time.Time `gorm:"column:create_time"` + Ex string `gorm:"column:ex" json:"ex;size:1024" json:"ex"` + Status int32 `gorm:"column:status"` + CreatorUserID string `gorm:"column:creator_user_id;size:64"` + GroupType int32 `gorm:"column:group_type"` + NeedVerification int32 `gorm:"column:need_verification"` } //message GroupMemberFullInfo { @@ -147,16 +150,17 @@ type GroupRequest struct { //int32 AppMangerLevel = 10; //open_im_sdk.User == imdb.User type User struct { - UserID string `gorm:"column:user_id;primary_key;size:64"` - Nickname string `gorm:"column:name;size:255"` - FaceURL string `gorm:"column:face_url;size:255"` - Gender int32 `gorm:"column:gender"` - PhoneNumber string `gorm:"column:phone_number;size:32"` - Birth time.Time `gorm:"column:birth"` - Email string `gorm:"column:email;size:64"` - Ex string `gorm:"column:ex;size:1024"` - CreateTime time.Time `gorm:"column:create_time"` - AppMangerLevel int32 `gorm:"column:app_manger_level"` + UserID string `gorm:"column:user_id;primary_key;size:64"` + Nickname string `gorm:"column:name;size:255"` + FaceURL string `gorm:"column:face_url;size:255"` + Gender int32 `gorm:"column:gender"` + PhoneNumber string `gorm:"column:phone_number;size:32"` + Birth time.Time `gorm:"column:birth"` + Email string `gorm:"column:email;size:64"` + Ex string `gorm:"column:ex;size:1024"` + CreateTime time.Time `gorm:"column:create_time"` + AppMangerLevel int32 `gorm:"column:app_manger_level"` + GlobalRecvMsgOpt int32 `gorm:"column:global_recv_msg_opt"` } //message BlackInfo{ diff --git a/pkg/common/db/mongoModel.go b/pkg/common/db/mongoModel.go index 08d605113..7a4685b9e 100644 --- a/pkg/common/db/mongoModel.go +++ b/pkg/common/db/mongoModel.go @@ -10,7 +10,9 @@ import ( "context" "errors" "fmt" + "github.com/go-redis/redis/v8" "github.com/gogo/protobuf/sortkeys" + "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" "math/rand" "sync" @@ -29,8 +31,14 @@ const cTag = "tag" const cSendLog = "send_log" const cWorkMoment = "work_moment" const cCommentMsg = "comment_msg" +const cSuperGroup = "super_group" +const cUserToSuperGroup = "user_to_super_group" const singleGocMsgNum = 5000 +func GetSingleGocMsgNum() int { + return singleGocMsgNum +} + type MsgInfo struct { SendTime int64 Msg []byte @@ -81,7 +89,7 @@ func (d *DataBases) GetMinSeqFromMongo2(uid string) (MinSeq uint32, err error) { } // deleteMsgByLogic -func (d *DataBases) DelMsgBySeqList(userID string, seqList []uint32, operationID string) (err error) { +func (d *DataBases) DelMsgBySeqList(userID string, seqList []uint32, operationID string) (totalUnexistSeqList []uint32, err error) { log.Debug(operationID, utils.GetSelfFuncName(), "args ", userID, seqList) sortkeys.Uint32s(seqList) suffixUserID2SubSeqList := func(uid string, seqList []uint32) map[string][]uint32 { @@ -98,33 +106,37 @@ func (d *DataBases) DelMsgBySeqList(userID string, seqList []uint32, operationID return t }(userID, seqList) + lock := sync.Mutex{} var wg sync.WaitGroup wg.Add(len(suffixUserID2SubSeqList)) for k, v := range suffixUserID2SubSeqList { go func(suffixUserID string, subSeqList []uint32, operationID string) { - if e := d.DelMsgBySeqListInOneDoc(suffixUserID, subSeqList, operationID); e != nil { - log.Error(operationID, "DelMsgBySeqListInOneDoc failed ", e.Error(), suffixUserID, subSeqList) - err = e + defer wg.Done() + unexistSeqList, err := d.DelMsgBySeqListInOneDoc(suffixUserID, subSeqList, operationID) + if err != nil { + log.Error(operationID, "DelMsgBySeqListInOneDoc failed ", err.Error(), suffixUserID, subSeqList) + return } - wg.Done() + lock.Lock() + totalUnexistSeqList = append(totalUnexistSeqList, unexistSeqList...) + lock.Unlock() }(k, v, operationID) } - wg.Wait() - return err + return totalUnexistSeqList, err } -func (d *DataBases) DelMsgBySeqListInOneDoc(suffixUserID string, seqList []uint32, operationID string) error { +func (d *DataBases) DelMsgBySeqListInOneDoc(suffixUserID string, seqList []uint32, operationID string) ([]uint32, error) { log.Debug(operationID, utils.GetSelfFuncName(), "args ", suffixUserID, seqList) - seqMsgList, indexList, err := d.GetMsgAndIndexBySeqListInOneMongo2(suffixUserID, seqList, operationID) + seqMsgList, indexList, unexistSeqList, err := d.GetMsgAndIndexBySeqListInOneMongo2(suffixUserID, seqList, operationID) if err != nil { - return utils.Wrap(err, "") + return nil, utils.Wrap(err, "") } for i, v := range seqMsgList { if err := d.ReplaceMsgByIndex(suffixUserID, v, operationID, indexList[i]); err != nil { - return utils.Wrap(err, "") + return nil, utils.Wrap(err, "") } } - return nil + return unexistSeqList, nil } // deleteMsgByLogic @@ -297,14 +309,65 @@ func (d *DataBases) GetMsgBySeqListMongo2(uid string, seqList []uint32, operatio } return seqMsg, nil } +func (d *DataBases) GetSuperGroupMsgBySeqListMongo(groupID string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, err error) { + var hasSeqList []uint32 + singleCount := 0 + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat) -func (d *DataBases) GetMsgAndIndexBySeqListInOneMongo2(suffixUserID string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, indexList []int, err error) { + m := func(uid string, seqList []uint32) map[string][]uint32 { + t := make(map[string][]uint32) + for i := 0; i < len(seqList); i++ { + seqUid := getSeqUid(uid, seqList[i]) + if value, ok := t[seqUid]; !ok { + var temp []uint32 + t[seqUid] = append(temp, seqList[i]) + } else { + t[seqUid] = append(value, seqList[i]) + } + } + return t + }(groupID, seqList) + sChat := UserChat{} + for seqUid, value := range m { + if err = c.FindOne(ctx, bson.M{"uid": seqUid}).Decode(&sChat); err != nil { + log.NewError(operationID, "not find seqGroupID", seqUid, value, groupID, seqList, err.Error()) + continue + } + singleCount = 0 + for i := 0; i < len(sChat.Msg); i++ { + msg := new(open_im_sdk.MsgData) + if err = proto.Unmarshal(sChat.Msg[i].Msg, msg); err != nil { + log.NewError(operationID, "Unmarshal err", seqUid, value, groupID, seqList, err.Error()) + return nil, err + } + if isContainInt32(msg.Seq, value) { + seqMsg = append(seqMsg, msg) + hasSeqList = append(hasSeqList, msg.Seq) + singleCount++ + if singleCount == len(value) { + break + } + } + } + } + if len(hasSeqList) != len(seqList) { + var diff []uint32 + diff = utils.Difference(hasSeqList, seqList) + exceptionMSg := genExceptionSuperGroupMessageBySeqList(diff, groupID) + seqMsg = append(seqMsg, exceptionMSg...) + + } + return seqMsg, nil +} + +func (d *DataBases) GetMsgAndIndexBySeqListInOneMongo2(suffixUserID string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, indexList []int, unexistSeqList []uint32, err error) { ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat) sChat := UserChat{} if err = c.FindOne(ctx, bson.M{"uid": suffixUserID}).Decode(&sChat); err != nil { log.NewError(operationID, "not find seqUid", suffixUserID, err.Error()) - return nil, nil, utils.Wrap(err, "") + return nil, nil, nil, utils.Wrap(err, "") } singleCount := 0 var hasSeqList []uint32 @@ -312,7 +375,7 @@ func (d *DataBases) GetMsgAndIndexBySeqListInOneMongo2(suffixUserID string, seqL msg := new(open_im_sdk.MsgData) if err = proto.Unmarshal(sChat.Msg[i].Msg, msg); err != nil { log.NewError(operationID, "Unmarshal err", msg.String(), err.Error()) - return nil, nil, err + return nil, nil, nil, err } if isContainInt32(msg.Seq, seqList) { indexList = append(indexList, i) @@ -324,8 +387,13 @@ func (d *DataBases) GetMsgAndIndexBySeqListInOneMongo2(suffixUserID string, seqL } } } - - return seqMsg, indexList, nil + for _, i := range seqList { + if isContainInt32(i, hasSeqList) { + continue + } + unexistSeqList = append(unexistSeqList, i) + } + return seqMsg, indexList, unexistSeqList, nil } func genExceptionMessageBySeqList(seqList []uint32) (exceptionMsg []*open_im_sdk.MsgData) { @@ -337,6 +405,17 @@ func genExceptionMessageBySeqList(seqList []uint32) (exceptionMsg []*open_im_sdk return exceptionMsg } +func genExceptionSuperGroupMessageBySeqList(seqList []uint32, groupID string) (exceptionMsg []*open_im_sdk.MsgData) { + for _, v := range seqList { + msg := new(open_im_sdk.MsgData) + msg.Seq = v + msg.GroupID = groupID + msg.SessionType = constant.SuperGroupChatType + exceptionMsg = append(exceptionMsg, msg) + } + return exceptionMsg +} + func (d *DataBases) SaveUserChatMongo2(uid string, sendTime int64, m *pbMsg.MsgDataToDB) error { ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat) @@ -351,7 +430,7 @@ func (d *DataBases) SaveUserChatMongo2(uid string, sendTime int64, m *pbMsg.MsgD return utils.Wrap(err, "") } err = c.FindOneAndUpdate(ctx, filter, bson.M{"$push": bson.M{"msg": sMsg}}).Err() - log.NewDebug(operationID, "get mgoSession cost time", getCurrentTimestampByMill()-newTime) + log.NewWarn(operationID, "get mgoSession cost time", getCurrentTimestampByMill()-newTime) if err != nil { sChat := UserChat{} sChat.UID = seqUid @@ -368,6 +447,47 @@ func (d *DataBases) SaveUserChatMongo2(uid string, sendTime int64, m *pbMsg.MsgD return nil } +// +//func (d *DataBases) SaveUserChatListMongo2(uid string, sendTime int64, msgList []*pbMsg.MsgDataToDB) error { +// ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) +// c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat) +// newTime := getCurrentTimestampByMill() +// operationID := "" +// seqUid := "" +// msgListToMongo := make([]MsgInfo, 0) +// +// for _, m := range msgList { +// seqUid = getSeqUid(uid, m.MsgData.Seq) +// var err error +// sMsg := MsgInfo{} +// sMsg.SendTime = sendTime +// if sMsg.Msg, err = proto.Marshal(m.MsgData); err != nil { +// return utils.Wrap(err, "") +// } +// msgListToMongo = append(msgListToMongo, sMsg) +// } +// +// filter := bson.M{"uid": seqUid} +// log.NewDebug(operationID, "filter ", seqUid) +// err := c.FindOneAndUpdate(ctx, filter, bson.M{"$push": bson.M{"msg": bson.M{"$each": msgListToMongo}}}).Err() +// log.NewWarn(operationID, "get mgoSession cost time", getCurrentTimestampByMill()-newTime) +// if err != nil { +// sChat := UserChat{} +// sChat.UID = seqUid +// sChat.Msg = msgListToMongo +// +// if _, err = c.InsertOne(ctx, &sChat); err != nil { +// log.NewError(operationID, "InsertOne failed", filter, err.Error(), sChat) +// return utils.Wrap(err, "") +// } +// } else { +// log.NewDebug(operationID, "FindOneAndUpdate ok", filter) +// } +// +// log.NewDebug(operationID, "find mgo uid cost time", getCurrentTimestampByMill()-newTime) +// return nil +//} + func (d *DataBases) SaveUserChat(uid string, sendTime int64, m *pbMsg.MsgDataToDB) error { var seqUid string newTime := getCurrentTimestampByMill() @@ -824,6 +944,178 @@ func (d *DataBases) GetUserFriendWorkMoments(showNumber, pageNumber int32, userI return workMomentList, err } +type SuperGroup struct { + GroupID string `bson:"group_id"` + //MemberNumCount int `bson:"member_num_count"` + MemberIDList []string `bson:"member_id_list"` +} + +type UserToSuperGroup struct { + UserID string `bson:"user_id"` + GroupIDList []string `bson:"group_id_list"` +} + +func (d *DataBases) CreateSuperGroup(groupID string, initMemberIDList []string, memberNumCount int) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSuperGroup) + session, err := d.mongoClient.StartSession() + if err != nil { + return utils.Wrap(err, "start session failed") + } + defer session.EndSession(ctx) + sCtx := mongo.NewSessionContext(ctx, session) + superGroup := SuperGroup{ + GroupID: groupID, + MemberIDList: initMemberIDList, + } + _, err = c.InsertOne(sCtx, superGroup) + if err != nil { + session.AbortTransaction(ctx) + return utils.Wrap(err, "transaction failed") + } + var users []UserToSuperGroup + for _, v := range initMemberIDList { + users = append(users, UserToSuperGroup{ + UserID: v, + }) + } + upsert := true + opts := &options.UpdateOptions{ + Upsert: &upsert, + } + c = d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cUserToSuperGroup) + //_, err = c.UpdateMany(sCtx, bson.M{"user_id": bson.M{"$in": initMemberIDList}}, bson.M{"$addToSet": bson.M{"group_id_list": groupID}}, opts) + //if err != nil { + // session.AbortTransaction(ctx) + // return utils.Wrap(err, "transaction failed") + //} + for _, userID := range initMemberIDList { + _, err = c.UpdateOne(sCtx, bson.M{"user_id": userID}, bson.M{"$addToSet": bson.M{"group_id_list": groupID}}, opts) + if err != nil { + session.AbortTransaction(ctx) + return utils.Wrap(err, "transaction failed") + } + + } + return err +} + +func (d *DataBases) GetSuperGroup(groupID string) (SuperGroup, error) { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSuperGroup) + superGroup := SuperGroup{} + err := c.FindOne(ctx, bson.M{"group_id": groupID}).Decode(&superGroup) + return superGroup, err +} + +func (d *DataBases) AddUserToSuperGroup(groupID string, userIDList []string) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSuperGroup) + session, err := d.mongoClient.StartSession() + if err != nil { + return utils.Wrap(err, "start session failed") + } + defer session.EndSession(ctx) + sCtx := mongo.NewSessionContext(ctx, session) + if err != nil { + return utils.Wrap(err, "start transaction failed") + } + _, err = c.UpdateOne(sCtx, bson.M{"group_id": groupID}, bson.M{"$addToSet": bson.M{"member_id_list": bson.M{"$each": userIDList}}}) + if err != nil { + session.AbortTransaction(ctx) + return utils.Wrap(err, "transaction failed") + } + c = d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cUserToSuperGroup) + var users []UserToSuperGroup + for _, v := range userIDList { + users = append(users, UserToSuperGroup{ + UserID: v, + }) + } + upsert := true + opts := &options.UpdateOptions{ + Upsert: &upsert, + } + for _, userID := range userIDList { + _, err = c.UpdateOne(sCtx, bson.M{"user_id": userID}, bson.M{"$addToSet": bson.M{"group_id_list": groupID}}, opts) + if err != nil { + session.AbortTransaction(ctx) + return utils.Wrap(err, "transaction failed") + } + } + session.CommitTransaction(ctx) + return err +} + +func (d *DataBases) RemoverUserFromSuperGroup(groupID string, userIDList []string) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSuperGroup) + session, err := d.mongoClient.StartSession() + if err != nil { + return utils.Wrap(err, "start session failed") + } + defer session.EndSession(ctx) + sCtx := mongo.NewSessionContext(ctx, session) + _, err = c.UpdateOne(ctx, bson.M{"group_id": groupID}, bson.M{"$pull": bson.M{"member_id_list": bson.M{"$in": userIDList}}}) + if err != nil { + session.AbortTransaction(ctx) + return utils.Wrap(err, "transaction failed") + } + err = d.RemoveGroupFromUser(ctx, sCtx, groupID, userIDList) + if err != nil { + session.AbortTransaction(ctx) + return utils.Wrap(err, "transaction failed") + } + session.CommitTransaction(ctx) + return err +} + +func (d *DataBases) GetSuperGroupByUserID(userID string) (UserToSuperGroup, error) { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cUserToSuperGroup) + var user UserToSuperGroup + return user, c.FindOne(ctx, bson.M{"user_id": userID}).Decode(&user) +} + +func (d *DataBases) DeleteSuperGroup(groupID string) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSuperGroup) + session, err := d.mongoClient.StartSession() + if err != nil { + return utils.Wrap(err, "start session failed") + } + defer session.EndSession(ctx) + sCtx := mongo.NewSessionContext(ctx, session) + superGroup := &SuperGroup{} + result := c.FindOneAndDelete(sCtx, bson.M{"group_id": groupID}) + err = result.Decode(superGroup) + if err != nil { + session.AbortTransaction(ctx) + return utils.Wrap(err, "transaction failed") + } + if err = d.RemoveGroupFromUser(ctx, sCtx, groupID, superGroup.MemberIDList); err != nil { + session.AbortTransaction(ctx) + return utils.Wrap(err, "transaction failed") + } + session.CommitTransaction(ctx) + return nil +} + +func (d *DataBases) RemoveGroupFromUser(ctx, sCtx context.Context, groupID string, userIDList []string) error { + var users []UserToSuperGroup + for _, v := range userIDList { + users = append(users, UserToSuperGroup{ + UserID: v, + }) + } + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cUserToSuperGroup) + _, err := c.UpdateOne(sCtx, bson.M{"user_id": bson.M{"$in": userIDList}}, bson.M{"$pull": bson.M{"group_id_list": groupID}}) + if err != nil { + return utils.Wrap(err, "UpdateOne transaction failed") + } + return err +} + func generateTagID(tagName, userID string) string { return utils.Md5(tagName + userID + strconv.Itoa(rand.Int()) + time.Now().String()) } @@ -839,12 +1131,34 @@ func generateWorkMomentCommentID(workMomentID string) string { func getCurrentTimestampByMill() int64 { return time.Now().UnixNano() / 1e6 } +func GetCurrentTimestampByMill() int64 { + return time.Now().UnixNano() / 1e6 +} func getSeqUid(uid string, seq uint32) string { seqSuffix := seq / singleGocMsgNum return indexGen(uid, seqSuffix) } +func getSeqUserIDList(userID string, maxSeq uint32) []string { + seqMaxSuffix := maxSeq / singleGocMsgNum + var seqUserIDList []string + for i := 0; i <= int(seqMaxSuffix); i++ { + seqUserID := indexGen(userID, uint32(i)) + seqUserIDList = append(seqUserIDList, seqUserID) + } + return seqUserIDList +} + +func getSeqSuperGroupID(groupID string, seq uint32) string { + seqSuffix := seq / singleGocMsgNum + return superGroupIndexGen(groupID, seqSuffix) +} + +func GetSeqUid(uid string, seq uint32) string { + return getSeqUid(uid, seq) +} + func getMsgIndex(seq uint32) int { seqSuffix := seq / singleGocMsgNum var index uint32 @@ -863,8 +1177,40 @@ func isContainInt32(target uint32, List []uint32) bool { } } return false - } + +func isNotContainInt32(target uint32, List []uint32) bool { + for _, i := range List { + if i == target { + return false + } + } + return true +} + func indexGen(uid string, seqSuffix uint32) string { return uid + ":" + strconv.FormatInt(int64(seqSuffix), 10) } +func superGroupIndexGen(groupID string, seqSuffix uint32) string { + return "super_group_" + groupID + ":" + strconv.FormatInt(int64(seqSuffix), 10) +} + +func (d *DataBases) CleanUpUserMsgFromMongo(userID string, operationID string) error { + ctx := context.Background() + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat) + maxSeq, err := d.GetUserMaxSeq(userID) + if err == redis.Nil { + return nil + } + if err != nil { + return utils.Wrap(err, "") + } + + seqUsers := getSeqUserIDList(userID, uint32(maxSeq)) + log.Error(operationID, "getSeqUserIDList", seqUsers) + _, err = c.DeleteMany(ctx, bson.M{"uid": bson.M{"$in": seqUsers}}) + if err == mongo.ErrNoDocuments { + return nil + } + return utils.Wrap(err, "") +} diff --git a/pkg/common/db/mysql.go b/pkg/common/db/mysql.go index 0f9f4303f..9713537b9 100644 --- a/pkg/common/db/mysql.go +++ b/pkg/common/db/mysql.go @@ -53,7 +53,9 @@ func initMysqlDB() { } fmt.Println("open db ok ", dsn) - db.AutoMigrate(&Friend{}, + db.AutoMigrate( + &Register{}, + &Friend{}, &FriendRequest{}, &Group{}, &GroupMember{}, diff --git a/pkg/common/db/mysql_model/im_mysql_model/demo_model.go b/pkg/common/db/mysql_model/im_mysql_model/demo_model.go index eff3050be..09d04b46d 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/demo_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/demo_model.go @@ -5,21 +5,23 @@ import ( _ "github.com/jinzhu/gorm" ) -func GetRegister(account string) (*db.Register, error) { +func GetRegister(account, areaCode string) (*db.Register, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return nil, err } var r db.Register - return &r, dbConn.Table("registers").Where("account = ?", - account).Take(&r).Error + return &r, dbConn.Table("registers").Where("account = ? or account =? and area_code=?", + account, account, areaCode).Take(&r).Error } -func SetPassword(account, password, ex string) error { +func SetPassword(account, password, ex, userID, areaCode string) error { r := db.Register{ Account: account, Password: password, Ex: ex, + UserID: userID, + AreaCode: areaCode, } dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { diff --git a/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go b/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go index b0cd34ef1..83a59e6d9 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go @@ -142,6 +142,18 @@ func UpdateGroupMemberInfo(groupMemberInfo db.GroupMember) error { return nil } +func UpdateGroupMemberInfoByMap(groupMemberInfo db.GroupMember, m map[string]interface{}) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + err = dbConn.Table("group_members").Where("group_id=? and user_id=?", groupMemberInfo.GroupID, groupMemberInfo.UserID).Updates(m).Error + if err != nil { + return err + } + return nil +} + func GetOwnerManagerByGroupID(groupID string) ([]db.GroupMember, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { diff --git a/pkg/common/db/mysql_model/im_mysql_model/organization_model.go b/pkg/common/db/mysql_model/im_mysql_model/organization_model.go index be06f7f38..52b5bf245 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/organization_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/organization_model.go @@ -16,14 +16,14 @@ func CreateDepartment(department *db.Department) error { return dbConn.Table("departments").Create(department).Error } -func GetDepartment(departmentID string) (error, *db.Department) { +func GetDepartment(departmentID string) (*db.Department, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { - return err, nil + return nil, err } var department db.Department err = dbConn.Table("departments").Where("department_id=?", departmentID).Find(&department).Error - return err, &department + return &department, err } func UpdateDepartment(department *db.Department, args map[string]interface{}) error { @@ -237,6 +237,15 @@ func GetSubDepartmentNum(departmentID string) (error, uint32) { return nil, number } +func SetDepartmentRelatedGroupID(groupID, departmentID string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return utils.Wrap(err, "DefaultGormDB failed") + } + department := &db.Department{RelatedGroupID: groupID} + return dbConn.Model(&department).Where("department_id=?", departmentID).Update(department).Error +} + func GetDepartmentRelatedGroupIDList(departmentIDList []string) ([]string, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { @@ -249,26 +258,32 @@ func GetDepartmentRelatedGroupIDList(departmentIDList []string) ([]string, error func getDepartmentParent(departmentID string, dbConn *gorm.DB) (*db.Department, error) { var department db.Department - var parentID string + var parentDepartment db.Department + //var parentID string dbConn.LogMode(true) - // select * from departments where department_id = (select parent_id from departments where department_id= zx234fd); - err := dbConn.Table("departments").Where("department_id=?", dbConn.Table("departments").Where("department_id=?", departmentID).Pluck("parent_id", parentID)).Find(&department).Error - return &department, err -} - -func GetDepartmentParent(departmentID string, dbConn *gorm.DB, parentIDList []string) (*db.Department, error) { - department, err := getDepartmentParent(departmentID, dbConn) + err := dbConn.Model(&department).Where("department_id=?", departmentID).Select("parent_id").First(&department).Error if err != nil { - return nil, err + return nil, utils.Wrap(err, "") } if department.ParentID != "" { - parentIDList = append(parentIDList, department.ParentID) - _, err = GetDepartmentParent(departmentID, dbConn, parentIDList) + err = dbConn.Model(&parentDepartment).Where("department_id = ?", department.ParentID).Find(&parentDepartment).Error + } + return &parentDepartment, utils.Wrap(err, "") +} + +func GetDepartmentParent(departmentID string, dbConn *gorm.DB, parentIDList *[]string) error { + department, err := getDepartmentParent(departmentID, dbConn) + if err != nil { + return err + } + if department.DepartmentID != "" { + *parentIDList = append(*parentIDList, department.DepartmentID) + err = GetDepartmentParent(department.DepartmentID, dbConn, parentIDList) if err != nil { - return nil, nil + return err } } - return nil, nil + return nil } func GetDepartmentParentIDList(departmentID string) ([]string, error) { @@ -277,6 +292,16 @@ func GetDepartmentParentIDList(departmentID string) ([]string, error) { return nil, err } var parentIDList []string - _, err = GetDepartmentParent(departmentID, dbConn, parentIDList) + err = GetDepartmentParent(departmentID, dbConn, &parentIDList) return parentIDList, err } + +func GetRandomDepartmentID() (string, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return "", err + } + department := &db.Department{} + err = dbConn.Model(department).Order("RAND()").Where("related_group_id != ? AND department_id != ?", "", "0").First(department).Error + return department.DepartmentID, err +} diff --git a/pkg/common/db/mysql_model/im_mysql_model/user_model.go b/pkg/common/db/mysql_model/im_mysql_model/user_model.go index 4f26cecbe..1598bac4e 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/user_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/user_model.go @@ -22,7 +22,11 @@ func init() { } var appMgr db.User appMgr.UserID = v - appMgr.Nickname = "AppManager" + utils.IntToString(k+1) + if k == 0 { + appMgr.Nickname = config.Config.Manager.AppSysNotificationName + } else { + appMgr.Nickname = "AppManager" + utils.IntToString(k+1) + } appMgr.AppMangerLevel = constant.AppAdmin err = UserRegister(appMgr) if err != nil { @@ -103,6 +107,17 @@ func UpdateUserInfo(user db.User) error { } dbConn.LogMode(false) err = dbConn.Table("users").Where("user_id=?", user.UserID).Update(&user).Error + + return err +} + +func UpdateUserInfoByMap(user db.User, m map[string]interface{}) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + dbConn.LogMode(false) + err = dbConn.Table("users").Where("user_id=?", user.UserID).Updates(m).Error return err } diff --git a/pkg/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go b/pkg/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go index 99c099ac4..5f7ef59f7 100644 --- a/pkg/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go +++ b/pkg/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go @@ -26,7 +26,7 @@ func InsertMessageToChatLog(msg pbMsg.MsgDataToMQ) error { chatLog := new(db.ChatLog) copier.Copy(chatLog, msg.MsgData) switch msg.MsgData.SessionType { - case constant.GroupChatType: + case constant.GroupChatType, constant.SuperGroupChatType: chatLog.RecvID = msg.MsgData.GroupID case constant.SingleChatType: chatLog.RecvID = msg.MsgData.RecvID diff --git a/pkg/common/db/redisModel.go b/pkg/common/db/redisModel.go deleted file mode 100644 index 9996ea356..000000000 --- a/pkg/common/db/redisModel.go +++ /dev/null @@ -1,252 +0,0 @@ -package db - -import ( - "Open_IM/pkg/common/constant" - log2 "Open_IM/pkg/common/log" - pbCommon "Open_IM/pkg/proto/sdk_ws" - "encoding/json" - "github.com/garyburd/redigo/redis" -) - -const ( - accountTempCode = "ACCOUNT_TEMP_CODE" - resetPwdTempCode = "RESET_PWD_TEMP_CODE" - userIncrSeq = "REDIS_USER_INCR_SEQ:" // user incr seq - appleDeviceToken = "DEVICE_TOKEN" - userMinSeq = "REDIS_USER_MIN_SEQ:" - uidPidToken = "UID_PID_TOKEN_STATUS:" - conversationReceiveMessageOpt = "CON_RECV_MSG_OPT:" - getuiToken = "GETUI" - userInfoCache = "USER_INFO_CACHE:" - friendRelationCache = "FRIEND_RELATION_CACHE:" - blackListCache = "BLACK_LIST_CACHE:" - groupCache = "GROUP_CACHE:" -) - -func (d *DataBases) Exec(cmd string, key interface{}, args ...interface{}) (interface{}, error) { - con := d.redisPool.Get() - if err := con.Err(); err != nil { - log2.Error("", "", "redis cmd = %v, err = %v", cmd, err) - return nil, err - } - defer con.Close() - - params := make([]interface{}, 0) - params = append(params, key) - - if len(args) > 0 { - for _, v := range args { - params = append(params, v) - } - } - - return con.Do(cmd, params...) -} -func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error) { - key := accountTempCode + account - return redis.Bool(d.Exec("EXISTS", key)) -} -func (d *DataBases) SetAccountCode(account string, code, ttl int) (err error) { - key := accountTempCode + account - _, err = d.Exec("SET", key, code, "ex", ttl) - return err -} -func (d *DataBases) GetAccountCode(account string) (string, error) { - key := accountTempCode + account - return redis.String(d.Exec("GET", key)) -} - -//Perform seq auto-increment operation of user messages -func (d *DataBases) IncrUserSeq(uid string) (uint64, error) { - key := userIncrSeq + uid - return redis.Uint64(d.Exec("INCR", key)) -} - -//Get the largest Seq -func (d *DataBases) GetUserMaxSeq(uid string) (uint64, error) { - key := userIncrSeq + uid - return redis.Uint64(d.Exec("GET", key)) -} - -//Set the user's minimum seq -func (d *DataBases) SetUserMinSeq(uid string, minSeq uint32) (err error) { - key := userMinSeq + uid - _, err = d.Exec("SET", key, minSeq) - return err -} - -//Get the smallest Seq -func (d *DataBases) GetUserMinSeq(uid string) (uint64, error) { - key := userMinSeq + uid - return redis.Uint64(d.Exec("GET", key)) -} - -//Store Apple's device token to redis -func (d *DataBases) SetAppleDeviceToken(accountAddress, value string) (err error) { - key := appleDeviceToken + accountAddress - _, err = d.Exec("SET", key, value) - return err -} - -//Delete Apple device token -func (d *DataBases) DelAppleDeviceToken(accountAddress string) (err error) { - key := appleDeviceToken + accountAddress - _, err = d.Exec("DEL", key) - return err -} - -//Store userid and platform class to redis -func (d *DataBases) AddTokenFlag(userID string, platformID int32, token string, flag int) error { - key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) - log2.NewDebug("", "add token key is ", key) - _, err1 := d.Exec("HSet", key, token, flag) - return err1 -} - -func (d *DataBases) GetTokenMapByUidPid(userID, platformID string) (map[string]int, error) { - key := uidPidToken + userID + ":" + platformID - log2.NewDebug("", "get token key is ", key) - return redis.IntMap(d.Exec("HGETALL", key)) -} -func (d *DataBases) SetTokenMapByUidPid(userID string, platformID int32, m map[string]int) error { - key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) - _, err := d.Exec("hmset", key, redis.Args{}.Add().AddFlat(m)...) - return err -} -func (d *DataBases) DeleteTokenByUidPid(userID string, platformID int32, fields []string) error { - key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) - _, err := d.Exec("HDEL", key, redis.Args{}.Add().AddFlat(fields)...) - return err -} - -func (d *DataBases) SetSingleConversationRecvMsgOpt(userID, conversationID string, opt int32) error { - key := conversationReceiveMessageOpt + userID - _, err := d.Exec("HSet", key, conversationID, opt) - return err -} - -func (d *DataBases) GetSingleConversationRecvMsgOpt(userID, conversationID string) (int, error) { - key := conversationReceiveMessageOpt + userID - return redis.Int(d.Exec("HGet", key, conversationID)) -} -func (d *DataBases) GetAllConversationMsgOpt(userID string) (map[string]int, error) { - key := conversationReceiveMessageOpt + userID - return redis.IntMap(d.Exec("HGETALL", key)) -} -func (d *DataBases) SetMultiConversationMsgOpt(userID string, m map[string]int) error { - key := conversationReceiveMessageOpt + userID - _, err := d.Exec("hmset", key, redis.Args{}.Add().AddFlat(m)...) - return err -} -func (d *DataBases) GetMultiConversationMsgOpt(userID string, conversationIDs []string) (m map[string]int, err error) { - m = make(map[string]int) - key := conversationReceiveMessageOpt + userID - i, err := redis.Ints(d.Exec("hmget", key, redis.Args{}.Add().AddFlat(conversationIDs)...)) - if err != nil { - return m, err - } - for k, v := range conversationIDs { - m[v] = i[k] - } - return m, nil - -} - -func (d *DataBases) SetGetuiToken(token string, expireTime int64) error { - _, err := d.Exec("SET", getuiToken, token, "ex", expireTime) - return err -} - -func (d *DataBases) GetGetuiToken() (string, error) { - result, err := redis.String(d.Exec("GET", getuiToken)) - return result, err -} - -func (d *DataBases) SearchContentType() { - -} - -func (d *DataBases) SetUserInfoToCache(userID string, m map[string]interface{}) error { - _, err := d.Exec("hmset", userInfoCache+userID, redis.Args{}.Add().AddFlat(m)...) - return err -} - -func (d *DataBases) GetUserInfoFromCache(userID string) (*pbCommon.UserInfo, error) { - result, err := redis.String(d.Exec("hgetall", userInfoCache+userID)) - log2.NewInfo("", result) - if err != nil { - return nil, err - } - userInfo := &pbCommon.UserInfo{} - err = json.Unmarshal([]byte(result), userInfo) - return userInfo, err -} - -func (d *DataBases) AddFriendToCache(userID string, friendIDList ...string) error { - var IDList []interface{} - for _, id := range friendIDList { - IDList = append(IDList, id) - } - _, err := d.Exec("SADD", friendRelationCache+userID, IDList...) - return err -} - -func (d *DataBases) ReduceFriendToCache(userID string, friendIDList ...string) error { - var IDList []interface{} - for _, id := range friendIDList { - IDList = append(IDList, id) - } - _, err := d.Exec("SREM", friendRelationCache+userID, IDList...) - return err -} - -func (d *DataBases) GetFriendIDListFromCache(userID string) ([]string, error) { - result, err := redis.Strings(d.Exec("SMEMBERS", friendRelationCache+userID)) - return result, err -} - -func (d *DataBases) AddBlackUserToCache(userID string, blackList ...string) error { - var IDList []interface{} - for _, id := range blackList { - IDList = append(IDList, id) - } - _, err := d.Exec("SADD", blackListCache+userID, IDList...) - return err -} - -func (d *DataBases) ReduceBlackUserFromCache(userID string, blackList ...string) error { - var IDList []interface{} - for _, id := range blackList { - IDList = append(IDList, id) - } - _, err := d.Exec("SREM", blackListCache+userID, IDList...) - return err -} - -func (d *DataBases) GetBlackListFromCache(userID string) ([]string, error) { - result, err := redis.Strings(d.Exec("SMEMBERS", blackListCache+userID)) - return result, err -} - -func (d *DataBases) AddGroupMemberToCache(groupID string, userIDList ...string) error { - var IDList []interface{} - for _, id := range userIDList { - IDList = append(IDList, id) - } - _, err := d.Exec("SADD", groupCache+groupID, IDList...) - return err -} - -func (d *DataBases) ReduceGroupMemberFromCache(groupID string, userIDList ...string) error { - var IDList []interface{} - for _, id := range userIDList { - IDList = append(IDList, id) - } - _, err := d.Exec("SREM", groupCache+groupID, IDList...) - return err -} - -func (d *DataBases) GetGroupMemberIDListFromCache(groupID string) ([]string, error) { - result, err := redis.Strings(d.Exec("SMEMBERS", groupCache+groupID)) - return result, err -} diff --git a/pkg/common/db/redisModel_test.go b/pkg/common/db/redisModel_test.go index 1d9d254b7..cd82aca03 100644 --- a/pkg/common/db/redisModel_test.go +++ b/pkg/common/db/redisModel_test.go @@ -1,6 +1,11 @@ package db import ( + "Open_IM/pkg/common/constant" + pbChat "Open_IM/pkg/proto/chat" + server_api_params "Open_IM/pkg/proto/sdk_ws" + "context" + "flag" "fmt" "github.com/stretchr/testify/assert" "testing" @@ -11,7 +16,8 @@ func Test_SetTokenMapByUidPid(t *testing.T) { m["test1"] = 1 m["test2"] = 2 m["2332"] = 4 - _ = DB.SetTokenMapByUidPid("1234", 2, m) + err := DB.SetTokenMapByUidPid("1234", 2, m) + assert.Nil(t, err) } func Test_GetTokenMapByUidPid(t *testing.T) { @@ -20,8 +26,96 @@ func Test_GetTokenMapByUidPid(t *testing.T) { fmt.Println(m) } -func TestDataBases_GetMultiConversationMsgOpt(t *testing.T) { - m, err := DB.GetMultiConversationMsgOpt("fg", []string{"user", "age", "color"}) +//func TestDataBases_GetMultiConversationMsgOpt(t *testing.T) { +// m, err := DB.GetMultiConversationMsgOpt("fg", []string{"user", "age", "color"}) +// assert.Nil(t, err) +// fmt.Println(m) +//} +func Test_GetKeyTTL(t *testing.T) { + ctx := context.Background() + key := flag.String("key", "key", "key value") + flag.Parse() + ttl, err := DB.rdb.TTL(ctx, *key).Result() assert.Nil(t, err) - fmt.Println(m) + fmt.Println(ttl) +} +func Test_HGetAll(t *testing.T) { + ctx := context.Background() + key := flag.String("key", "key", "key value") + flag.Parse() + ttl, err := DB.rdb.TTL(ctx, *key).Result() + assert.Nil(t, err) + fmt.Println(ttl) +} + +func Test_NewSetMessageToCache(t *testing.T) { + var msg pbChat.MsgDataToMQ + m := make(map[string]bool) + var offlinePush server_api_params.OfflinePushInfo + offlinePush.Title = "3" + offlinePush.Ex = "34" + offlinePush.IOSPushSound = "+1" + offlinePush.IOSBadgeCount = true + m[constant.IsPersistent] = true + m[constant.IsHistory] = true + var data server_api_params.MsgData + uid := "test_uid" + data.Seq = 11 + data.ClientMsgID = "23jwhjsdf" + data.SendID = "111" + data.RecvID = "222" + data.Content = []byte{1, 2, 3, 4, 5, 6, 7} + data.Seq = 1212 + data.Options = m + data.OfflinePushInfo = &offlinePush + data.AtUserIDList = []string{"1212", "23232"} + msg.MsgData = &data + messageList := []*pbChat.MsgDataToMQ{&msg} + err := DB.SetMessageToCache(messageList, uid, "cacheTest") + assert.Nil(t, err) + +} +func Test_NewGetMessageListBySeq(t *testing.T) { + var msg pbChat.MsgDataToMQ + var data server_api_params.MsgData + uid := "test_uid" + data.Seq = 11 + data.ClientMsgID = "23jwhjsdf" + msg.MsgData = &data + + seqMsg, failedSeqList, err := DB.GetMessageListBySeq(uid, []uint32{1212}, "cacheTest") + assert.Nil(t, err) + fmt.Println(seqMsg, failedSeqList) + +} +func Test_SetUserGlobalMsgRecvOpt(t *testing.T) { + var opt int32 + uid := "test_uid" + opt = 1 + err := DB.SetUserGlobalMsgRecvOpt(uid, opt) + assert.Nil(t, err) +} +func Test_GetUserGlobalMsgRecvOpt(t *testing.T) { + uid := "test_uid" + opt, err := DB.GetUserGlobalMsgRecvOpt(uid) + assert.Nil(t, err) + fmt.Println("get opt", opt) +} +func Test_JudgeAccountEXISTS(t *testing.T) { + uid := "test_uid" + b, err := DB.JudgeAccountEXISTS(uid) + assert.Nil(t, err) + fmt.Println(b) +} +func Test_SetAccountCode(t *testing.T) { + uid := "test_uid" + code := 666666 + err := DB.SetAccountCode(uid, code, 100) + assert.Nil(t, err) +} +func Test_GetAccountCode(t *testing.T) { + uid := "test_uid" + code, err := DB.GetAccountCode(uid) + assert.Nil(t, err) + fmt.Println(code) } diff --git a/pkg/common/kafka/consumer_group.go b/pkg/common/kafka/consumer_group.go index 3af714373..6da75972d 100644 --- a/pkg/common/kafka/consumer_group.go +++ b/pkg/common/kafka/consumer_group.go @@ -8,6 +8,7 @@ package kafka import ( "context" + "fmt" "github.com/Shopify/sarama" ) @@ -23,16 +24,13 @@ type MConsumerGroupConfig struct { IsReturnErr bool } -func NewMConsumerGroup(consumerConfig *MConsumerGroupConfig, topics, addr []string, groupID string) *MConsumerGroup { +func NewMConsumerGroup(consumerConfig *MConsumerGroupConfig, topics, addrs []string, groupID string) *MConsumerGroup { config := sarama.NewConfig() config.Version = consumerConfig.KafkaVersion config.Consumer.Offsets.Initial = consumerConfig.OffsetsInitial config.Consumer.Return.Errors = consumerConfig.IsReturnErr - client, err := sarama.NewClient(addr, config) - if err != nil { - panic(err.Error()) - } - consumerGroup, err := sarama.NewConsumerGroupFromClient(groupID, client) + fmt.Println("init address is ", addrs, "topics is ", topics) + consumerGroup, err := sarama.NewConsumerGroup(addrs, groupID, config) if err != nil { panic(err.Error()) } diff --git a/pkg/common/kafka/producer.go b/pkg/common/kafka/producer.go index 98ad92209..1ebaaab10 100644 --- a/pkg/common/kafka/producer.go +++ b/pkg/common/kafka/producer.go @@ -2,6 +2,8 @@ package kafka import ( log2 "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "errors" "github.com/Shopify/sarama" "github.com/golang/protobuf/proto" ) @@ -15,8 +17,9 @@ type Producer struct { func NewKafkaProducer(addr []string, topic string) *Producer { p := Producer{} - p.config = sarama.NewConfig() //Instantiate a sarama Config - p.config.Producer.Return.Successes = true //Whether to enable the successes channel to be notified after the message is sent successfully + p.config = sarama.NewConfig() //Instantiate a sarama Config + p.config.Producer.Return.Successes = true //Whether to enable the successes channel to be notified after the message is sent successfully + p.config.Producer.Return.Errors = true p.config.Producer.RequiredAcks = sarama.WaitForAll //Set producer Message Reply level 0 1 all p.config.Producer.Partitioner = sarama.NewHashPartitioner //Set the hash-key automatic hash partition. When sending a message, you must specify the key value of the message. If there is no key, the partition will be selected randomly @@ -32,18 +35,27 @@ func NewKafkaProducer(addr []string, topic string) *Producer { return &p } -func (p *Producer) SendMessage(m proto.Message, key ...string) (int32, int64, error) { +func (p *Producer) SendMessage(m proto.Message, key string, operationID string) (int32, int64, error) { + log2.Info(operationID, "SendMessage", "key ", key, m.String(), p.producer) kMsg := &sarama.ProducerMessage{} kMsg.Topic = p.topic - if len(key) == 1 { - kMsg.Key = sarama.StringEncoder(key[0]) - } + kMsg.Key = sarama.StringEncoder(key) bMsg, err := proto.Marshal(m) if err != nil { - log2.Error("", "", "proto marshal err = %s", err.Error()) + log2.Error(operationID, "", "proto marshal err = %s", err.Error()) return -1, -1, err } + if len(bMsg) == 0 { + log2.Error(operationID, "len(bMsg) == 0 ") + return 0, 0, errors.New("len(bMsg) == 0 ") + } kMsg.Value = sarama.ByteEncoder(bMsg) - - return p.producer.SendMessage(kMsg) + log2.Info(operationID, "ByteEncoder SendMessage begin", "key ", kMsg, p.producer, "len: ", kMsg.Key.Length(), kMsg.Value.Length()) + if kMsg.Key.Length() == 0 || kMsg.Value.Length() == 0 { + log2.Error(operationID, "kMsg.Key.Length() == 0 || kMsg.Value.Length() == 0 ", kMsg) + return -1, -1, errors.New("key or value == 0") + } + a, b, c := p.producer.SendMessage(kMsg) + log2.Info(operationID, "ByteEncoder SendMessage end", "key ", kMsg.Key.Length(), kMsg.Value.Length(), p.producer) + return a, b, utils.Wrap(c, "") } diff --git a/pkg/common/token_verify/jwt_token.go b/pkg/common/token_verify/jwt_token.go index 363feeedc..476c26a70 100644 --- a/pkg/common/token_verify/jwt_token.go +++ b/pkg/common/token_verify/jwt_token.go @@ -6,7 +6,7 @@ import ( commonDB "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" "Open_IM/pkg/utils" - "github.com/garyburd/redigo/redis" + go_redis "github.com/go-redis/redis/v8" "github.com/golang-jwt/jwt/v4" "time" ) @@ -37,7 +37,26 @@ func BuildClaims(uid, platform string, ttl int64) Claims { }} } -func CreateToken(userID string, platformID int32) (string, int64, error) { +func DeleteToken(userID string, platformID int) error { + m, err := commonDB.DB.GetTokenMapByUidPid(userID, constant.PlatformIDToName(platformID)) + if err != nil && err != go_redis.Nil { + return utils.Wrap(err, "") + } + var deleteTokenKey []string + for k, v := range m { + _, err = GetClaimFromToken(k) + if err != nil || v != constant.NormalToken { + deleteTokenKey = append(deleteTokenKey, k) + } + } + if len(deleteTokenKey) != 0 { + err = commonDB.DB.DeleteTokenByUidPid(userID, platformID, deleteTokenKey) + return utils.Wrap(err, "") + } + return nil +} + +func CreateToken(userID string, platformID int) (string, int64, error) { claims := BuildClaims(userID, constant.PlatformIDToName(platformID), config.Config.TokenPolicy.AccessExpire) token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) tokenString, err := token.SignedString([]byte(config.Config.TokenPolicy.AccessSecret)) @@ -46,7 +65,7 @@ func CreateToken(userID string, platformID int32) (string, int64, error) { } //remove Invalid token m, err := commonDB.DB.GetTokenMapByUidPid(userID, constant.PlatformIDToName(platformID)) - if err != nil && err != redis.ErrNil { + if err != nil && err != go_redis.Nil { return "", 0, err } var deleteTokenKey []string @@ -80,23 +99,23 @@ func GetClaimFromToken(tokensString string) (*Claims, error) { if err != nil { if ve, ok := err.(*jwt.ValidationError); ok { if ve.Errors&jwt.ValidationErrorMalformed != 0 { - return nil, &constant.ErrTokenMalformed + return nil, constant.ErrTokenMalformed } else if ve.Errors&jwt.ValidationErrorExpired != 0 { - return nil, &constant.ErrTokenExpired + return nil, constant.ErrTokenExpired } else if ve.Errors&jwt.ValidationErrorNotValidYet != 0 { - return nil, &constant.ErrTokenNotValidYet + return nil, constant.ErrTokenNotValidYet } else { - return nil, &constant.ErrTokenUnknown + return nil, constant.ErrTokenUnknown } } else { - return nil, &constant.ErrTokenNotValidYet + return nil, constant.ErrTokenNotValidYet } } else { if claims, ok := token.Claims.(*Claims); ok && token.Valid { //log.NewDebug("", claims.UID, claims.Platform) return claims, nil } - return nil, &constant.ErrTokenNotValidYet + return nil, constant.ErrTokenNotValidYet } } @@ -159,37 +178,45 @@ func ParseTokenGetUserID(token string, operationID string) (error, string) { func ParseToken(tokensString, operationID string) (claims *Claims, err error) { claims, err = GetClaimFromToken(tokensString) if err != nil { - log.NewError(operationID, "token validate err", err.Error(), tokensString) + //if errors.Is(err, constant.ErrTokenUnknown) { + // errMsg := "GetClaimFromToken failed ErrTokenUnknown " + err.Error() + // log.Error(operationID, errMsg) + //} + //info := err.(constant.ErrInfo) + //log.Error(operationID, "detail info , ", info.ErrCode, info.ErrMsg) + // + //e := errors.Unwrap(err) + //if errors.Is(e, constant.ErrTokenUnknown) { + // errMsg := "ParseToken failed ErrTokenUnknown " + e.Error() + // log.Error(operationID, errMsg) + //} + return nil, utils.Wrap(err, "") } m, err := commonDB.DB.GetTokenMapByUidPid(claims.UID, claims.Platform) if err != nil { log.NewError(operationID, "get token from redis err", err.Error(), tokensString) - return nil, utils.Wrap(&constant.ErrTokenInvalid, "get token from redis err") + return nil, utils.Wrap(constant.ErrTokenInvalid, "get token from redis err") } if m == nil { - log.NewError(operationID, "get token from redis err", "m is nil", tokensString) - return nil, utils.Wrap(&constant.ErrTokenInvalid, "get token from redis err") + log.NewError(operationID, "get token from redis err, not in redis ", "m is nil", tokensString) + return nil, utils.Wrap(constant.ErrTokenInvalid, "get token from redis err") } if v, ok := m[tokensString]; ok { switch v { case constant.NormalToken: log.NewDebug(operationID, "this is normal return", claims) return claims, nil - case constant.InValidToken: - return nil, utils.Wrap(&constant.ErrTokenInvalid, "") case constant.KickedToken: log.Error(operationID, "this token has been kicked by other same terminal ", constant.ErrTokenKicked) - return nil, utils.Wrap(&constant.ErrTokenKicked, "this token has been kicked by other same terminal ") - case constant.ExpiredToken: - return nil, utils.Wrap(&constant.ErrTokenExpired, "") + return nil, utils.Wrap(constant.ErrTokenKicked, "this token has been kicked by other same terminal ") default: - return nil, utils.Wrap(&constant.ErrTokenUnknown, "") + return nil, utils.Wrap(constant.ErrTokenUnknown, "") } } log.NewError(operationID, "redis token map not find", constant.ErrTokenUnknown) - return nil, utils.Wrap(&constant.ErrTokenUnknown, "redis token map not find") + return nil, utils.Wrap(constant.ErrTokenUnknown, "redis token map not find") } //func MakeTheTokenInvalid(currentClaims *Claims, platformClass string) (bool, error) { @@ -225,16 +252,31 @@ func VerifyToken(token, uid string) (bool, error) { log.NewDebug("", claims.UID, claims.Platform) return true, nil } + func WsVerifyToken(token, uid string, platformID string, operationID string) (bool, error, string) { + argMsg := "args: token: " + token + " operationID: " + operationID + " userID: " + uid + " platformID: " + constant.PlatformIDToName(utils.StringToInt(platformID)) claims, err := ParseToken(token, operationID) if err != nil { - return false, utils.Wrap(err, "parse token err"), "parse token err" + //if errors.Is(err, constant.ErrTokenUnknown) { + // errMsg := "ParseToken failed ErrTokenUnknown " + err.Error() + // log.Error(operationID, errMsg) + //} + //e := errors.Unwrap(err) + //if errors.Is(e, constant.ErrTokenUnknown) { + // errMsg := "ParseToken failed ErrTokenUnknown " + e.Error() + // log.Error(operationID, errMsg) + //} + + errMsg := "parse token err " + err.Error() + argMsg + return false, utils.Wrap(err, errMsg), errMsg } if claims.UID != uid { - return false, utils.Wrap(&constant.ErrTokenUnknown, "uid is not same to token uid"), "uid is not same to token uid" + errMsg := " uid is not same to token uid " + argMsg + " claims.UID: " + claims.UID + return false, utils.Wrap(constant.ErrTokenDifferentUserID, errMsg), errMsg } - if claims.Platform != constant.PlatformIDToName(utils.StringToInt32(platformID)) { - return false, utils.Wrap(&constant.ErrTokenUnknown, "platform is not same to token platform"), "platform is not same to token platform" + if claims.Platform != constant.PlatformIDToName(utils.StringToInt(platformID)) { + errMsg := " platform is not same to token platform " + argMsg + " claims platformID: " + claims.Platform + return false, utils.Wrap(constant.ErrTokenDifferentPlatformID, errMsg), errMsg } log.NewDebug(operationID, utils.GetSelfFuncName(), " check ok ", claims.UID, uid, claims.Platform) return true, nil, "" diff --git a/pkg/grpc-etcdv3/getcdv3/register.go b/pkg/grpc-etcdv3/getcdv3/register.go index af96ffc29..4d9e3ee27 100644 --- a/pkg/grpc-etcdv3/getcdv3/register.go +++ b/pkg/grpc-etcdv3/getcdv3/register.go @@ -2,6 +2,7 @@ package getcdv3 import ( "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" "context" "fmt" clientv3 "go.etcd.io/etcd/client/v3" @@ -38,12 +39,15 @@ func RegisterEtcd4Unique(schema, etcdAddr, myHost string, myPort int, serviceNam //etcdAddr separated by commas func RegisterEtcd(schema, etcdAddr, myHost string, myPort int, serviceName string, ttl int) error { + operationID := utils.OperationIDGenerator() + args := schema + " " + etcdAddr + " " + myHost + " " + serviceName + " " + utils.Int32ToString(int32(myPort)) ttl = ttl * 3 cli, err := clientv3.New(clientv3.Config{ Endpoints: strings.Split(etcdAddr, ","), DialTimeout: 5 * time.Second}) - log.Info("", "RegisterEtcd, ", schema, etcdAddr, myHost, myPort, serviceName, ttl) + log.Info(operationID, "RegisterEtcd args: ", args, ttl) if err != nil { + log.Error(operationID, "clientv3.New failed ", args, ttl, err.Error()) return fmt.Errorf("create etcd clientv3 client failed, errmsg:%v, etcd addr:%s", err, etcdAddr) } @@ -51,8 +55,10 @@ func RegisterEtcd(schema, etcdAddr, myHost string, myPort int, serviceName strin ctx, cancel := context.WithCancel(context.Background()) resp, err := cli.Grant(ctx, int64(ttl)) if err != nil { + log.Error(operationID, "Grant failed ", err.Error(), ctx, ttl) return fmt.Errorf("grant failed") } + log.Info(operationID, "Grant ok, resp ID ", resp.ID) // schema:///serviceName/ip:port ->ip:port serviceValue := net.JoinHostPort(myHost, strconv.Itoa(myPort)) @@ -60,24 +66,26 @@ func RegisterEtcd(schema, etcdAddr, myHost string, myPort int, serviceName strin //set key->value if _, err := cli.Put(ctx, serviceKey, serviceValue, clientv3.WithLease(resp.ID)); err != nil { + log.Error(operationID, "cli.Put failed ", err.Error(), ctx, args, resp.ID) return fmt.Errorf("put failed, errmsg:%v, key:%s, value:%s", err, serviceKey, serviceValue) } //keepalive kresp, err := cli.KeepAlive(ctx, resp.ID) if err != nil { + log.Error(operationID, "KeepAlive failed ", err.Error(), args, resp.ID) return fmt.Errorf("keepalive failed, errmsg:%v, lease id:%d", err, resp.ID) } - //log.Info("", "RegisterEtcd ok ") + log.Info(operationID, "RegisterEtcd ok ", args) go func() { for { select { case pv, ok := <-kresp: if ok == true { - log.Debug("", "KeepAlive kresp ok", pv) + log.Debug(operationID, "KeepAlive kresp ok", pv, args) } else { - log.Error("", "KeepAlive kresp failed", pv) + log.Error(operationID, "KeepAlive kresp failed ", pv, args) t := time.NewTicker(time.Duration(ttl/2) * time.Second) for { select { @@ -86,17 +94,16 @@ func RegisterEtcd(schema, etcdAddr, myHost string, myPort int, serviceName strin ctx, _ := context.WithCancel(context.Background()) resp, err := cli.Grant(ctx, int64(ttl)) if err != nil { - log.Error("", "Grant failed ", err.Error()) + log.Error(operationID, "Grant failed ", err.Error(), args) continue } if _, err := cli.Put(ctx, serviceKey, serviceValue, clientv3.WithLease(resp.ID)); err != nil { - log.Error("", "etcd Put failed ", err.Error(), serviceKey, serviceValue, resp.ID) + log.Error(operationID, "etcd Put failed ", err.Error(), args, " resp ID: ", resp.ID) continue } else { - log.Info("", "etcd Put ok", serviceKey, serviceValue, resp.ID) + log.Info(operationID, "etcd Put ok ", args, " resp ID: ", resp.ID) } - } } } diff --git a/pkg/grpc-etcdv3/getcdv3/resolver.go b/pkg/grpc-etcdv3/getcdv3/resolver.go index 5d7f9e828..b72df5fc9 100644 --- a/pkg/grpc-etcdv3/getcdv3/resolver.go +++ b/pkg/grpc-etcdv3/getcdv3/resolver.go @@ -2,6 +2,7 @@ package getcdv3 import ( "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" "context" "fmt" "go.etcd.io/etcd/api/v3/mvccpb" @@ -32,12 +33,13 @@ var ( rwNameResolverMutex sync.RWMutex ) -func NewResolver(schema, etcdAddr, serviceName string) (*Resolver, error) { +func NewResolver(schema, etcdAddr, serviceName string, operationID string) (*Resolver, error) { etcdCli, err := clientv3.New(clientv3.Config{ Endpoints: strings.Split(etcdAddr, ","), }) if err != nil { - return nil, err + log.Error(operationID, "etcd client v3 failed") + return nil, utils.Wrap(err, "") } var r Resolver @@ -51,18 +53,11 @@ func NewResolver(schema, etcdAddr, serviceName string) (*Resolver, error) { conn, err := grpc.DialContext(ctx, GetPrefix(schema, serviceName), grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, roundrobin.Name)), grpc.WithInsecure()) - log.Debug("", "etcd key ", GetPrefix(schema, serviceName)) - - //conn, err := grpc.Dial( - // GetPrefix(schema, serviceName), - // grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, roundrobin.Name)), - // grpc.WithInsecure(), - // grpc.WithTimeout(time.Duration(5)*time.Second), - //) + log.Debug(operationID, "etcd key ", GetPrefix(schema, serviceName)) if err == nil { r.grpcClientConn = conn } - return &r, err + return &r, utils.Wrap(err, "") } func (r1 *Resolver) ResolveNow(rn resolver.ResolveNowOptions) { @@ -71,12 +66,12 @@ func (r1 *Resolver) ResolveNow(rn resolver.ResolveNowOptions) { func (r1 *Resolver) Close() { } -func GetConn(schema, etcdaddr, serviceName string) *grpc.ClientConn { +func GetConn(schema, etcdaddr, serviceName string, operationID string) *grpc.ClientConn { rwNameResolverMutex.RLock() r, ok := nameResolver[schema+serviceName] rwNameResolverMutex.RUnlock() if ok { - log.Debug("", "etcd key ", schema+serviceName, "value ", *r.grpcClientConn, *r) + log.Debug(operationID, "etcd key ", schema+serviceName, "value ", *r.grpcClientConn, *r) return r.grpcClientConn } @@ -84,18 +79,18 @@ func GetConn(schema, etcdaddr, serviceName string) *grpc.ClientConn { r, ok = nameResolver[schema+serviceName] if ok { rwNameResolverMutex.Unlock() - log.Debug("", "etcd key ", schema+serviceName, "value ", *r.grpcClientConn, *r) + log.Debug(operationID, "etcd key ", schema+serviceName, "value ", *r.grpcClientConn, *r) return r.grpcClientConn } - r, err := NewResolver(schema, etcdaddr, serviceName) + r, err := NewResolver(schema, etcdaddr, serviceName, operationID) if err != nil { - log.Error("", "etcd failed ", schema, etcdaddr, serviceName) + log.Error(operationID, "etcd failed ", schema, etcdaddr, serviceName, err.Error()) rwNameResolverMutex.Unlock() return nil } - log.Debug("", "etcd key ", schema+serviceName, "value ", *r.grpcClientConn, *r) + log.Debug(operationID, "etcd key ", schema+serviceName, "value ", *r.grpcClientConn, *r) nameResolver[schema+serviceName] = r rwNameResolverMutex.Unlock() return r.grpcClientConn @@ -220,7 +215,7 @@ func GetConn4Unique(schema, etcdaddr, servicename string) []*grpc.ClientConn { allConn := make([]*grpc.ClientConn, 0) for _, v := range allService { - r := GetConn(schema, etcdaddr, v) + r := GetConn(schema, etcdaddr, v, "0") allConn = append(allConn, r) } @@ -233,7 +228,7 @@ var ( ) func GetconnFactory(schema, etcdaddr, servicename string) (*grpc.ClientConn, error) { - c := GetConn(schema, etcdaddr, servicename) + c := GetConn(schema, etcdaddr, servicename, "0") if c != nil { return c, nil } else { diff --git a/pkg/proto/auth/auth.pb.go b/pkg/proto/auth/auth.pb.go index 3941570ee..09f54b1f9 100644 --- a/pkg/proto/auth/auth.pb.go +++ b/pkg/proto/auth/auth.pb.go @@ -36,7 +36,7 @@ func (m *CommonResp) Reset() { *m = CommonResp{} } func (m *CommonResp) String() string { return proto.CompactTextString(m) } func (*CommonResp) ProtoMessage() {} func (*CommonResp) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_88965eda3ab7f34d, []int{0} + return fileDescriptor_auth_68293efd650e0000, []int{0} } func (m *CommonResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CommonResp.Unmarshal(m, b) @@ -82,7 +82,7 @@ func (m *UserRegisterReq) Reset() { *m = UserRegisterReq{} } func (m *UserRegisterReq) String() string { return proto.CompactTextString(m) } func (*UserRegisterReq) ProtoMessage() {} func (*UserRegisterReq) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_88965eda3ab7f34d, []int{1} + return fileDescriptor_auth_68293efd650e0000, []int{1} } func (m *UserRegisterReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserRegisterReq.Unmarshal(m, b) @@ -127,7 +127,7 @@ func (m *UserRegisterResp) Reset() { *m = UserRegisterResp{} } func (m *UserRegisterResp) String() string { return proto.CompactTextString(m) } func (*UserRegisterResp) ProtoMessage() {} func (*UserRegisterResp) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_88965eda3ab7f34d, []int{2} + return fileDescriptor_auth_68293efd650e0000, []int{2} } func (m *UserRegisterResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserRegisterResp.Unmarshal(m, b) @@ -168,7 +168,7 @@ func (m *UserTokenReq) Reset() { *m = UserTokenReq{} } func (m *UserTokenReq) String() string { return proto.CompactTextString(m) } func (*UserTokenReq) ProtoMessage() {} func (*UserTokenReq) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_88965eda3ab7f34d, []int{3} + return fileDescriptor_auth_68293efd650e0000, []int{3} } func (m *UserTokenReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserTokenReq.Unmarshal(m, b) @@ -229,7 +229,7 @@ func (m *UserTokenResp) Reset() { *m = UserTokenResp{} } func (m *UserTokenResp) String() string { return proto.CompactTextString(m) } func (*UserTokenResp) ProtoMessage() {} func (*UserTokenResp) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_88965eda3ab7f34d, []int{4} + return fileDescriptor_auth_68293efd650e0000, []int{4} } func (m *UserTokenResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserTokenResp.Unmarshal(m, b) @@ -270,12 +270,114 @@ func (m *UserTokenResp) GetExpiredTime() int64 { return 0 } +type ForceLogoutReq struct { + Platform int32 `protobuf:"varint,1,opt,name=Platform" json:"Platform,omitempty"` + FromUserID string `protobuf:"bytes,2,opt,name=FromUserID" json:"FromUserID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ForceLogoutReq) Reset() { *m = ForceLogoutReq{} } +func (m *ForceLogoutReq) String() string { return proto.CompactTextString(m) } +func (*ForceLogoutReq) ProtoMessage() {} +func (*ForceLogoutReq) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_68293efd650e0000, []int{5} +} +func (m *ForceLogoutReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ForceLogoutReq.Unmarshal(m, b) +} +func (m *ForceLogoutReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ForceLogoutReq.Marshal(b, m, deterministic) +} +func (dst *ForceLogoutReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_ForceLogoutReq.Merge(dst, src) +} +func (m *ForceLogoutReq) XXX_Size() int { + return xxx_messageInfo_ForceLogoutReq.Size(m) +} +func (m *ForceLogoutReq) XXX_DiscardUnknown() { + xxx_messageInfo_ForceLogoutReq.DiscardUnknown(m) +} + +var xxx_messageInfo_ForceLogoutReq proto.InternalMessageInfo + +func (m *ForceLogoutReq) GetPlatform() int32 { + if m != nil { + return m.Platform + } + return 0 +} + +func (m *ForceLogoutReq) GetFromUserID() string { + if m != nil { + return m.FromUserID + } + return "" +} + +func (m *ForceLogoutReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *ForceLogoutReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type ForceLogoutResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ForceLogoutResp) Reset() { *m = ForceLogoutResp{} } +func (m *ForceLogoutResp) String() string { return proto.CompactTextString(m) } +func (*ForceLogoutResp) ProtoMessage() {} +func (*ForceLogoutResp) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_68293efd650e0000, []int{6} +} +func (m *ForceLogoutResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ForceLogoutResp.Unmarshal(m, b) +} +func (m *ForceLogoutResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ForceLogoutResp.Marshal(b, m, deterministic) +} +func (dst *ForceLogoutResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ForceLogoutResp.Merge(dst, src) +} +func (m *ForceLogoutResp) XXX_Size() int { + return xxx_messageInfo_ForceLogoutResp.Size(m) +} +func (m *ForceLogoutResp) XXX_DiscardUnknown() { + xxx_messageInfo_ForceLogoutResp.DiscardUnknown(m) +} + +var xxx_messageInfo_ForceLogoutResp proto.InternalMessageInfo + +func (m *ForceLogoutResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + func init() { proto.RegisterType((*CommonResp)(nil), "pbAuth.CommonResp") proto.RegisterType((*UserRegisterReq)(nil), "pbAuth.UserRegisterReq") proto.RegisterType((*UserRegisterResp)(nil), "pbAuth.UserRegisterResp") proto.RegisterType((*UserTokenReq)(nil), "pbAuth.UserTokenReq") proto.RegisterType((*UserTokenResp)(nil), "pbAuth.UserTokenResp") + proto.RegisterType((*ForceLogoutReq)(nil), "pbAuth.ForceLogoutReq") + proto.RegisterType((*ForceLogoutResp)(nil), "pbAuth.ForceLogoutResp") } // Reference imports to suppress errors if they are not otherwise used. @@ -291,6 +393,7 @@ const _ = grpc.SupportPackageIsVersion4 type AuthClient interface { UserRegister(ctx context.Context, in *UserRegisterReq, opts ...grpc.CallOption) (*UserRegisterResp, error) UserToken(ctx context.Context, in *UserTokenReq, opts ...grpc.CallOption) (*UserTokenResp, error) + ForceLogout(ctx context.Context, in *ForceLogoutReq, opts ...grpc.CallOption) (*ForceLogoutResp, error) } type authClient struct { @@ -319,11 +422,21 @@ func (c *authClient) UserToken(ctx context.Context, in *UserTokenReq, opts ...gr return out, nil } +func (c *authClient) ForceLogout(ctx context.Context, in *ForceLogoutReq, opts ...grpc.CallOption) (*ForceLogoutResp, error) { + out := new(ForceLogoutResp) + err := grpc.Invoke(ctx, "/pbAuth.Auth/ForceLogout", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for Auth service type AuthServer interface { UserRegister(context.Context, *UserRegisterReq) (*UserRegisterResp, error) UserToken(context.Context, *UserTokenReq) (*UserTokenResp, error) + ForceLogout(context.Context, *ForceLogoutReq) (*ForceLogoutResp, error) } func RegisterAuthServer(s *grpc.Server, srv AuthServer) { @@ -366,6 +479,24 @@ func _Auth_UserToken_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +func _Auth_ForceLogout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ForceLogoutReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServer).ForceLogout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbAuth.Auth/ForceLogout", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServer).ForceLogout(ctx, req.(*ForceLogoutReq)) + } + return interceptor(ctx, in, info, handler) +} + var _Auth_serviceDesc = grpc.ServiceDesc{ ServiceName: "pbAuth.Auth", HandlerType: (*AuthServer)(nil), @@ -378,37 +509,44 @@ var _Auth_serviceDesc = grpc.ServiceDesc{ MethodName: "UserToken", Handler: _Auth_UserToken_Handler, }, + { + MethodName: "ForceLogout", + Handler: _Auth_ForceLogout_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "auth/auth.proto", } -func init() { proto.RegisterFile("auth/auth.proto", fileDescriptor_auth_88965eda3ab7f34d) } +func init() { proto.RegisterFile("auth/auth.proto", fileDescriptor_auth_68293efd650e0000) } -var fileDescriptor_auth_88965eda3ab7f34d = []byte{ - // 369 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0x4d, 0x4b, 0xc3, 0x40, - 0x10, 0x25, 0xf6, 0xc3, 0x76, 0x6a, 0xa9, 0x2c, 0x55, 0x43, 0x04, 0xa9, 0x39, 0xf5, 0x94, 0x40, - 0x3d, 0x28, 0x08, 0x42, 0xad, 0x16, 0x7a, 0x28, 0x95, 0xa5, 0x5e, 0xbc, 0x84, 0x94, 0x6e, 0xdb, - 0x90, 0x26, 0xbb, 0xee, 0xa6, 0x56, 0xf0, 0xe8, 0xc5, 0x9f, 0x2d, 0xbb, 0xf9, 0x70, 0xad, 0x3d, - 0x79, 0x49, 0x98, 0x79, 0x2f, 0xf3, 0xde, 0x9b, 0x0c, 0xb4, 0xfc, 0x4d, 0xb2, 0x72, 0xe5, 0xc3, - 0x61, 0x9c, 0x26, 0x14, 0x55, 0xd9, 0xac, 0xbf, 0x49, 0x56, 0xd6, 0xe5, 0x84, 0x91, 0xd8, 0x1b, - 0x8d, 0x5d, 0x16, 0x2e, 0x5d, 0x05, 0xb9, 0x62, 0x1e, 0x7a, 0x5b, 0xe1, 0x6e, 0x45, 0x4a, 0xb5, - 0xef, 0x00, 0x06, 0x34, 0x8a, 0x68, 0x8c, 0x89, 0x60, 0xc8, 0x84, 0x43, 0xc2, 0xf9, 0x80, 0xce, - 0x89, 0x69, 0x74, 0x8c, 0x6e, 0x05, 0xe7, 0x25, 0x3a, 0x85, 0x2a, 0xe1, 0x7c, 0x2c, 0x96, 0xe6, - 0x41, 0xc7, 0xe8, 0xd6, 0x71, 0x56, 0xd9, 0x6b, 0x68, 0x3d, 0x0b, 0xc2, 0x31, 0x59, 0x06, 0x22, - 0x91, 0xef, 0x57, 0x74, 0x0d, 0x35, 0xd9, 0x1a, 0xc5, 0x0b, 0xaa, 0xa6, 0x34, 0x7a, 0xe7, 0x8e, - 0x20, 0xfc, 0x8d, 0x70, 0xcf, 0x67, 0x81, 0xc7, 0x7c, 0xee, 0x47, 0xc2, 0xc9, 0x29, 0xb8, 0x20, - 0xa3, 0x0e, 0x34, 0x26, 0x8c, 0x70, 0x3f, 0x09, 0x68, 0x3c, 0x7a, 0xc8, 0x84, 0xf4, 0x96, 0x3d, - 0x84, 0xe3, 0xdf, 0x6a, 0x82, 0xa1, 0x9e, 0x9e, 0x20, 0x13, 0x44, 0x4e, 0xba, 0x01, 0xe7, 0x07, - 0xc1, 0x1a, 0xcb, 0xfe, 0x32, 0xe0, 0x48, 0x0e, 0x9a, 0xd2, 0x90, 0xc4, 0xd2, 0xb3, 0x05, 0xb5, - 0xa7, 0xb5, 0x9f, 0x2c, 0x28, 0x8f, 0xb2, 0xe4, 0x45, 0x8d, 0x2e, 0x00, 0x86, 0x9c, 0x46, 0xca, - 0x66, 0xee, 0x4a, 0xeb, 0xc8, 0x6f, 0x27, 0x2c, 0x43, 0x4b, 0x0a, 0x2d, 0xea, 0xdd, 0x48, 0xe5, - 0xbf, 0x91, 0x3e, 0xa0, 0xa9, 0x39, 0xf9, 0x5f, 0x1e, 0xd4, 0x86, 0x8a, 0x1a, 0x90, 0xb9, 0x4b, - 0x0b, 0x29, 0xfe, 0xf8, 0xce, 0x02, 0x4e, 0xe6, 0xd3, 0x20, 0x22, 0xca, 0x5b, 0x09, 0xeb, 0xad, - 0xde, 0xa7, 0x01, 0x65, 0x39, 0x17, 0xf5, 0xd3, 0x7d, 0xe4, 0x8b, 0x45, 0x67, 0xb9, 0xe0, 0xce, - 0xcf, 0xb5, 0xcc, 0xfd, 0x80, 0x60, 0xe8, 0x06, 0xea, 0x45, 0x10, 0xd4, 0xd6, 0x69, 0xf9, 0x96, - 0xad, 0x93, 0x3d, 0x5d, 0xc1, 0xee, 0x5b, 0x2f, 0x4d, 0x47, 0x9d, 0xef, 0x6d, 0x0a, 0xcf, 0xaa, - 0xea, 0x36, 0xaf, 0xbe, 0x03, 0x00, 0x00, 0xff, 0xff, 0x1b, 0x20, 0x74, 0x9f, 0xd9, 0x02, 0x00, +var fileDescriptor_auth_68293efd650e0000 = []byte{ + // 417 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x53, 0x5d, 0x8b, 0xda, 0x40, + 0x14, 0x25, 0xf5, 0xa3, 0x7a, 0xad, 0x4d, 0x19, 0xac, 0x86, 0x14, 0x8a, 0xcd, 0x93, 0x4f, 0x09, + 0xd8, 0x87, 0x16, 0x0a, 0x82, 0xb5, 0x0a, 0x42, 0xc5, 0x12, 0xec, 0xcb, 0xbe, 0x84, 0xb8, 0x8e, + 0x31, 0x68, 0x32, 0xb3, 0x33, 0x71, 0x5d, 0xd8, 0x3f, 0xb0, 0xec, 0xdf, 0xda, 0x3f, 0xb6, 0xcc, + 0xe4, 0x63, 0x47, 0xd7, 0x27, 0x5f, 0xf6, 0x25, 0xe1, 0x9e, 0x73, 0x66, 0xee, 0x39, 0x77, 0x66, + 0x40, 0xf7, 0xf7, 0xc9, 0xc6, 0x11, 0x1f, 0x9b, 0x32, 0x92, 0x10, 0x54, 0xa5, 0xcb, 0xe1, 0x3e, + 0xd9, 0x98, 0xdf, 0xe6, 0x14, 0xc7, 0xde, 0x74, 0xe6, 0xd0, 0x6d, 0xe0, 0x48, 0xca, 0xe1, 0xab, + 0xad, 0x77, 0xe0, 0xce, 0x81, 0xa7, 0x52, 0x6b, 0x00, 0x30, 0x22, 0x51, 0x44, 0x62, 0x17, 0x73, + 0x8a, 0x0c, 0x78, 0x8f, 0x19, 0x1b, 0x91, 0x15, 0x36, 0xb4, 0xae, 0xd6, 0xab, 0xb8, 0x79, 0x89, + 0xda, 0x50, 0xc5, 0x8c, 0xcd, 0x78, 0x60, 0xbc, 0xeb, 0x6a, 0xbd, 0xba, 0x9b, 0x55, 0xd6, 0x0e, + 0xf4, 0xff, 0x1c, 0x33, 0x17, 0x07, 0x21, 0x4f, 0xc4, 0xff, 0x06, 0xfd, 0x80, 0x9a, 0x80, 0xa6, + 0xf1, 0x9a, 0xc8, 0x5d, 0x1a, 0xfd, 0x2f, 0x36, 0xc7, 0xec, 0x16, 0x33, 0xcf, 0xa7, 0xa1, 0x47, + 0x7d, 0xe6, 0x47, 0xdc, 0xce, 0x25, 0x6e, 0x21, 0x46, 0x5d, 0x68, 0xcc, 0x29, 0x66, 0x7e, 0x12, + 0x92, 0x78, 0xfa, 0x27, 0x6b, 0xa4, 0x42, 0xd6, 0x04, 0x3e, 0x1d, 0x77, 0xe3, 0x14, 0xf5, 0xd5, + 0x04, 0x59, 0x43, 0x64, 0xa7, 0x13, 0xb0, 0x5f, 0x18, 0x57, 0x51, 0x59, 0x0f, 0x1a, 0x7c, 0x10, + 0x1b, 0x2d, 0xc8, 0x16, 0xc7, 0xc2, 0xb3, 0x09, 0xb5, 0x7f, 0x3b, 0x3f, 0x59, 0x13, 0x16, 0x65, + 0xc9, 0x8b, 0x1a, 0x7d, 0x05, 0x98, 0x30, 0x12, 0x49, 0x9b, 0xb9, 0x2b, 0x05, 0x11, 0x6b, 0xe7, + 0x34, 0x63, 0x4b, 0x92, 0x2d, 0xea, 0xd3, 0x48, 0xe5, 0xd7, 0x91, 0xee, 0xa1, 0xa9, 0x38, 0xb9, + 0x2c, 0x0f, 0x6a, 0x41, 0x45, 0x6e, 0x90, 0xb9, 0x4b, 0x0b, 0xd1, 0x7c, 0x7c, 0x47, 0x43, 0x86, + 0x57, 0x8b, 0x30, 0xc2, 0xd2, 0x5b, 0xc9, 0x55, 0x21, 0xeb, 0x51, 0x83, 0x8f, 0x13, 0xc2, 0xae, + 0xf1, 0x5f, 0x12, 0x90, 0x7d, 0xf2, 0xb6, 0x93, 0x18, 0x83, 0x7e, 0xe4, 0xe5, 0xb2, 0x59, 0xf4, + 0x9f, 0x34, 0x28, 0x0b, 0x1e, 0x0d, 0xd3, 0x33, 0xce, 0x2f, 0x0b, 0xea, 0xe4, 0x0b, 0x4f, 0x2e, + 0xac, 0x69, 0x9c, 0x27, 0x38, 0x45, 0x3f, 0xa1, 0x5e, 0x1c, 0x0e, 0x6a, 0xa9, 0xb2, 0xfc, 0xe6, + 0x98, 0x9f, 0xcf, 0xa0, 0x9c, 0xa2, 0x01, 0x34, 0x94, 0x30, 0xa8, 0x9d, 0xab, 0x8e, 0xa7, 0x6d, + 0x76, 0xce, 0xe2, 0x9c, 0xfe, 0xd6, 0xaf, 0x9a, 0xb6, 0x7c, 0xd2, 0xbf, 0x52, 0xc1, 0xb2, 0x2a, + 0xdf, 0xeb, 0xf7, 0xe7, 0x00, 0x00, 0x00, 0xff, 0xff, 0xed, 0x61, 0xac, 0x2b, 0xed, 0x03, 0x00, 0x00, } diff --git a/pkg/proto/auth/auth.proto b/pkg/proto/auth/auth.proto index c91921fe9..53a14d760 100644 --- a/pkg/proto/auth/auth.proto +++ b/pkg/proto/auth/auth.proto @@ -30,7 +30,23 @@ message UserTokenResp { } + +message ForceLogoutReq { + int32 Platform = 1; + string FromUserID = 2; + string OpUserID = 3; + string OperationID = 4; +} +message ForceLogoutResp { + CommonResp CommonResp = 1; +} + + + + + service Auth { rpc UserRegister(UserRegisterReq) returns(UserRegisterResp); rpc UserToken(UserTokenReq) returns(UserTokenResp); + rpc ForceLogout(ForceLogoutReq) returns(ForceLogoutResp); } diff --git a/pkg/proto/auto_proto.sh b/pkg/proto/auto_proto.sh index 25408d46e..7ecece08e 100644 --- a/pkg/proto/auto_proto.sh +++ b/pkg/proto/auto_proto.sh @@ -4,10 +4,14 @@ source ./proto_dir.cfg for ((i = 0; i < ${#all_proto[*]}; i++)); do proto=${all_proto[$i]} - protoc -I ../../../ -I ./ --go_out=plugins=grpc:. $proto + + protoc -I ../../../ -I ./ --go_out=plugins=grpc:. $proto s=`echo $proto | sed 's/ //g'` v=${s//proto/pb.go} protoc-go-inject-tag -input=./$v echo "protoc --go_out=plugins=grpc:." $proto done echo "proto file generate success..." + +find ./ -type f -path "*.pb.go"|xargs sed -i 's/\".\/sdk_ws\"/\"Open_IM\/pkg\/proto\/sdk_ws\"/g' + diff --git a/pkg/proto/chat/chat.pb.go b/pkg/proto/chat/chat.pb.go index cf1c6ba50..b69f57018 100644 --- a/pkg/proto/chat/chat.pb.go +++ b/pkg/proto/chat/chat.pb.go @@ -37,7 +37,7 @@ func (m *MsgDataToMQ) Reset() { *m = MsgDataToMQ{} } func (m *MsgDataToMQ) String() string { return proto.CompactTextString(m) } func (*MsgDataToMQ) ProtoMessage() {} func (*MsgDataToMQ) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_83f286704599d5b1, []int{0} + return fileDescriptor_chat_64077d68a66b2cfd, []int{0} } func (m *MsgDataToMQ) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgDataToMQ.Unmarshal(m, b) @@ -90,7 +90,7 @@ func (m *MsgDataToDB) Reset() { *m = MsgDataToDB{} } func (m *MsgDataToDB) String() string { return proto.CompactTextString(m) } func (*MsgDataToDB) ProtoMessage() {} func (*MsgDataToDB) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_83f286704599d5b1, []int{1} + return fileDescriptor_chat_64077d68a66b2cfd, []int{1} } func (m *MsgDataToDB) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgDataToDB.Unmarshal(m, b) @@ -137,7 +137,7 @@ func (m *PushMsgDataToMQ) Reset() { *m = PushMsgDataToMQ{} } func (m *PushMsgDataToMQ) String() string { return proto.CompactTextString(m) } func (*PushMsgDataToMQ) ProtoMessage() {} func (*PushMsgDataToMQ) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_83f286704599d5b1, []int{2} + return fileDescriptor_chat_64077d68a66b2cfd, []int{2} } func (m *PushMsgDataToMQ) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PushMsgDataToMQ.Unmarshal(m, b) @@ -178,6 +178,68 @@ func (m *PushMsgDataToMQ) GetPushToUserID() string { return "" } +type MsgDataToMongoByMQ struct { + LastSeq uint64 `protobuf:"varint,1,opt,name=lastSeq" json:"lastSeq,omitempty"` + AggregationID string `protobuf:"bytes,2,opt,name=aggregationID" json:"aggregationID,omitempty"` + MessageList []*MsgDataToMQ `protobuf:"bytes,3,rep,name=messageList" json:"messageList,omitempty"` + TriggerID string `protobuf:"bytes,4,opt,name=triggerID" json:"triggerID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgDataToMongoByMQ) Reset() { *m = MsgDataToMongoByMQ{} } +func (m *MsgDataToMongoByMQ) String() string { return proto.CompactTextString(m) } +func (*MsgDataToMongoByMQ) ProtoMessage() {} +func (*MsgDataToMongoByMQ) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_64077d68a66b2cfd, []int{3} +} +func (m *MsgDataToMongoByMQ) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MsgDataToMongoByMQ.Unmarshal(m, b) +} +func (m *MsgDataToMongoByMQ) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MsgDataToMongoByMQ.Marshal(b, m, deterministic) +} +func (dst *MsgDataToMongoByMQ) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDataToMongoByMQ.Merge(dst, src) +} +func (m *MsgDataToMongoByMQ) XXX_Size() int { + return xxx_messageInfo_MsgDataToMongoByMQ.Size(m) +} +func (m *MsgDataToMongoByMQ) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDataToMongoByMQ.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDataToMongoByMQ proto.InternalMessageInfo + +func (m *MsgDataToMongoByMQ) GetLastSeq() uint64 { + if m != nil { + return m.LastSeq + } + return 0 +} + +func (m *MsgDataToMongoByMQ) GetAggregationID() string { + if m != nil { + return m.AggregationID + } + return "" +} + +func (m *MsgDataToMongoByMQ) GetMessageList() []*MsgDataToMQ { + if m != nil { + return m.MessageList + } + return nil +} + +func (m *MsgDataToMongoByMQ) GetTriggerID() string { + if m != nil { + return m.TriggerID + } + return "" +} + // message PullMessageReq { // string UserID = 1; // int64 SeqBegin = 2; @@ -210,7 +272,7 @@ func (m *GetMaxAndMinSeqReq) Reset() { *m = GetMaxAndMinSeqReq{} } func (m *GetMaxAndMinSeqReq) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqReq) ProtoMessage() {} func (*GetMaxAndMinSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_83f286704599d5b1, []int{3} + return fileDescriptor_chat_64077d68a66b2cfd, []int{4} } func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) @@ -258,7 +320,7 @@ func (m *GetMaxAndMinSeqResp) Reset() { *m = GetMaxAndMinSeqResp{} } func (m *GetMaxAndMinSeqResp) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqResp) ProtoMessage() {} func (*GetMaxAndMinSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_83f286704599d5b1, []int{4} + return fileDescriptor_chat_64077d68a66b2cfd, []int{5} } func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) @@ -319,7 +381,7 @@ func (m *SendMsgReq) Reset() { *m = SendMsgReq{} } func (m *SendMsgReq) String() string { return proto.CompactTextString(m) } func (*SendMsgReq) ProtoMessage() {} func (*SendMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_83f286704599d5b1, []int{5} + return fileDescriptor_chat_64077d68a66b2cfd, []int{6} } func (m *SendMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SendMsgReq.Unmarshal(m, b) @@ -375,7 +437,7 @@ func (m *SendMsgResp) Reset() { *m = SendMsgResp{} } func (m *SendMsgResp) String() string { return proto.CompactTextString(m) } func (*SendMsgResp) ProtoMessage() {} func (*SendMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_83f286704599d5b1, []int{6} + return fileDescriptor_chat_64077d68a66b2cfd, []int{7} } func (m *SendMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SendMsgResp.Unmarshal(m, b) @@ -430,14 +492,117 @@ func (m *SendMsgResp) GetSendTime() int64 { return 0 } +type ClearMsgReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=opUserID" json:"opUserID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ClearMsgReq) Reset() { *m = ClearMsgReq{} } +func (m *ClearMsgReq) String() string { return proto.CompactTextString(m) } +func (*ClearMsgReq) ProtoMessage() {} +func (*ClearMsgReq) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_64077d68a66b2cfd, []int{8} +} +func (m *ClearMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ClearMsgReq.Unmarshal(m, b) +} +func (m *ClearMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ClearMsgReq.Marshal(b, m, deterministic) +} +func (dst *ClearMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClearMsgReq.Merge(dst, src) +} +func (m *ClearMsgReq) XXX_Size() int { + return xxx_messageInfo_ClearMsgReq.Size(m) +} +func (m *ClearMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_ClearMsgReq.DiscardUnknown(m) +} + +var xxx_messageInfo_ClearMsgReq proto.InternalMessageInfo + +func (m *ClearMsgReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *ClearMsgReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *ClearMsgReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type ClearMsgResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ClearMsgResp) Reset() { *m = ClearMsgResp{} } +func (m *ClearMsgResp) String() string { return proto.CompactTextString(m) } +func (*ClearMsgResp) ProtoMessage() {} +func (*ClearMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_64077d68a66b2cfd, []int{9} +} +func (m *ClearMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ClearMsgResp.Unmarshal(m, b) +} +func (m *ClearMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ClearMsgResp.Marshal(b, m, deterministic) +} +func (dst *ClearMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClearMsgResp.Merge(dst, src) +} +func (m *ClearMsgResp) XXX_Size() int { + return xxx_messageInfo_ClearMsgResp.Size(m) +} +func (m *ClearMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_ClearMsgResp.DiscardUnknown(m) +} + +var xxx_messageInfo_ClearMsgResp proto.InternalMessageInfo + +func (m *ClearMsgResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *ClearMsgResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + func init() { proto.RegisterType((*MsgDataToMQ)(nil), "pbChat.MsgDataToMQ") proto.RegisterType((*MsgDataToDB)(nil), "pbChat.MsgDataToDB") proto.RegisterType((*PushMsgDataToMQ)(nil), "pbChat.PushMsgDataToMQ") + proto.RegisterType((*MsgDataToMongoByMQ)(nil), "pbChat.MsgDataToMongoByMQ") proto.RegisterType((*GetMaxAndMinSeqReq)(nil), "pbChat.GetMaxAndMinSeqReq") proto.RegisterType((*GetMaxAndMinSeqResp)(nil), "pbChat.GetMaxAndMinSeqResp") proto.RegisterType((*SendMsgReq)(nil), "pbChat.SendMsgReq") proto.RegisterType((*SendMsgResp)(nil), "pbChat.SendMsgResp") + proto.RegisterType((*ClearMsgReq)(nil), "pbChat.ClearMsgReq") + proto.RegisterType((*ClearMsgResp)(nil), "pbChat.ClearMsgResp") } // Reference imports to suppress errors if they are not otherwise used. @@ -451,10 +616,11 @@ const _ = grpc.SupportPackageIsVersion4 // Client API for Chat service type ChatClient interface { - GetMaxAndMinSeq(ctx context.Context, in *GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*GetMaxAndMinSeqResp, error) + GetMaxAndMinSeq(ctx context.Context, in *sdk_ws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdk_ws.GetMaxAndMinSeqResp, error) PullMessageBySeqList(ctx context.Context, in *sdk_ws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdk_ws.PullMessageBySeqListResp, error) SendMsg(ctx context.Context, in *SendMsgReq, opts ...grpc.CallOption) (*SendMsgResp, error) DelMsgList(ctx context.Context, in *sdk_ws.DelMsgListReq, opts ...grpc.CallOption) (*sdk_ws.DelMsgListResp, error) + ClearMsg(ctx context.Context, in *ClearMsgReq, opts ...grpc.CallOption) (*ClearMsgResp, error) } type chatClient struct { @@ -465,8 +631,8 @@ func NewChatClient(cc *grpc.ClientConn) ChatClient { return &chatClient{cc} } -func (c *chatClient) GetMaxAndMinSeq(ctx context.Context, in *GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*GetMaxAndMinSeqResp, error) { - out := new(GetMaxAndMinSeqResp) +func (c *chatClient) GetMaxAndMinSeq(ctx context.Context, in *sdk_ws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdk_ws.GetMaxAndMinSeqResp, error) { + out := new(sdk_ws.GetMaxAndMinSeqResp) err := grpc.Invoke(ctx, "/pbChat.Chat/GetMaxAndMinSeq", in, out, c.cc, opts...) if err != nil { return nil, err @@ -501,13 +667,23 @@ func (c *chatClient) DelMsgList(ctx context.Context, in *sdk_ws.DelMsgListReq, o return out, nil } +func (c *chatClient) ClearMsg(ctx context.Context, in *ClearMsgReq, opts ...grpc.CallOption) (*ClearMsgResp, error) { + out := new(ClearMsgResp) + err := grpc.Invoke(ctx, "/pbChat.Chat/ClearMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for Chat service type ChatServer interface { - GetMaxAndMinSeq(context.Context, *GetMaxAndMinSeqReq) (*GetMaxAndMinSeqResp, error) + GetMaxAndMinSeq(context.Context, *sdk_ws.GetMaxAndMinSeqReq) (*sdk_ws.GetMaxAndMinSeqResp, error) PullMessageBySeqList(context.Context, *sdk_ws.PullMessageBySeqListReq) (*sdk_ws.PullMessageBySeqListResp, error) SendMsg(context.Context, *SendMsgReq) (*SendMsgResp, error) DelMsgList(context.Context, *sdk_ws.DelMsgListReq) (*sdk_ws.DelMsgListResp, error) + ClearMsg(context.Context, *ClearMsgReq) (*ClearMsgResp, error) } func RegisterChatServer(s *grpc.Server, srv ChatServer) { @@ -515,7 +691,7 @@ func RegisterChatServer(s *grpc.Server, srv ChatServer) { } func _Chat_GetMaxAndMinSeq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMaxAndMinSeqReq) + in := new(sdk_ws.GetMaxAndMinSeqReq) if err := dec(in); err != nil { return nil, err } @@ -527,7 +703,7 @@ func _Chat_GetMaxAndMinSeq_Handler(srv interface{}, ctx context.Context, dec fun FullMethod: "/pbChat.Chat/GetMaxAndMinSeq", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChatServer).GetMaxAndMinSeq(ctx, req.(*GetMaxAndMinSeqReq)) + return srv.(ChatServer).GetMaxAndMinSeq(ctx, req.(*sdk_ws.GetMaxAndMinSeqReq)) } return interceptor(ctx, in, info, handler) } @@ -586,6 +762,24 @@ func _Chat_DelMsgList_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Chat_ClearMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClearMsgReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServer).ClearMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbChat.Chat/ClearMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServer).ClearMsg(ctx, req.(*ClearMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + var _Chat_serviceDesc = grpc.ServiceDesc{ ServiceName: "pbChat.Chat", HandlerType: (*ChatServer)(nil), @@ -606,45 +800,57 @@ var _Chat_serviceDesc = grpc.ServiceDesc{ MethodName: "DelMsgList", Handler: _Chat_DelMsgList_Handler, }, + { + MethodName: "ClearMsg", + Handler: _Chat_ClearMsg_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "chat/chat.proto", } -func init() { proto.RegisterFile("chat/chat.proto", fileDescriptor_chat_83f286704599d5b1) } +func init() { proto.RegisterFile("chat/chat.proto", fileDescriptor_chat_64077d68a66b2cfd) } -var fileDescriptor_chat_83f286704599d5b1 = []byte{ - // 507 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0xcd, 0x6e, 0xda, 0x40, - 0x10, 0x96, 0x49, 0x80, 0x32, 0x34, 0x42, 0xda, 0x44, 0x95, 0xe5, 0x5e, 0x1c, 0x9f, 0x50, 0x2b, - 0x19, 0x89, 0xf6, 0xd6, 0x53, 0x89, 0xa3, 0x8a, 0xaa, 0xdb, 0x24, 0x86, 0x5e, 0x7a, 0x41, 0x9b, - 0x30, 0x32, 0x16, 0x60, 0x2f, 0x3b, 0xa6, 0xa4, 0xed, 0x33, 0xf4, 0x19, 0xfa, 0x3e, 0x7d, 0xaa, - 0xca, 0xbb, 0x26, 0x98, 0x40, 0x15, 0x4e, 0xbd, 0x58, 0x9a, 0x6f, 0x3e, 0x7f, 0x3f, 0xeb, 0x1f, - 0x68, 0xdd, 0x4d, 0x44, 0xd6, 0xc9, 0x2f, 0xbe, 0x54, 0x69, 0x96, 0xb2, 0x9a, 0xbc, 0xbd, 0x98, - 0x88, 0xcc, 0x39, 0xbf, 0x92, 0x98, 0x8c, 0xfa, 0xbc, 0x23, 0xa7, 0x51, 0x47, 0xaf, 0x3a, 0x34, - 0x9e, 0x8e, 0x56, 0xd4, 0x59, 0x91, 0xa1, 0x7a, 0x3f, 0xa1, 0xc9, 0x29, 0x0a, 0x44, 0x26, 0x86, - 0x29, 0xbf, 0x61, 0x67, 0x50, 0xcd, 0xd2, 0x29, 0x26, 0xb6, 0xe5, 0x5a, 0xed, 0x46, 0x68, 0x06, - 0xe6, 0x42, 0x33, 0x95, 0xa8, 0x44, 0x16, 0xa7, 0x49, 0x3f, 0xb0, 0x2b, 0x7a, 0x57, 0x86, 0xd8, - 0x5b, 0xa8, 0xcf, 0x8d, 0x8c, 0x7d, 0xe4, 0x5a, 0xed, 0x66, 0xd7, 0xf1, 0x09, 0xd5, 0x37, 0x54, - 0x23, 0x21, 0xe3, 0x91, 0x14, 0x4a, 0xcc, 0xc9, 0x2f, 0x8c, 0xc2, 0x35, 0xd5, 0xc3, 0x92, 0x79, - 0xd0, 0x2b, 0x8b, 0x58, 0x07, 0x8b, 0x3c, 0x1d, 0xce, 0xfb, 0x65, 0x41, 0xeb, 0x7a, 0x49, 0x93, - 0x72, 0x51, 0x17, 0x9a, 0x57, 0xa5, 0xbb, 0x4c, 0xdd, 0x32, 0x54, 0x4e, 0x53, 0x39, 0x3c, 0x8d, - 0x07, 0xcf, 0xe5, 0x92, 0x26, 0xc3, 0xf4, 0x0b, 0xa1, 0xea, 0x07, 0xfa, 0x34, 0x1a, 0xe1, 0x16, - 0xe6, 0x7d, 0x06, 0xf6, 0x01, 0x33, 0x2e, 0xee, 0xdf, 0x27, 0x63, 0x1e, 0x27, 0x03, 0x5c, 0x84, - 0xb8, 0x60, 0x2f, 0xa0, 0x56, 0xdc, 0x63, 0xc2, 0x14, 0xd3, 0xe3, 0xa4, 0x95, 0x9d, 0xa4, 0xde, - 0x0a, 0x4e, 0x77, 0xf4, 0x48, 0x32, 0x1b, 0xea, 0x97, 0x4a, 0x5d, 0xa4, 0x63, 0xd4, 0x8a, 0xd5, - 0x70, 0x3d, 0xe6, 0x56, 0x97, 0x4a, 0x71, 0x8a, 0x0a, 0xb5, 0x62, 0xca, 0x71, 0x2e, 0xee, 0x07, - 0xb8, 0xd0, 0xb1, 0x4f, 0xc2, 0x62, 0xd2, 0xb8, 0xd6, 0xb5, 0x8f, 0x0b, 0x5c, 0x4f, 0xde, 0x0f, - 0x80, 0x01, 0x26, 0x63, 0x4e, 0x51, 0x5e, 0xe0, 0xff, 0xbe, 0x3b, 0xbf, 0x2d, 0x68, 0x3e, 0x98, - 0x9b, 0xb6, 0xb8, 0xdd, 0x16, 0x37, 0x6d, 0x71, 0xab, 0xad, 0x99, 0xf2, 0x64, 0xc6, 0x87, 0x53, - 0xd4, 0x0f, 0x74, 0xb5, 0x46, 0x58, 0x86, 0x72, 0xc6, 0xdd, 0x2c, 0xc6, 0x24, 0x33, 0x8c, 0xaa, - 0x61, 0x94, 0x20, 0xe6, 0xc0, 0x33, 0xc2, 0x64, 0x3c, 0x8c, 0xe7, 0x68, 0xd7, 0x5c, 0xab, 0x7d, - 0x14, 0x3e, 0xcc, 0xdd, 0x3f, 0x15, 0x38, 0xce, 0x3f, 0x43, 0xf6, 0x11, 0x5a, 0x8f, 0x9e, 0x0f, - 0x73, 0x7c, 0xf3, 0x89, 0xfa, 0xbb, 0x2f, 0x82, 0xf3, 0xf2, 0x9f, 0x3b, 0x92, 0x2c, 0x85, 0xb3, - 0xeb, 0xe5, 0x6c, 0xc6, 0x91, 0x48, 0x44, 0xd8, 0xfb, 0x3e, 0xc0, 0xc5, 0xa7, 0x98, 0x32, 0xf6, - 0x6a, 0xcf, 0x99, 0xed, 0x23, 0xe6, 0x06, 0xaf, 0x0f, 0xe6, 0x92, 0x64, 0x5d, 0xa8, 0x17, 0xc7, - 0xcc, 0xd8, 0x3a, 0xd8, 0xe6, 0xa1, 0x3b, 0xa7, 0x3b, 0x18, 0x49, 0x76, 0x03, 0x10, 0xe0, 0x8c, - 0x53, 0xa4, 0xa3, 0xb9, 0x7b, 0xec, 0x36, 0xeb, 0x5c, 0xe4, 0xfc, 0x09, 0x06, 0xc9, 0x5e, 0xeb, - 0xeb, 0x89, 0xaf, 0x7f, 0x71, 0xef, 0x8c, 0xdf, 0x6d, 0x4d, 0xff, 0xbf, 0xde, 0xfc, 0x0d, 0x00, - 0x00, 0xff, 0xff, 0x6f, 0x9d, 0x6f, 0xa0, 0xfd, 0x04, 0x00, 0x00, +var fileDescriptor_chat_64077d68a66b2cfd = []byte{ + // 636 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x41, 0x6f, 0xda, 0x4c, + 0x10, 0x95, 0x43, 0x42, 0x92, 0x71, 0x22, 0xa4, 0x4d, 0x14, 0x21, 0xf4, 0x1d, 0x1c, 0xeb, 0x6b, + 0x85, 0x5a, 0x09, 0x24, 0xda, 0x9c, 0x7a, 0x69, 0x09, 0x51, 0x15, 0xa9, 0x6e, 0x12, 0x93, 0x5e, + 0x7a, 0xa1, 0x9b, 0x30, 0x5a, 0xac, 0x80, 0xbd, 0xec, 0x98, 0x26, 0x69, 0x7f, 0x43, 0xcf, 0x3d, + 0xf6, 0xdc, 0x7f, 0x59, 0xed, 0xae, 0x01, 0x83, 0x91, 0x82, 0x7a, 0xe8, 0x05, 0xe9, 0xbd, 0x7d, + 0xbc, 0x99, 0x37, 0x3b, 0x2b, 0x43, 0xe5, 0x76, 0xc0, 0xd3, 0xa6, 0xfe, 0x69, 0x48, 0x95, 0xa4, + 0x09, 0x2b, 0xcb, 0x9b, 0xd3, 0x01, 0x4f, 0x6b, 0xc7, 0x17, 0x12, 0xe3, 0xde, 0x79, 0xd0, 0x94, + 0x77, 0xa2, 0x69, 0x8e, 0x9a, 0xd4, 0xbf, 0xeb, 0xdd, 0x53, 0xf3, 0x9e, 0xac, 0xd4, 0xff, 0x0e, + 0x6e, 0x40, 0xa2, 0xc3, 0x53, 0x7e, 0x9d, 0x04, 0x57, 0xec, 0x10, 0xb6, 0xd2, 0xe4, 0x0e, 0xe3, + 0xaa, 0xe3, 0x39, 0xf5, 0xdd, 0xd0, 0x02, 0xe6, 0x81, 0x9b, 0x48, 0x54, 0x3c, 0x8d, 0x92, 0xf8, + 0xbc, 0x53, 0xdd, 0x30, 0x67, 0x79, 0x8a, 0xbd, 0x86, 0xed, 0x91, 0xb5, 0xa9, 0x96, 0x3c, 0xa7, + 0xee, 0xb6, 0x6a, 0x0d, 0x42, 0xf5, 0x15, 0x55, 0x8f, 0xcb, 0xa8, 0x27, 0xb9, 0xe2, 0x23, 0x6a, + 0x64, 0x85, 0xc2, 0xa9, 0xd4, 0xc7, 0x5c, 0xf1, 0x4e, 0x3b, 0x6f, 0xe2, 0xac, 0x6d, 0xf2, 0x74, + 0x73, 0xfe, 0x0f, 0x07, 0x2a, 0x97, 0x13, 0x1a, 0xe4, 0x83, 0x7a, 0xe0, 0x5e, 0xe4, 0xfe, 0x65, + 0xe3, 0xe6, 0xa9, 0x7c, 0x37, 0x1b, 0xeb, 0x77, 0xe3, 0xc3, 0x9e, 0x9c, 0xd0, 0xe0, 0x3a, 0xf9, + 0x44, 0xa8, 0xce, 0x3b, 0x66, 0x1a, 0xbb, 0xe1, 0x02, 0xe7, 0xff, 0x76, 0x80, 0xcd, 0x7b, 0x49, + 0x62, 0x91, 0xb4, 0x1f, 0x83, 0x2b, 0x56, 0x85, 0xed, 0x21, 0xa7, 0xb4, 0x8b, 0x63, 0xd3, 0xce, + 0x66, 0x38, 0x85, 0xec, 0x7f, 0xd8, 0xe7, 0x42, 0x28, 0x14, 0x8b, 0x21, 0x17, 0x49, 0x76, 0x02, + 0xee, 0x08, 0x89, 0xb8, 0xc0, 0x0f, 0x11, 0xa5, 0xd5, 0x92, 0x57, 0xaa, 0xbb, 0xad, 0x83, 0x86, + 0xdd, 0x85, 0x46, 0x2e, 0x7c, 0x98, 0xd7, 0xb1, 0xff, 0x60, 0x37, 0x55, 0x91, 0x10, 0xa6, 0xdd, + 0x4d, 0x63, 0x3c, 0x27, 0xfc, 0x8f, 0xc0, 0xde, 0x63, 0x1a, 0xf0, 0x87, 0x77, 0x71, 0x3f, 0x88, + 0xe2, 0x2e, 0x8e, 0x43, 0x1c, 0xb3, 0x23, 0x28, 0x67, 0xf9, 0xec, 0xe0, 0x32, 0xb4, 0x3c, 0xd5, + 0x8d, 0xc2, 0x54, 0xfd, 0x7b, 0x38, 0x28, 0xf8, 0x91, 0xd4, 0xd9, 0xcf, 0x94, 0x3a, 0x4d, 0xfa, + 0x68, 0x1c, 0xb7, 0xc2, 0x29, 0xd4, 0xa5, 0xce, 0x94, 0x0a, 0x48, 0x64, 0x6e, 0x19, 0xd2, 0x7c, + 0xc0, 0x1f, 0xf4, 0xb0, 0xf4, 0x88, 0xf7, 0xc3, 0x0c, 0x19, 0xde, 0xf8, 0x9a, 0x2c, 0x9a, 0x37, + 0xc8, 0xff, 0x06, 0xd0, 0xc5, 0xb8, 0x1f, 0x90, 0xd0, 0x01, 0xfe, 0xed, 0x9e, 0xff, 0x72, 0xc0, + 0x9d, 0x15, 0xb7, 0x69, 0x71, 0x31, 0x2d, 0xce, 0xd3, 0xe2, 0x42, 0x5a, 0x8b, 0x74, 0x67, 0xb6, + 0x4e, 0x40, 0x62, 0x76, 0x4d, 0x79, 0x4a, 0x2b, 0x6e, 0x87, 0x11, 0xc6, 0xa9, 0x55, 0x6c, 0x59, + 0x45, 0x8e, 0x62, 0x35, 0xd8, 0x21, 0x8c, 0xfb, 0xd7, 0xd1, 0x08, 0xab, 0x65, 0xcf, 0xa9, 0x97, + 0xc2, 0x19, 0xf6, 0x6f, 0xc1, 0x3d, 0x1d, 0x22, 0x57, 0xd9, 0x78, 0x8e, 0xa0, 0x3c, 0x59, 0xb8, + 0x5f, 0x8b, 0xb4, 0x45, 0x22, 0xb3, 0x9b, 0xb7, 0x0d, 0xce, 0xf0, 0xf2, 0xf0, 0x4a, 0xc5, 0x77, + 0xf8, 0x16, 0xf6, 0xe6, 0x45, 0xfe, 0x66, 0x0c, 0xad, 0x9f, 0x25, 0xd8, 0xd4, 0xdb, 0xcc, 0xbe, + 0x40, 0x65, 0x69, 0x8d, 0xd8, 0xb3, 0x15, 0x37, 0x51, 0x5c, 0xdd, 0xda, 0xf3, 0x75, 0x64, 0x24, + 0x59, 0x02, 0x87, 0x97, 0x93, 0xe1, 0x30, 0xb0, 0x2f, 0xa5, 0xfd, 0xd8, 0xc5, 0xb1, 0x79, 0x2e, + 0x2f, 0x56, 0xfc, 0x7f, 0x95, 0x50, 0xd7, 0x7a, 0xb9, 0xb6, 0x96, 0x24, 0x6b, 0xc1, 0x76, 0xb6, + 0x23, 0x8c, 0x4d, 0x1f, 0xed, 0x7c, 0x63, 0x6b, 0x07, 0x05, 0x8e, 0x24, 0xbb, 0x02, 0xe8, 0xe0, + 0x30, 0x20, 0x61, 0x5a, 0xf3, 0x56, 0x94, 0x9b, 0x1f, 0x6b, 0x93, 0xe3, 0x27, 0x14, 0x24, 0xd9, + 0x09, 0xec, 0x4c, 0x2f, 0x89, 0xcd, 0x6a, 0xe6, 0x76, 0xa3, 0x76, 0x58, 0x24, 0x49, 0xb6, 0x2b, + 0x9f, 0xf7, 0x1b, 0xe6, 0x13, 0xf4, 0xc6, 0x9e, 0xde, 0x94, 0xcd, 0xf7, 0xe5, 0xd5, 0x9f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x88, 0x55, 0xa7, 0xa7, 0x9d, 0x06, 0x00, 0x00, } diff --git a/pkg/proto/chat/chat.proto b/pkg/proto/chat/chat.proto index 146994f01..74ea0f396 100644 --- a/pkg/proto/chat/chat.proto +++ b/pkg/proto/chat/chat.proto @@ -22,6 +22,14 @@ message PushMsgDataToMQ{ server_api_params.MsgData msgData = 2; string pushToUserID = 3; } +message MsgDataToMongoByMQ{ + uint64 lastSeq =1; + string aggregationID = 2; + repeated MsgDataToMQ messageList = 3; + string triggerID = 4; + + +} //message PullMessageReq { // string UserID = 1; @@ -69,14 +77,25 @@ message SendMsgResp { string serverMsgID = 4; string clientMsgID = 5; int64 sendTime = 6; - } +message ClearMsgReq{ + string userID = 1; + string opUserID = 2; + string operationID = 3; +} + + +message ClearMsgResp{ + int32 errCode = 1; + string errMsg = 2; +} service Chat { - rpc GetMaxAndMinSeq(GetMaxAndMinSeqReq) returns(GetMaxAndMinSeqResp); + rpc GetMaxAndMinSeq(server_api_params.GetMaxAndMinSeqReq) returns(server_api_params.GetMaxAndMinSeqResp); rpc PullMessageBySeqList(server_api_params.PullMessageBySeqListReq) returns(server_api_params.PullMessageBySeqListResp); rpc SendMsg(SendMsgReq) returns(SendMsgResp); rpc DelMsgList(server_api_params.DelMsgListReq) returns(server_api_params.DelMsgListResp); + rpc ClearMsg(ClearMsgReq) returns(ClearMsgResp); } diff --git a/pkg/proto/group/group.pb.go b/pkg/proto/group/group.pb.go index db8bb328b..265ec66d7 100644 --- a/pkg/proto/group/group.pb.go +++ b/pkg/proto/group/group.pb.go @@ -7,6 +7,7 @@ import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import sdk_ws "Open_IM/pkg/proto/sdk_ws" +import wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" import ( context "golang.org/x/net/context" @@ -36,7 +37,7 @@ func (m *CommonResp) Reset() { *m = CommonResp{} } func (m *CommonResp) String() string { return proto.CompactTextString(m) } func (*CommonResp) ProtoMessage() {} func (*CommonResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{0} + return fileDescriptor_group_40c147a29abb4e60, []int{0} } func (m *CommonResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CommonResp.Unmarshal(m, b) @@ -82,7 +83,7 @@ func (m *GroupAddMemberInfo) Reset() { *m = GroupAddMemberInfo{} } func (m *GroupAddMemberInfo) String() string { return proto.CompactTextString(m) } func (*GroupAddMemberInfo) ProtoMessage() {} func (*GroupAddMemberInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{1} + return fileDescriptor_group_40c147a29abb4e60, []int{1} } func (m *GroupAddMemberInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupAddMemberInfo.Unmarshal(m, b) @@ -131,7 +132,7 @@ func (m *CreateGroupReq) Reset() { *m = CreateGroupReq{} } func (m *CreateGroupReq) String() string { return proto.CompactTextString(m) } func (*CreateGroupReq) ProtoMessage() {} func (*CreateGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{2} + return fileDescriptor_group_40c147a29abb4e60, []int{2} } func (m *CreateGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateGroupReq.Unmarshal(m, b) @@ -199,7 +200,7 @@ func (m *CreateGroupResp) Reset() { *m = CreateGroupResp{} } func (m *CreateGroupResp) String() string { return proto.CompactTextString(m) } func (*CreateGroupResp) ProtoMessage() {} func (*CreateGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{3} + return fileDescriptor_group_40c147a29abb4e60, []int{3} } func (m *CreateGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateGroupResp.Unmarshal(m, b) @@ -253,7 +254,7 @@ func (m *GetGroupsInfoReq) Reset() { *m = GetGroupsInfoReq{} } func (m *GetGroupsInfoReq) String() string { return proto.CompactTextString(m) } func (*GetGroupsInfoReq) ProtoMessage() {} func (*GetGroupsInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{4} + return fileDescriptor_group_40c147a29abb4e60, []int{4} } func (m *GetGroupsInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupsInfoReq.Unmarshal(m, b) @@ -307,7 +308,7 @@ func (m *GetGroupsInfoResp) Reset() { *m = GetGroupsInfoResp{} } func (m *GetGroupsInfoResp) String() string { return proto.CompactTextString(m) } func (*GetGroupsInfoResp) ProtoMessage() {} func (*GetGroupsInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{5} + return fileDescriptor_group_40c147a29abb4e60, []int{5} } func (m *GetGroupsInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupsInfoResp.Unmarshal(m, b) @@ -349,19 +350,19 @@ func (m *GetGroupsInfoResp) GetGroupInfoList() []*sdk_ws.GroupInfo { } type SetGroupInfoReq struct { - GroupInfo *sdk_ws.GroupInfo `protobuf:"bytes,1,opt,name=GroupInfo" json:"GroupInfo,omitempty"` - OpUserID string `protobuf:"bytes,2,opt,name=OpUserID" json:"OpUserID,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + GroupInfoForSet *sdk_ws.GroupInfoForSet `protobuf:"bytes,1,opt,name=groupInfoForSet" json:"groupInfoForSet,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *SetGroupInfoReq) Reset() { *m = SetGroupInfoReq{} } func (m *SetGroupInfoReq) String() string { return proto.CompactTextString(m) } func (*SetGroupInfoReq) ProtoMessage() {} func (*SetGroupInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{6} + return fileDescriptor_group_40c147a29abb4e60, []int{6} } func (m *SetGroupInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetGroupInfoReq.Unmarshal(m, b) @@ -381,9 +382,9 @@ func (m *SetGroupInfoReq) XXX_DiscardUnknown() { var xxx_messageInfo_SetGroupInfoReq proto.InternalMessageInfo -func (m *SetGroupInfoReq) GetGroupInfo() *sdk_ws.GroupInfo { +func (m *SetGroupInfoReq) GetGroupInfoForSet() *sdk_ws.GroupInfoForSet { if m != nil { - return m.GroupInfo + return m.GroupInfoForSet } return nil } @@ -413,7 +414,7 @@ func (m *SetGroupInfoResp) Reset() { *m = SetGroupInfoResp{} } func (m *SetGroupInfoResp) String() string { return proto.CompactTextString(m) } func (*SetGroupInfoResp) ProtoMessage() {} func (*SetGroupInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{7} + return fileDescriptor_group_40c147a29abb4e60, []int{7} } func (m *SetGroupInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetGroupInfoResp.Unmarshal(m, b) @@ -453,7 +454,7 @@ func (m *GetGroupApplicationListReq) Reset() { *m = GetGroupApplicationL func (m *GetGroupApplicationListReq) String() string { return proto.CompactTextString(m) } func (*GetGroupApplicationListReq) ProtoMessage() {} func (*GetGroupApplicationListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{8} + return fileDescriptor_group_40c147a29abb4e60, []int{8} } func (m *GetGroupApplicationListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupApplicationListReq.Unmarshal(m, b) @@ -507,7 +508,7 @@ func (m *GetGroupApplicationListResp) Reset() { *m = GetGroupApplication func (m *GetGroupApplicationListResp) String() string { return proto.CompactTextString(m) } func (*GetGroupApplicationListResp) ProtoMessage() {} func (*GetGroupApplicationListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{9} + return fileDescriptor_group_40c147a29abb4e60, []int{9} } func (m *GetGroupApplicationListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupApplicationListResp.Unmarshal(m, b) @@ -561,7 +562,7 @@ func (m *GetUserReqApplicationListReq) Reset() { *m = GetUserReqApplicat func (m *GetUserReqApplicationListReq) String() string { return proto.CompactTextString(m) } func (*GetUserReqApplicationListReq) ProtoMessage() {} func (*GetUserReqApplicationListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{10} + return fileDescriptor_group_40c147a29abb4e60, []int{10} } func (m *GetUserReqApplicationListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserReqApplicationListReq.Unmarshal(m, b) @@ -614,7 +615,7 @@ func (m *GetUserReqApplicationListResp) Reset() { *m = GetUserReqApplica func (m *GetUserReqApplicationListResp) String() string { return proto.CompactTextString(m) } func (*GetUserReqApplicationListResp) ProtoMessage() {} func (*GetUserReqApplicationListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{11} + return fileDescriptor_group_40c147a29abb4e60, []int{11} } func (m *GetUserReqApplicationListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserReqApplicationListResp.Unmarshal(m, b) @@ -663,7 +664,7 @@ func (m *TransferGroupOwnerReq) Reset() { *m = TransferGroupOwnerReq{} } func (m *TransferGroupOwnerReq) String() string { return proto.CompactTextString(m) } func (*TransferGroupOwnerReq) ProtoMessage() {} func (*TransferGroupOwnerReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{12} + return fileDescriptor_group_40c147a29abb4e60, []int{12} } func (m *TransferGroupOwnerReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TransferGroupOwnerReq.Unmarshal(m, b) @@ -729,7 +730,7 @@ func (m *TransferGroupOwnerResp) Reset() { *m = TransferGroupOwnerResp{} func (m *TransferGroupOwnerResp) String() string { return proto.CompactTextString(m) } func (*TransferGroupOwnerResp) ProtoMessage() {} func (*TransferGroupOwnerResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{13} + return fileDescriptor_group_40c147a29abb4e60, []int{13} } func (m *TransferGroupOwnerResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TransferGroupOwnerResp.Unmarshal(m, b) @@ -770,7 +771,7 @@ func (m *JoinGroupReq) Reset() { *m = JoinGroupReq{} } func (m *JoinGroupReq) String() string { return proto.CompactTextString(m) } func (*JoinGroupReq) ProtoMessage() {} func (*JoinGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{14} + return fileDescriptor_group_40c147a29abb4e60, []int{14} } func (m *JoinGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_JoinGroupReq.Unmarshal(m, b) @@ -829,7 +830,7 @@ func (m *JoinGroupResp) Reset() { *m = JoinGroupResp{} } func (m *JoinGroupResp) String() string { return proto.CompactTextString(m) } func (*JoinGroupResp) ProtoMessage() {} func (*JoinGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{15} + return fileDescriptor_group_40c147a29abb4e60, []int{15} } func (m *JoinGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_JoinGroupResp.Unmarshal(m, b) @@ -872,7 +873,7 @@ func (m *GroupApplicationResponseReq) Reset() { *m = GroupApplicationRes func (m *GroupApplicationResponseReq) String() string { return proto.CompactTextString(m) } func (*GroupApplicationResponseReq) ProtoMessage() {} func (*GroupApplicationResponseReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{16} + return fileDescriptor_group_40c147a29abb4e60, []int{16} } func (m *GroupApplicationResponseReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupApplicationResponseReq.Unmarshal(m, b) @@ -945,7 +946,7 @@ func (m *GroupApplicationResponseResp) Reset() { *m = GroupApplicationRe func (m *GroupApplicationResponseResp) String() string { return proto.CompactTextString(m) } func (*GroupApplicationResponseResp) ProtoMessage() {} func (*GroupApplicationResponseResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{17} + return fileDescriptor_group_40c147a29abb4e60, []int{17} } func (m *GroupApplicationResponseResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupApplicationResponseResp.Unmarshal(m, b) @@ -985,7 +986,7 @@ func (m *QuitGroupReq) Reset() { *m = QuitGroupReq{} } func (m *QuitGroupReq) String() string { return proto.CompactTextString(m) } func (*QuitGroupReq) ProtoMessage() {} func (*QuitGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{18} + return fileDescriptor_group_40c147a29abb4e60, []int{18} } func (m *QuitGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_QuitGroupReq.Unmarshal(m, b) @@ -1037,7 +1038,7 @@ func (m *QuitGroupResp) Reset() { *m = QuitGroupResp{} } func (m *QuitGroupResp) String() string { return proto.CompactTextString(m) } func (*QuitGroupResp) ProtoMessage() {} func (*QuitGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{19} + return fileDescriptor_group_40c147a29abb4e60, []int{19} } func (m *QuitGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_QuitGroupResp.Unmarshal(m, b) @@ -1079,7 +1080,7 @@ func (m *GetGroupMemberListReq) Reset() { *m = GetGroupMemberListReq{} } func (m *GetGroupMemberListReq) String() string { return proto.CompactTextString(m) } func (*GetGroupMemberListReq) ProtoMessage() {} func (*GetGroupMemberListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{20} + return fileDescriptor_group_40c147a29abb4e60, []int{20} } func (m *GetGroupMemberListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMemberListReq.Unmarshal(m, b) @@ -1148,7 +1149,7 @@ func (m *GetGroupMemberListResp) Reset() { *m = GetGroupMemberListResp{} func (m *GetGroupMemberListResp) String() string { return proto.CompactTextString(m) } func (*GetGroupMemberListResp) ProtoMessage() {} func (*GetGroupMemberListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{21} + return fileDescriptor_group_40c147a29abb4e60, []int{21} } func (m *GetGroupMemberListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMemberListResp.Unmarshal(m, b) @@ -1210,7 +1211,7 @@ func (m *GetGroupMembersInfoReq) Reset() { *m = GetGroupMembersInfoReq{} func (m *GetGroupMembersInfoReq) String() string { return proto.CompactTextString(m) } func (*GetGroupMembersInfoReq) ProtoMessage() {} func (*GetGroupMembersInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{22} + return fileDescriptor_group_40c147a29abb4e60, []int{22} } func (m *GetGroupMembersInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMembersInfoReq.Unmarshal(m, b) @@ -1271,7 +1272,7 @@ func (m *GetGroupMembersInfoResp) Reset() { *m = GetGroupMembersInfoResp func (m *GetGroupMembersInfoResp) String() string { return proto.CompactTextString(m) } func (*GetGroupMembersInfoResp) ProtoMessage() {} func (*GetGroupMembersInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{23} + return fileDescriptor_group_40c147a29abb4e60, []int{23} } func (m *GetGroupMembersInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMembersInfoResp.Unmarshal(m, b) @@ -1327,7 +1328,7 @@ func (m *KickGroupMemberReq) Reset() { *m = KickGroupMemberReq{} } func (m *KickGroupMemberReq) String() string { return proto.CompactTextString(m) } func (*KickGroupMemberReq) ProtoMessage() {} func (*KickGroupMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{24} + return fileDescriptor_group_40c147a29abb4e60, []int{24} } func (m *KickGroupMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KickGroupMemberReq.Unmarshal(m, b) @@ -1394,7 +1395,7 @@ func (m *Id2Result) Reset() { *m = Id2Result{} } func (m *Id2Result) String() string { return proto.CompactTextString(m) } func (*Id2Result) ProtoMessage() {} func (*Id2Result) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{25} + return fileDescriptor_group_40c147a29abb4e60, []int{25} } func (m *Id2Result) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Id2Result.Unmarshal(m, b) @@ -1441,7 +1442,7 @@ func (m *KickGroupMemberResp) Reset() { *m = KickGroupMemberResp{} } func (m *KickGroupMemberResp) String() string { return proto.CompactTextString(m) } func (*KickGroupMemberResp) ProtoMessage() {} func (*KickGroupMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{26} + return fileDescriptor_group_40c147a29abb4e60, []int{26} } func (m *KickGroupMemberResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KickGroupMemberResp.Unmarshal(m, b) @@ -1495,7 +1496,7 @@ func (m *GetJoinedGroupListReq) Reset() { *m = GetJoinedGroupListReq{} } func (m *GetJoinedGroupListReq) String() string { return proto.CompactTextString(m) } func (*GetJoinedGroupListReq) ProtoMessage() {} func (*GetJoinedGroupListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{27} + return fileDescriptor_group_40c147a29abb4e60, []int{27} } func (m *GetJoinedGroupListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetJoinedGroupListReq.Unmarshal(m, b) @@ -1549,7 +1550,7 @@ func (m *GetJoinedGroupListResp) Reset() { *m = GetJoinedGroupListResp{} func (m *GetJoinedGroupListResp) String() string { return proto.CompactTextString(m) } func (*GetJoinedGroupListResp) ProtoMessage() {} func (*GetJoinedGroupListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{28} + return fileDescriptor_group_40c147a29abb4e60, []int{28} } func (m *GetJoinedGroupListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetJoinedGroupListResp.Unmarshal(m, b) @@ -1605,7 +1606,7 @@ func (m *InviteUserToGroupReq) Reset() { *m = InviteUserToGroupReq{} } func (m *InviteUserToGroupReq) String() string { return proto.CompactTextString(m) } func (*InviteUserToGroupReq) ProtoMessage() {} func (*InviteUserToGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{29} + return fileDescriptor_group_40c147a29abb4e60, []int{29} } func (m *InviteUserToGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InviteUserToGroupReq.Unmarshal(m, b) @@ -1673,7 +1674,7 @@ func (m *InviteUserToGroupResp) Reset() { *m = InviteUserToGroupResp{} } func (m *InviteUserToGroupResp) String() string { return proto.CompactTextString(m) } func (*InviteUserToGroupResp) ProtoMessage() {} func (*InviteUserToGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{30} + return fileDescriptor_group_40c147a29abb4e60, []int{30} } func (m *InviteUserToGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InviteUserToGroupResp.Unmarshal(m, b) @@ -1727,7 +1728,7 @@ func (m *GetGroupAllMemberReq) Reset() { *m = GetGroupAllMemberReq{} } func (m *GetGroupAllMemberReq) String() string { return proto.CompactTextString(m) } func (*GetGroupAllMemberReq) ProtoMessage() {} func (*GetGroupAllMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{31} + return fileDescriptor_group_40c147a29abb4e60, []int{31} } func (m *GetGroupAllMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupAllMemberReq.Unmarshal(m, b) @@ -1781,7 +1782,7 @@ func (m *GetGroupAllMemberResp) Reset() { *m = GetGroupAllMemberResp{} } func (m *GetGroupAllMemberResp) String() string { return proto.CompactTextString(m) } func (*GetGroupAllMemberResp) ProtoMessage() {} func (*GetGroupAllMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{32} + return fileDescriptor_group_40c147a29abb4e60, []int{32} } func (m *GetGroupAllMemberResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupAllMemberResp.Unmarshal(m, b) @@ -1835,7 +1836,7 @@ func (m *CMSGroup) Reset() { *m = CMSGroup{} } func (m *CMSGroup) String() string { return proto.CompactTextString(m) } func (*CMSGroup) ProtoMessage() {} func (*CMSGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{33} + return fileDescriptor_group_40c147a29abb4e60, []int{33} } func (m *CMSGroup) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CMSGroup.Unmarshal(m, b) @@ -1889,7 +1890,7 @@ func (m *GetGroupReq) Reset() { *m = GetGroupReq{} } func (m *GetGroupReq) String() string { return proto.CompactTextString(m) } func (*GetGroupReq) ProtoMessage() {} func (*GetGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{34} + return fileDescriptor_group_40c147a29abb4e60, []int{34} } func (m *GetGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupReq.Unmarshal(m, b) @@ -1943,7 +1944,7 @@ func (m *GetGroupResp) Reset() { *m = GetGroupResp{} } func (m *GetGroupResp) String() string { return proto.CompactTextString(m) } func (*GetGroupResp) ProtoMessage() {} func (*GetGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{35} + return fileDescriptor_group_40c147a29abb4e60, []int{35} } func (m *GetGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupResp.Unmarshal(m, b) @@ -1996,7 +1997,7 @@ func (m *GetGroupsReq) Reset() { *m = GetGroupsReq{} } func (m *GetGroupsReq) String() string { return proto.CompactTextString(m) } func (*GetGroupsReq) ProtoMessage() {} func (*GetGroupsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{36} + return fileDescriptor_group_40c147a29abb4e60, []int{36} } func (m *GetGroupsReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupsReq.Unmarshal(m, b) @@ -2043,7 +2044,7 @@ func (m *GetGroupsResp) Reset() { *m = GetGroupsResp{} } func (m *GetGroupsResp) String() string { return proto.CompactTextString(m) } func (*GetGroupsResp) ProtoMessage() {} func (*GetGroupsResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{37} + return fileDescriptor_group_40c147a29abb4e60, []int{37} } func (m *GetGroupsResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupsResp.Unmarshal(m, b) @@ -2096,7 +2097,7 @@ func (m *GetGroupMemberReq) Reset() { *m = GetGroupMemberReq{} } func (m *GetGroupMemberReq) String() string { return proto.CompactTextString(m) } func (*GetGroupMemberReq) ProtoMessage() {} func (*GetGroupMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{38} + return fileDescriptor_group_40c147a29abb4e60, []int{38} } func (m *GetGroupMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMemberReq.Unmarshal(m, b) @@ -2143,7 +2144,7 @@ func (m *OperateGroupStatusReq) Reset() { *m = OperateGroupStatusReq{} } func (m *OperateGroupStatusReq) String() string { return proto.CompactTextString(m) } func (*OperateGroupStatusReq) ProtoMessage() {} func (*OperateGroupStatusReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{39} + return fileDescriptor_group_40c147a29abb4e60, []int{39} } func (m *OperateGroupStatusReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OperateGroupStatusReq.Unmarshal(m, b) @@ -2194,7 +2195,7 @@ func (m *OperateGroupStatusResp) Reset() { *m = OperateGroupStatusResp{} func (m *OperateGroupStatusResp) String() string { return proto.CompactTextString(m) } func (*OperateGroupStatusResp) ProtoMessage() {} func (*OperateGroupStatusResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{40} + return fileDescriptor_group_40c147a29abb4e60, []int{40} } func (m *OperateGroupStatusResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OperateGroupStatusResp.Unmarshal(m, b) @@ -2228,7 +2229,7 @@ func (m *OperateUserRoleReq) Reset() { *m = OperateUserRoleReq{} } func (m *OperateUserRoleReq) String() string { return proto.CompactTextString(m) } func (*OperateUserRoleReq) ProtoMessage() {} func (*OperateUserRoleReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{41} + return fileDescriptor_group_40c147a29abb4e60, []int{41} } func (m *OperateUserRoleReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OperateUserRoleReq.Unmarshal(m, b) @@ -2286,7 +2287,7 @@ func (m *OperateUserRoleResp) Reset() { *m = OperateUserRoleResp{} } func (m *OperateUserRoleResp) String() string { return proto.CompactTextString(m) } func (*OperateUserRoleResp) ProtoMessage() {} func (*OperateUserRoleResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{42} + return fileDescriptor_group_40c147a29abb4e60, []int{42} } func (m *OperateUserRoleResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OperateUserRoleResp.Unmarshal(m, b) @@ -2318,7 +2319,7 @@ func (m *DeleteGroupReq) Reset() { *m = DeleteGroupReq{} } func (m *DeleteGroupReq) String() string { return proto.CompactTextString(m) } func (*DeleteGroupReq) ProtoMessage() {} func (*DeleteGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{43} + return fileDescriptor_group_40c147a29abb4e60, []int{43} } func (m *DeleteGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteGroupReq.Unmarshal(m, b) @@ -2362,7 +2363,7 @@ func (m *DeleteGroupResp) Reset() { *m = DeleteGroupResp{} } func (m *DeleteGroupResp) String() string { return proto.CompactTextString(m) } func (*DeleteGroupResp) ProtoMessage() {} func (*DeleteGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{44} + return fileDescriptor_group_40c147a29abb4e60, []int{44} } func (m *DeleteGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteGroupResp.Unmarshal(m, b) @@ -2394,7 +2395,7 @@ func (m *GetGroupByIdReq) Reset() { *m = GetGroupByIdReq{} } func (m *GetGroupByIdReq) String() string { return proto.CompactTextString(m) } func (*GetGroupByIdReq) ProtoMessage() {} func (*GetGroupByIdReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{45} + return fileDescriptor_group_40c147a29abb4e60, []int{45} } func (m *GetGroupByIdReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupByIdReq.Unmarshal(m, b) @@ -2439,7 +2440,7 @@ func (m *GetGroupByIdResp) Reset() { *m = GetGroupByIdResp{} } func (m *GetGroupByIdResp) String() string { return proto.CompactTextString(m) } func (*GetGroupByIdResp) ProtoMessage() {} func (*GetGroupByIdResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{46} + return fileDescriptor_group_40c147a29abb4e60, []int{46} } func (m *GetGroupByIdResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupByIdResp.Unmarshal(m, b) @@ -2480,7 +2481,7 @@ func (m *GetGroupMembersCMSReq) Reset() { *m = GetGroupMembersCMSReq{} } func (m *GetGroupMembersCMSReq) String() string { return proto.CompactTextString(m) } func (*GetGroupMembersCMSReq) ProtoMessage() {} func (*GetGroupMembersCMSReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{47} + return fileDescriptor_group_40c147a29abb4e60, []int{47} } func (m *GetGroupMembersCMSReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMembersCMSReq.Unmarshal(m, b) @@ -2541,7 +2542,7 @@ func (m *GetGroupMembersCMSResp) Reset() { *m = GetGroupMembersCMSResp{} func (m *GetGroupMembersCMSResp) String() string { return proto.CompactTextString(m) } func (*GetGroupMembersCMSResp) ProtoMessage() {} func (*GetGroupMembersCMSResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{48} + return fileDescriptor_group_40c147a29abb4e60, []int{48} } func (m *GetGroupMembersCMSResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMembersCMSResp.Unmarshal(m, b) @@ -2596,7 +2597,7 @@ func (m *RemoveGroupMembersCMSReq) Reset() { *m = RemoveGroupMembersCMSR func (m *RemoveGroupMembersCMSReq) String() string { return proto.CompactTextString(m) } func (*RemoveGroupMembersCMSReq) ProtoMessage() {} func (*RemoveGroupMembersCMSReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{49} + return fileDescriptor_group_40c147a29abb4e60, []int{49} } func (m *RemoveGroupMembersCMSReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RemoveGroupMembersCMSReq.Unmarshal(m, b) @@ -2656,7 +2657,7 @@ func (m *RemoveGroupMembersCMSResp) Reset() { *m = RemoveGroupMembersCMS func (m *RemoveGroupMembersCMSResp) String() string { return proto.CompactTextString(m) } func (*RemoveGroupMembersCMSResp) ProtoMessage() {} func (*RemoveGroupMembersCMSResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{50} + return fileDescriptor_group_40c147a29abb4e60, []int{50} } func (m *RemoveGroupMembersCMSResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RemoveGroupMembersCMSResp.Unmarshal(m, b) @@ -2704,7 +2705,7 @@ func (m *AddGroupMembersCMSReq) Reset() { *m = AddGroupMembersCMSReq{} } func (m *AddGroupMembersCMSReq) String() string { return proto.CompactTextString(m) } func (*AddGroupMembersCMSReq) ProtoMessage() {} func (*AddGroupMembersCMSReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{51} + return fileDescriptor_group_40c147a29abb4e60, []int{51} } func (m *AddGroupMembersCMSReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddGroupMembersCMSReq.Unmarshal(m, b) @@ -2764,7 +2765,7 @@ func (m *AddGroupMembersCMSResp) Reset() { *m = AddGroupMembersCMSResp{} func (m *AddGroupMembersCMSResp) String() string { return proto.CompactTextString(m) } func (*AddGroupMembersCMSResp) ProtoMessage() {} func (*AddGroupMembersCMSResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{52} + return fileDescriptor_group_40c147a29abb4e60, []int{52} } func (m *AddGroupMembersCMSResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddGroupMembersCMSResp.Unmarshal(m, b) @@ -2811,7 +2812,7 @@ func (m *DismissGroupReq) Reset() { *m = DismissGroupReq{} } func (m *DismissGroupReq) String() string { return proto.CompactTextString(m) } func (*DismissGroupReq) ProtoMessage() {} func (*DismissGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{53} + return fileDescriptor_group_40c147a29abb4e60, []int{53} } func (m *DismissGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DismissGroupReq.Unmarshal(m, b) @@ -2863,7 +2864,7 @@ func (m *DismissGroupResp) Reset() { *m = DismissGroupResp{} } func (m *DismissGroupResp) String() string { return proto.CompactTextString(m) } func (*DismissGroupResp) ProtoMessage() {} func (*DismissGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{54} + return fileDescriptor_group_40c147a29abb4e60, []int{54} } func (m *DismissGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DismissGroupResp.Unmarshal(m, b) @@ -2905,7 +2906,7 @@ func (m *MuteGroupMemberReq) Reset() { *m = MuteGroupMemberReq{} } func (m *MuteGroupMemberReq) String() string { return proto.CompactTextString(m) } func (*MuteGroupMemberReq) ProtoMessage() {} func (*MuteGroupMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{55} + return fileDescriptor_group_40c147a29abb4e60, []int{55} } func (m *MuteGroupMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MuteGroupMemberReq.Unmarshal(m, b) @@ -2971,7 +2972,7 @@ func (m *MuteGroupMemberResp) Reset() { *m = MuteGroupMemberResp{} } func (m *MuteGroupMemberResp) String() string { return proto.CompactTextString(m) } func (*MuteGroupMemberResp) ProtoMessage() {} func (*MuteGroupMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{56} + return fileDescriptor_group_40c147a29abb4e60, []int{56} } func (m *MuteGroupMemberResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MuteGroupMemberResp.Unmarshal(m, b) @@ -3012,7 +3013,7 @@ func (m *CancelMuteGroupMemberReq) Reset() { *m = CancelMuteGroupMemberR func (m *CancelMuteGroupMemberReq) String() string { return proto.CompactTextString(m) } func (*CancelMuteGroupMemberReq) ProtoMessage() {} func (*CancelMuteGroupMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{57} + return fileDescriptor_group_40c147a29abb4e60, []int{57} } func (m *CancelMuteGroupMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CancelMuteGroupMemberReq.Unmarshal(m, b) @@ -3071,7 +3072,7 @@ func (m *CancelMuteGroupMemberResp) Reset() { *m = CancelMuteGroupMember func (m *CancelMuteGroupMemberResp) String() string { return proto.CompactTextString(m) } func (*CancelMuteGroupMemberResp) ProtoMessage() {} func (*CancelMuteGroupMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{58} + return fileDescriptor_group_40c147a29abb4e60, []int{58} } func (m *CancelMuteGroupMemberResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CancelMuteGroupMemberResp.Unmarshal(m, b) @@ -3111,7 +3112,7 @@ func (m *MuteGroupReq) Reset() { *m = MuteGroupReq{} } func (m *MuteGroupReq) String() string { return proto.CompactTextString(m) } func (*MuteGroupReq) ProtoMessage() {} func (*MuteGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{59} + return fileDescriptor_group_40c147a29abb4e60, []int{59} } func (m *MuteGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MuteGroupReq.Unmarshal(m, b) @@ -3163,7 +3164,7 @@ func (m *MuteGroupResp) Reset() { *m = MuteGroupResp{} } func (m *MuteGroupResp) String() string { return proto.CompactTextString(m) } func (*MuteGroupResp) ProtoMessage() {} func (*MuteGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{60} + return fileDescriptor_group_40c147a29abb4e60, []int{60} } func (m *MuteGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MuteGroupResp.Unmarshal(m, b) @@ -3203,7 +3204,7 @@ func (m *CancelMuteGroupReq) Reset() { *m = CancelMuteGroupReq{} } func (m *CancelMuteGroupReq) String() string { return proto.CompactTextString(m) } func (*CancelMuteGroupReq) ProtoMessage() {} func (*CancelMuteGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{61} + return fileDescriptor_group_40c147a29abb4e60, []int{61} } func (m *CancelMuteGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CancelMuteGroupReq.Unmarshal(m, b) @@ -3255,7 +3256,7 @@ func (m *CancelMuteGroupResp) Reset() { *m = CancelMuteGroupResp{} } func (m *CancelMuteGroupResp) String() string { return proto.CompactTextString(m) } func (*CancelMuteGroupResp) ProtoMessage() {} func (*CancelMuteGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{62} + return fileDescriptor_group_40c147a29abb4e60, []int{62} } func (m *CancelMuteGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CancelMuteGroupResp.Unmarshal(m, b) @@ -3297,7 +3298,7 @@ func (m *SetGroupMemberNicknameReq) Reset() { *m = SetGroupMemberNicknam func (m *SetGroupMemberNicknameReq) String() string { return proto.CompactTextString(m) } func (*SetGroupMemberNicknameReq) ProtoMessage() {} func (*SetGroupMemberNicknameReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{63} + return fileDescriptor_group_40c147a29abb4e60, []int{63} } func (m *SetGroupMemberNicknameReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetGroupMemberNicknameReq.Unmarshal(m, b) @@ -3363,7 +3364,7 @@ func (m *SetGroupMemberNicknameResp) Reset() { *m = SetGroupMemberNickna func (m *SetGroupMemberNicknameResp) String() string { return proto.CompactTextString(m) } func (*SetGroupMemberNicknameResp) ProtoMessage() {} func (*SetGroupMemberNicknameResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_95c16320d90511af, []int{64} + return fileDescriptor_group_40c147a29abb4e60, []int{64} } func (m *SetGroupMemberNicknameResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetGroupMemberNicknameResp.Unmarshal(m, b) @@ -3390,6 +3391,338 @@ func (m *SetGroupMemberNicknameResp) GetCommonResp() *CommonResp { return nil } +type GetJoinedSuperGroupListReq struct { + OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetJoinedSuperGroupListReq) Reset() { *m = GetJoinedSuperGroupListReq{} } +func (m *GetJoinedSuperGroupListReq) String() string { return proto.CompactTextString(m) } +func (*GetJoinedSuperGroupListReq) ProtoMessage() {} +func (*GetJoinedSuperGroupListReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_40c147a29abb4e60, []int{65} +} +func (m *GetJoinedSuperGroupListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetJoinedSuperGroupListReq.Unmarshal(m, b) +} +func (m *GetJoinedSuperGroupListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetJoinedSuperGroupListReq.Marshal(b, m, deterministic) +} +func (dst *GetJoinedSuperGroupListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetJoinedSuperGroupListReq.Merge(dst, src) +} +func (m *GetJoinedSuperGroupListReq) XXX_Size() int { + return xxx_messageInfo_GetJoinedSuperGroupListReq.Size(m) +} +func (m *GetJoinedSuperGroupListReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetJoinedSuperGroupListReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetJoinedSuperGroupListReq proto.InternalMessageInfo + +func (m *GetJoinedSuperGroupListReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetJoinedSuperGroupListReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetJoinedSuperGroupListReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type GetJoinedSuperGroupListResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + GroupList []*sdk_ws.GroupInfo `protobuf:"bytes,3,rep,name=GroupList" json:"GroupList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetJoinedSuperGroupListResp) Reset() { *m = GetJoinedSuperGroupListResp{} } +func (m *GetJoinedSuperGroupListResp) String() string { return proto.CompactTextString(m) } +func (*GetJoinedSuperGroupListResp) ProtoMessage() {} +func (*GetJoinedSuperGroupListResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_40c147a29abb4e60, []int{66} +} +func (m *GetJoinedSuperGroupListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetJoinedSuperGroupListResp.Unmarshal(m, b) +} +func (m *GetJoinedSuperGroupListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetJoinedSuperGroupListResp.Marshal(b, m, deterministic) +} +func (dst *GetJoinedSuperGroupListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetJoinedSuperGroupListResp.Merge(dst, src) +} +func (m *GetJoinedSuperGroupListResp) XXX_Size() int { + return xxx_messageInfo_GetJoinedSuperGroupListResp.Size(m) +} +func (m *GetJoinedSuperGroupListResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetJoinedSuperGroupListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetJoinedSuperGroupListResp proto.InternalMessageInfo + +func (m *GetJoinedSuperGroupListResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetJoinedSuperGroupListResp) GetGroupList() []*sdk_ws.GroupInfo { + if m != nil { + return m.GroupList + } + return nil +} + +type GetSuperGroupsInfoReq struct { + GroupIDList []string `protobuf:"bytes,1,rep,name=GroupIDList" json:"GroupIDList,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID" json:"OpUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetSuperGroupsInfoReq) Reset() { *m = GetSuperGroupsInfoReq{} } +func (m *GetSuperGroupsInfoReq) String() string { return proto.CompactTextString(m) } +func (*GetSuperGroupsInfoReq) ProtoMessage() {} +func (*GetSuperGroupsInfoReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_40c147a29abb4e60, []int{67} +} +func (m *GetSuperGroupsInfoReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetSuperGroupsInfoReq.Unmarshal(m, b) +} +func (m *GetSuperGroupsInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetSuperGroupsInfoReq.Marshal(b, m, deterministic) +} +func (dst *GetSuperGroupsInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSuperGroupsInfoReq.Merge(dst, src) +} +func (m *GetSuperGroupsInfoReq) XXX_Size() int { + return xxx_messageInfo_GetSuperGroupsInfoReq.Size(m) +} +func (m *GetSuperGroupsInfoReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetSuperGroupsInfoReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSuperGroupsInfoReq proto.InternalMessageInfo + +func (m *GetSuperGroupsInfoReq) GetGroupIDList() []string { + if m != nil { + return m.GroupIDList + } + return nil +} + +func (m *GetSuperGroupsInfoReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetSuperGroupsInfoReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type GetSuperGroupsInfoResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + GroupInfoList []*sdk_ws.GroupInfo `protobuf:"bytes,3,rep,name=GroupInfoList" json:"GroupInfoList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetSuperGroupsInfoResp) Reset() { *m = GetSuperGroupsInfoResp{} } +func (m *GetSuperGroupsInfoResp) String() string { return proto.CompactTextString(m) } +func (*GetSuperGroupsInfoResp) ProtoMessage() {} +func (*GetSuperGroupsInfoResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_40c147a29abb4e60, []int{68} +} +func (m *GetSuperGroupsInfoResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetSuperGroupsInfoResp.Unmarshal(m, b) +} +func (m *GetSuperGroupsInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetSuperGroupsInfoResp.Marshal(b, m, deterministic) +} +func (dst *GetSuperGroupsInfoResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSuperGroupsInfoResp.Merge(dst, src) +} +func (m *GetSuperGroupsInfoResp) XXX_Size() int { + return xxx_messageInfo_GetSuperGroupsInfoResp.Size(m) +} +func (m *GetSuperGroupsInfoResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetSuperGroupsInfoResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSuperGroupsInfoResp proto.InternalMessageInfo + +func (m *GetSuperGroupsInfoResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetSuperGroupsInfoResp) GetGroupInfoList() []*sdk_ws.GroupInfo { + if m != nil { + return m.GroupInfoList + } + return nil +} + +type SetGroupMemberInfoReq struct { + GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=operationID" json:"operationID,omitempty"` + Nickname *wrapperspb.StringValue `protobuf:"bytes,5,opt,name=nickname" json:"nickname,omitempty"` + FaceURL *wrapperspb.StringValue `protobuf:"bytes,6,opt,name=faceURL" json:"faceURL,omitempty"` + RoleLevel *wrapperspb.Int32Value `protobuf:"bytes,7,opt,name=roleLevel" json:"roleLevel,omitempty"` + Ex *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetGroupMemberInfoReq) Reset() { *m = SetGroupMemberInfoReq{} } +func (m *SetGroupMemberInfoReq) String() string { return proto.CompactTextString(m) } +func (*SetGroupMemberInfoReq) ProtoMessage() {} +func (*SetGroupMemberInfoReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_40c147a29abb4e60, []int{69} +} +func (m *SetGroupMemberInfoReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetGroupMemberInfoReq.Unmarshal(m, b) +} +func (m *SetGroupMemberInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetGroupMemberInfoReq.Marshal(b, m, deterministic) +} +func (dst *SetGroupMemberInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetGroupMemberInfoReq.Merge(dst, src) +} +func (m *SetGroupMemberInfoReq) XXX_Size() int { + return xxx_messageInfo_SetGroupMemberInfoReq.Size(m) +} +func (m *SetGroupMemberInfoReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetGroupMemberInfoReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetGroupMemberInfoReq proto.InternalMessageInfo + +func (m *SetGroupMemberInfoReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *SetGroupMemberInfoReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *SetGroupMemberInfoReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *SetGroupMemberInfoReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *SetGroupMemberInfoReq) GetNickname() *wrapperspb.StringValue { + if m != nil { + return m.Nickname + } + return nil +} + +func (m *SetGroupMemberInfoReq) GetFaceURL() *wrapperspb.StringValue { + if m != nil { + return m.FaceURL + } + return nil +} + +func (m *SetGroupMemberInfoReq) GetRoleLevel() *wrapperspb.Int32Value { + if m != nil { + return m.RoleLevel + } + return nil +} + +func (m *SetGroupMemberInfoReq) GetEx() *wrapperspb.StringValue { + if m != nil { + return m.Ex + } + return nil +} + +type SetGroupMemberInfoResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetGroupMemberInfoResp) Reset() { *m = SetGroupMemberInfoResp{} } +func (m *SetGroupMemberInfoResp) String() string { return proto.CompactTextString(m) } +func (*SetGroupMemberInfoResp) ProtoMessage() {} +func (*SetGroupMemberInfoResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_40c147a29abb4e60, []int{70} +} +func (m *SetGroupMemberInfoResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetGroupMemberInfoResp.Unmarshal(m, b) +} +func (m *SetGroupMemberInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetGroupMemberInfoResp.Marshal(b, m, deterministic) +} +func (dst *SetGroupMemberInfoResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetGroupMemberInfoResp.Merge(dst, src) +} +func (m *SetGroupMemberInfoResp) XXX_Size() int { + return xxx_messageInfo_SetGroupMemberInfoResp.Size(m) +} +func (m *SetGroupMemberInfoResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetGroupMemberInfoResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetGroupMemberInfoResp proto.InternalMessageInfo + +func (m *SetGroupMemberInfoResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + func init() { proto.RegisterType((*CommonResp)(nil), "group.CommonResp") proto.RegisterType((*GroupAddMemberInfo)(nil), "group.GroupAddMemberInfo") @@ -3456,6 +3789,12 @@ func init() { proto.RegisterType((*CancelMuteGroupResp)(nil), "group.CancelMuteGroupResp") proto.RegisterType((*SetGroupMemberNicknameReq)(nil), "group.SetGroupMemberNicknameReq") proto.RegisterType((*SetGroupMemberNicknameResp)(nil), "group.SetGroupMemberNicknameResp") + proto.RegisterType((*GetJoinedSuperGroupListReq)(nil), "group.GetJoinedSuperGroupListReq") + proto.RegisterType((*GetJoinedSuperGroupListResp)(nil), "group.GetJoinedSuperGroupListResp") + proto.RegisterType((*GetSuperGroupsInfoReq)(nil), "group.GetSuperGroupsInfoReq") + proto.RegisterType((*GetSuperGroupsInfoResp)(nil), "group.GetSuperGroupsInfoResp") + proto.RegisterType((*SetGroupMemberInfoReq)(nil), "group.SetGroupMemberInfoReq") + proto.RegisterType((*SetGroupMemberInfoResp)(nil), "group.SetGroupMemberInfoResp") } // Reference imports to suppress errors if they are not otherwise used. @@ -3499,6 +3838,9 @@ type GroupClient interface { MuteGroup(ctx context.Context, in *MuteGroupReq, opts ...grpc.CallOption) (*MuteGroupResp, error) CancelMuteGroup(ctx context.Context, in *CancelMuteGroupReq, opts ...grpc.CallOption) (*CancelMuteGroupResp, error) SetGroupMemberNickname(ctx context.Context, in *SetGroupMemberNicknameReq, opts ...grpc.CallOption) (*SetGroupMemberNicknameResp, error) + GetJoinedSuperGroupList(ctx context.Context, in *GetJoinedSuperGroupListReq, opts ...grpc.CallOption) (*GetJoinedSuperGroupListResp, error) + GetSuperGroupsInfo(ctx context.Context, in *GetSuperGroupsInfoReq, opts ...grpc.CallOption) (*GetSuperGroupsInfoResp, error) + SetGroupMemberInfo(ctx context.Context, in *SetGroupMemberInfoReq, opts ...grpc.CallOption) (*SetGroupMemberInfoResp, error) } type groupClient struct { @@ -3779,6 +4121,33 @@ func (c *groupClient) SetGroupMemberNickname(ctx context.Context, in *SetGroupMe return out, nil } +func (c *groupClient) GetJoinedSuperGroupList(ctx context.Context, in *GetJoinedSuperGroupListReq, opts ...grpc.CallOption) (*GetJoinedSuperGroupListResp, error) { + out := new(GetJoinedSuperGroupListResp) + err := grpc.Invoke(ctx, "/group.group/GetJoinedSuperGroupList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GetSuperGroupsInfo(ctx context.Context, in *GetSuperGroupsInfoReq, opts ...grpc.CallOption) (*GetSuperGroupsInfoResp, error) { + out := new(GetSuperGroupsInfoResp) + err := grpc.Invoke(ctx, "/group.group/GetSuperGroupsInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) SetGroupMemberInfo(ctx context.Context, in *SetGroupMemberInfoReq, opts ...grpc.CallOption) (*SetGroupMemberInfoResp, error) { + out := new(SetGroupMemberInfoResp) + err := grpc.Invoke(ctx, "/group.group/SetGroupMemberInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for Group service type GroupServer interface { @@ -3812,6 +4181,9 @@ type GroupServer interface { MuteGroup(context.Context, *MuteGroupReq) (*MuteGroupResp, error) CancelMuteGroup(context.Context, *CancelMuteGroupReq) (*CancelMuteGroupResp, error) SetGroupMemberNickname(context.Context, *SetGroupMemberNicknameReq) (*SetGroupMemberNicknameResp, error) + GetJoinedSuperGroupList(context.Context, *GetJoinedSuperGroupListReq) (*GetJoinedSuperGroupListResp, error) + GetSuperGroupsInfo(context.Context, *GetSuperGroupsInfoReq) (*GetSuperGroupsInfoResp, error) + SetGroupMemberInfo(context.Context, *SetGroupMemberInfoReq) (*SetGroupMemberInfoResp, error) } func RegisterGroupServer(s *grpc.Server, srv GroupServer) { @@ -4358,6 +4730,60 @@ func _Group_SetGroupMemberNickname_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Group_GetJoinedSuperGroupList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetJoinedSuperGroupListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetJoinedSuperGroupList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetJoinedSuperGroupList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetJoinedSuperGroupList(ctx, req.(*GetJoinedSuperGroupListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GetSuperGroupsInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSuperGroupsInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetSuperGroupsInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetSuperGroupsInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetSuperGroupsInfo(ctx, req.(*GetSuperGroupsInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_SetGroupMemberInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetGroupMemberInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).SetGroupMemberInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/SetGroupMemberInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).SetGroupMemberInfo(ctx, req.(*SetGroupMemberInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + var _Group_serviceDesc = grpc.ServiceDesc{ ServiceName: "group.group", HandlerType: (*GroupServer)(nil), @@ -4482,147 +4908,174 @@ var _Group_serviceDesc = grpc.ServiceDesc{ MethodName: "SetGroupMemberNickname", Handler: _Group_SetGroupMemberNickname_Handler, }, + { + MethodName: "GetJoinedSuperGroupList", + Handler: _Group_GetJoinedSuperGroupList_Handler, + }, + { + MethodName: "GetSuperGroupsInfo", + Handler: _Group_GetSuperGroupsInfo_Handler, + }, + { + MethodName: "SetGroupMemberInfo", + Handler: _Group_SetGroupMemberInfo_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "group/group.proto", } -func init() { proto.RegisterFile("group/group.proto", fileDescriptor_group_95c16320d90511af) } +func init() { proto.RegisterFile("group/group.proto", fileDescriptor_group_40c147a29abb4e60) } -var fileDescriptor_group_95c16320d90511af = []byte{ - // 2138 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x1a, 0x4d, 0x6f, 0x1c, 0x49, - 0x55, 0xed, 0xf1, 0xd8, 0x9e, 0x67, 0x4f, 0xc6, 0x2e, 0xef, 0xd8, 0xe3, 0x5e, 0x6f, 0xd6, 0xa9, - 0x0d, 0xab, 0x88, 0x0f, 0x5b, 0x64, 0xa5, 0x1c, 0x58, 0x44, 0x88, 0x3f, 0x12, 0x4f, 0x92, 0xb1, - 0x49, 0x3b, 0x5c, 0x22, 0xa1, 0x30, 0x3b, 0x5d, 0x1e, 0x0d, 0x9e, 0xe9, 0x6e, 0x77, 0xf5, 0x38, - 0xc0, 0x65, 0xc5, 0x65, 0xa5, 0x05, 0x0e, 0x20, 0x24, 0x4e, 0x48, 0xb0, 0x27, 0x38, 0x70, 0xe0, - 0x00, 0x67, 0xc4, 0xcf, 0xe0, 0x57, 0x70, 0xe2, 0x8e, 0xba, 0xaa, 0xba, 0xba, 0xba, 0xab, 0xba, - 0x3d, 0x99, 0x49, 0xc8, 0x65, 0xa4, 0xf7, 0xea, 0x55, 0xbf, 0x8f, 0x7a, 0xef, 0xd5, 0x7b, 0xaf, - 0x06, 0xd6, 0xfa, 0xa1, 0x3f, 0x0e, 0xf6, 0xd8, 0xef, 0x6e, 0x10, 0xfa, 0x91, 0x8f, 0xaa, 0x0c, - 0xb0, 0x6f, 0x9d, 0x06, 0xc4, 0x7b, 0xd9, 0xee, 0xec, 0x05, 0x17, 0xfd, 0x3d, 0xb6, 0xb2, 0x47, - 0xdd, 0x8b, 0x97, 0xaf, 0xe8, 0xde, 0x2b, 0xca, 0x29, 0xf1, 0xf7, 0x00, 0x0e, 0xfc, 0xd1, 0xc8, - 0xf7, 0x1c, 0x42, 0x03, 0xd4, 0x82, 0xc5, 0xa3, 0x30, 0x3c, 0xf0, 0x5d, 0xd2, 0xb2, 0x76, 0xac, - 0x3b, 0x55, 0x27, 0x01, 0xd1, 0x06, 0x2c, 0x1c, 0x85, 0x61, 0x87, 0xf6, 0x5b, 0x73, 0x3b, 0xd6, - 0x9d, 0x9a, 0x23, 0x20, 0xfc, 0x18, 0xd0, 0xa3, 0x98, 0xd7, 0x03, 0xd7, 0xed, 0x90, 0xd1, 0x67, - 0x24, 0x6c, 0x7b, 0xe7, 0x7e, 0x4c, 0xfd, 0x43, 0x4a, 0xc2, 0xf6, 0x21, 0xfb, 0x4c, 0xcd, 0x11, - 0x10, 0xda, 0x86, 0x9a, 0xe3, 0x0f, 0xc9, 0x53, 0x72, 0x45, 0x86, 0xec, 0x43, 0x55, 0x27, 0x45, - 0xe0, 0xff, 0x58, 0x70, 0xe3, 0x20, 0x24, 0xdd, 0x88, 0xb0, 0x4f, 0x3a, 0xe4, 0x12, 0x3d, 0x80, - 0x1b, 0x6d, 0x6f, 0x10, 0xf1, 0x4f, 0x3f, 0x1d, 0xd0, 0xa8, 0x65, 0xed, 0x54, 0xee, 0x2c, 0xdf, - 0xdd, 0xda, 0xe5, 0xea, 0xea, 0xbc, 0x9d, 0xdc, 0x06, 0xf4, 0x1d, 0xa8, 0x31, 0xaa, 0x78, 0x91, - 0xf1, 0x5c, 0xbe, 0xbb, 0xbd, 0x4b, 0x49, 0x78, 0x45, 0xc2, 0x97, 0xdd, 0x60, 0xf0, 0x32, 0xe8, - 0x86, 0xdd, 0x11, 0xdd, 0x95, 0x34, 0x4e, 0x4a, 0x8e, 0x76, 0x60, 0xf9, 0x34, 0x20, 0x61, 0x37, - 0x1a, 0xf8, 0x5e, 0xfb, 0xb0, 0x55, 0x61, 0xca, 0xa8, 0x28, 0x64, 0xc3, 0xd2, 0x69, 0x20, 0x74, - 0x9d, 0x67, 0xcb, 0x12, 0x66, 0xbb, 0x5f, 0x79, 0x24, 0x14, 0xcb, 0x55, 0xb1, 0x3b, 0x45, 0xe1, - 0xcf, 0xa1, 0x91, 0x51, 0x78, 0x9a, 0x23, 0xc8, 0x2a, 0x58, 0x79, 0x2d, 0x05, 0x71, 0x08, 0xab, - 0x8f, 0x48, 0xc4, 0x60, 0xca, 0xd6, 0xc8, 0x65, 0x2c, 0x36, 0x27, 0x38, 0x94, 0x06, 0xaf, 0x39, - 0x2a, 0x2a, 0x6f, 0x96, 0xb9, 0x72, 0xb3, 0x54, 0xb2, 0x66, 0xc1, 0x5f, 0x5a, 0xb0, 0x96, 0x63, - 0x3a, 0x95, 0xde, 0xfb, 0x50, 0x97, 0x8a, 0x30, 0x49, 0x2b, 0xcc, 0x35, 0xca, 0x75, 0xcf, 0x6e, - 0xc1, 0xbf, 0xb2, 0xa0, 0x71, 0x26, 0x64, 0x49, 0xf4, 0xcf, 0xd8, 0xd3, 0x7a, 0x3d, 0x87, 0x51, - 0xf5, 0x9e, 0x33, 0xb8, 0x43, 0xa9, 0x33, 0xe1, 0x23, 0x58, 0xcd, 0x0a, 0x43, 0x03, 0xf4, 0x6d, - 0x35, 0x40, 0x85, 0x38, 0x6b, 0xc2, 0xfb, 0xd3, 0x05, 0x47, 0x21, 0xc2, 0x3f, 0x07, 0x3b, 0xb1, - 0xef, 0x83, 0x20, 0x18, 0x0e, 0x7a, 0xec, 0xfb, 0xb1, 0xbe, 0xb1, 0x7a, 0xaa, 0x88, 0x56, 0xb9, - 0x88, 0x86, 0x83, 0xbd, 0x09, 0xf0, 0x30, 0xf4, 0x47, 0x99, 0xa3, 0x55, 0x30, 0xf8, 0x0f, 0x16, - 0xbc, 0x5f, 0xc8, 0x7c, 0xaa, 0x63, 0x7e, 0x02, 0xab, 0x49, 0x3a, 0x18, 0x13, 0x1a, 0x29, 0x27, - 0xfd, 0x61, 0xd1, 0xa9, 0x08, 0x52, 0x47, 0xdb, 0x88, 0x23, 0xd8, 0x7e, 0x44, 0xa2, 0x58, 0x56, - 0x87, 0x5c, 0x1a, 0x8c, 0x53, 0x94, 0xb8, 0x66, 0x3b, 0xd7, 0x3f, 0x5a, 0xf0, 0x41, 0x09, 0xdb, - 0xa9, 0x4e, 0xd9, 0x68, 0x97, 0xb9, 0x69, 0xed, 0xf2, 0x4f, 0x0b, 0x9a, 0xcf, 0xc3, 0xae, 0x47, - 0xcf, 0x49, 0xc8, 0x16, 0x59, 0x96, 0x8a, 0x2d, 0xd2, 0x82, 0x45, 0x11, 0xfa, 0xc2, 0x24, 0x09, - 0x88, 0x3e, 0x86, 0x1b, 0xa7, 0x43, 0x57, 0xcd, 0x70, 0xdc, 0x32, 0x39, 0x6c, 0x4c, 0x77, 0x42, - 0x5e, 0xa9, 0x74, 0xdc, 0x44, 0x39, 0x6c, 0xde, 0x8e, 0xf3, 0xe5, 0x59, 0xa5, 0x9a, 0xcb, 0x2a, - 0x4f, 0x60, 0xc3, 0xa4, 0xc0, 0x74, 0x11, 0xf4, 0x85, 0x05, 0x2b, 0x8f, 0xfd, 0x81, 0x27, 0xef, - 0xa1, 0x62, 0x2b, 0xdc, 0x04, 0x70, 0xc8, 0x65, 0x87, 0x50, 0xda, 0xed, 0x13, 0x61, 0x01, 0x05, - 0x53, 0x96, 0x09, 0xaf, 0xd7, 0x18, 0xef, 0x43, 0x5d, 0x91, 0x63, 0x3a, 0x65, 0xfe, 0x1d, 0x87, - 0x64, 0x2e, 0x1e, 0xe3, 0x05, 0xdf, 0xa3, 0x44, 0xe4, 0x7b, 0x55, 0x0a, 0xab, 0xdc, 0xee, 0x79, - 0xef, 0x57, 0x2c, 0x53, 0xd1, 0x2c, 0xa3, 0xa4, 0x8a, 0xf9, 0x7c, 0xaa, 0x88, 0xd7, 0x8f, 0xbb, - 0x9e, 0x3b, 0x24, 0x6e, 0x1c, 0xf4, 0xfc, 0x3c, 0x15, 0x0c, 0xc2, 0xb0, 0xc2, 0x21, 0x87, 0xd0, - 0xf1, 0x30, 0x6a, 0x2d, 0xb0, 0x7c, 0x91, 0xc1, 0xe1, 0x67, 0xb0, 0x5d, 0xac, 0xda, 0x74, 0xe6, - 0x3a, 0x87, 0x95, 0x67, 0xe3, 0x41, 0x34, 0xc1, 0xd1, 0xcf, 0x76, 0x0d, 0xee, 0x43, 0x5d, 0xe1, - 0x33, 0x9d, 0xac, 0x5f, 0x59, 0xd0, 0x4c, 0xb2, 0x6d, 0x5a, 0xf2, 0x94, 0x4b, 0x3d, 0x53, 0x2a, - 0x8b, 0x13, 0xe4, 0xc3, 0xc1, 0x30, 0x22, 0x21, 0x3b, 0xd0, 0xaa, 0x23, 0xa0, 0x98, 0xdf, 0x09, - 0xf9, 0x69, 0x74, 0x46, 0x2e, 0xd9, 0x49, 0x56, 0x9d, 0x04, 0xc4, 0x7f, 0xb5, 0x60, 0xc3, 0x24, - 0xe3, 0x54, 0x97, 0xc1, 0x43, 0x80, 0x51, 0x5a, 0x0b, 0xf2, 0x6b, 0xe0, 0xe3, 0xa2, 0x74, 0xc7, - 0xb9, 0x3d, 0x1c, 0x0f, 0x87, 0xec, 0x36, 0x55, 0x76, 0xc6, 0x9c, 0x3d, 0x21, 0x2e, 0xd7, 0x23, - 0x01, 0xf1, 0x6f, 0x34, 0x71, 0x65, 0x61, 0x54, 0x9a, 0x04, 0x14, 0xb1, 0xe6, 0x58, 0xc5, 0xa4, - 0xb2, 0x9b, 0x2d, 0x09, 0xfc, 0xce, 0x82, 0x4d, 0xa3, 0x48, 0xef, 0xd2, 0x84, 0xf8, 0x6f, 0x16, - 0xa0, 0x27, 0x83, 0xde, 0x85, 0x42, 0x57, 0x6e, 0xa4, 0xaf, 0xc3, 0x6a, 0x4c, 0x4f, 0x5c, 0xae, - 0xb8, 0x62, 0x2a, 0x0d, 0x1f, 0x0b, 0xef, 0x90, 0x2e, 0xf5, 0x3d, 0x61, 0x2e, 0x01, 0xe5, 0x8d, - 0x55, 0x2d, 0x0f, 0xb9, 0x85, 0x5c, 0xc8, 0x7d, 0x0a, 0xb5, 0xb6, 0x7b, 0x97, 0xa7, 0x8e, 0xc2, - 0xab, 0x9e, 0xb1, 0x66, 0x09, 0x87, 0x37, 0x28, 0x02, 0xc2, 0x9f, 0xc3, 0xba, 0xa6, 0xee, 0x54, - 0x07, 0x70, 0x0f, 0xea, 0x52, 0x0a, 0xe5, 0x0c, 0x56, 0x45, 0xa8, 0xcb, 0x35, 0x27, 0x4b, 0x86, - 0xc7, 0x2c, 0xd6, 0xe3, 0xeb, 0x80, 0xb8, 0x4c, 0x8a, 0x24, 0xd6, 0xb3, 0x89, 0xd6, 0xd2, 0x12, - 0xed, 0x0e, 0x2c, 0xfb, 0x7a, 0x9e, 0xf2, 0x27, 0xcc, 0x53, 0x5f, 0xf0, 0x80, 0xd0, 0xf8, 0xce, - 0xd4, 0xab, 0x4c, 0x5c, 0xaf, 0xa7, 0xe4, 0xf8, 0xef, 0x16, 0xbc, 0xd7, 0xf6, 0xae, 0x06, 0x11, - 0x89, 0x25, 0x7b, 0xee, 0xcb, 0x0c, 0x7d, 0x7d, 0x1e, 0x2e, 0xbe, 0xa4, 0x52, 0x47, 0x9b, 0xcf, - 0x38, 0xda, 0x37, 0x61, 0x8d, 0xf3, 0x52, 0xbd, 0xb5, 0xca, 0xbc, 0x55, 0x5f, 0x28, 0x75, 0xba, - 0x5f, 0x58, 0xd0, 0x34, 0x88, 0xfd, 0x7f, 0x75, 0x1d, 0x0f, 0xde, 0x93, 0x45, 0xf9, 0x70, 0x38, - 0x49, 0xb0, 0xce, 0x56, 0xf0, 0xfe, 0x56, 0xb9, 0x97, 0x14, 0x86, 0xef, 0x34, 0x5f, 0xfd, 0xde, - 0x82, 0xa5, 0x83, 0xce, 0x19, 0x23, 0x9b, 0xa9, 0xc7, 0xbb, 0x03, 0x0d, 0xce, 0xab, 0x4b, 0x23, - 0x12, 0x9e, 0x74, 0x47, 0x49, 0xd9, 0x97, 0x47, 0xa3, 0xdb, 0xa2, 0x43, 0xe5, 0xa8, 0xb6, 0x2b, - 0x4c, 0x95, 0x45, 0xc6, 0xe9, 0x7d, 0x39, 0x31, 0x56, 0x7c, 0x28, 0xdb, 0x42, 0x36, 0xf6, 0x65, - 0x7e, 0x2c, 0x29, 0x02, 0x1d, 0x02, 0xfc, 0xa0, 0xdb, 0x1f, 0x78, 0xcc, 0xd4, 0x62, 0x9e, 0x71, - 0xdb, 0x20, 0xba, 0xa8, 0xee, 0x53, 0x5a, 0x47, 0xd9, 0x37, 0xc1, 0x11, 0x7e, 0x65, 0xc1, 0x4a, - 0x2a, 0x15, 0x0d, 0xd0, 0xb7, 0xa0, 0x96, 0x98, 0x8f, 0x8a, 0x29, 0x4c, 0x23, 0xa9, 0x4e, 0x04, - 0xde, 0x49, 0x29, 0xde, 0x90, 0x9c, 0xd2, 0x16, 0xe3, 0x11, 0x65, 0x52, 0x56, 0x9d, 0x14, 0x81, - 0xaf, 0x52, 0x11, 0x69, 0x6c, 0xb9, 0x2c, 0x4f, 0xeb, 0xcd, 0xd8, 0x46, 0x4f, 0x27, 0xf8, 0x4f, - 0x16, 0xd4, 0x15, 0xc6, 0xef, 0xca, 0x38, 0x36, 0x2c, 0x25, 0xb6, 0x10, 0xb6, 0x91, 0x30, 0x3e, - 0x4d, 0x67, 0x2c, 0x86, 0x70, 0x77, 0xb3, 0xe1, 0xee, 0x4e, 0xa0, 0xf3, 0x05, 0x34, 0x39, 0xc8, - 0x67, 0x55, 0x67, 0x51, 0x37, 0x1a, 0xd3, 0xf2, 0x8f, 0x6e, 0xc0, 0x02, 0x27, 0x4b, 0x6e, 0x52, - 0x0e, 0x4d, 0xe0, 0x7c, 0x2d, 0xd8, 0x30, 0x31, 0xe3, 0x9d, 0x19, 0x12, 0x4b, 0xac, 0x9d, 0xf6, - 0x87, 0xe4, 0x5a, 0x21, 0x58, 0xda, 0x72, 0x93, 0xb4, 0xc2, 0xa1, 0xec, 0x28, 0xb2, 0x92, 0x1b, - 0x45, 0x4e, 0x50, 0x94, 0x35, 0x61, 0x5d, 0x93, 0x83, 0x06, 0xf8, 0x29, 0xdc, 0x38, 0x24, 0x43, - 0xa2, 0x8c, 0x30, 0x67, 0x31, 0xfa, 0x1a, 0x34, 0x32, 0x5f, 0xa3, 0x01, 0xee, 0x40, 0x23, 0x39, - 0xd8, 0xfd, 0x9f, 0xb5, 0xdd, 0x59, 0x39, 0xdc, 0x4f, 0x07, 0x80, 0xfc, 0x73, 0x34, 0x40, 0xdf, - 0x48, 0x13, 0xa5, 0x08, 0x22, 0xcd, 0x97, 0x25, 0x01, 0xfe, 0x87, 0xd6, 0x82, 0xd0, 0x83, 0xce, - 0x59, 0xb9, 0x58, 0x36, 0x2c, 0xc5, 0x46, 0x53, 0x52, 0xa7, 0x84, 0x73, 0xa1, 0x51, 0x79, 0x33, - 0x31, 0x6c, 0x38, 0xbf, 0x7f, 0xe9, 0x75, 0x3e, 0x93, 0x9b, 0x06, 0xe8, 0xfb, 0xb0, 0xc8, 0xef, - 0x8d, 0x24, 0x94, 0x27, 0xbd, 0x6e, 0x92, 0x6d, 0xe8, 0xc8, 0x10, 0xdf, 0x5f, 0x33, 0x2a, 0xc1, - 0x7b, 0xd5, 0x02, 0x2d, 0x6e, 0x02, 0x70, 0x0e, 0x4a, 0xfa, 0x53, 0x30, 0xf8, 0xd7, 0x16, 0xb4, - 0x1c, 0x32, 0xf2, 0xaf, 0xc8, 0x6b, 0x99, 0xbf, 0x05, 0x8b, 0x3c, 0x08, 0xa8, 0xa8, 0xbf, 0x13, - 0xf0, 0xb5, 0xe6, 0xdd, 0x6e, 0x6e, 0xde, 0xed, 0xe2, 0x0e, 0x6c, 0x15, 0x48, 0xc3, 0x2f, 0x7e, - 0x3a, 0xee, 0xf5, 0x08, 0xa5, 0x62, 0xa2, 0x9c, 0x80, 0x71, 0x84, 0x9e, 0x77, 0x07, 0x43, 0xe2, - 0x0a, 0x69, 0x04, 0x84, 0xbf, 0xb4, 0xa0, 0xf9, 0xc0, 0x75, 0xdf, 0x86, 0x6a, 0xae, 0xae, 0x9a, - 0x5b, 0xaa, 0xda, 0x63, 0xd8, 0x30, 0x89, 0x32, 0x95, 0x5e, 0x03, 0x68, 0x1c, 0x0e, 0xe8, 0x68, - 0x40, 0xa9, 0xcc, 0x11, 0x36, 0x2c, 0xf9, 0xb9, 0x99, 0xac, 0x1f, 0x4c, 0x5c, 0xbd, 0xb7, 0x60, - 0xb1, 0x9f, 0xad, 0x6e, 0x05, 0x88, 0x8f, 0x60, 0x35, 0xcb, 0x8a, 0x8f, 0x19, 0x7a, 0x93, 0x8c, - 0x19, 0x52, 0x22, 0xfc, 0x17, 0x0b, 0x50, 0x67, 0x1c, 0x91, 0xdc, 0x75, 0xf2, 0x96, 0xa4, 0x8e, - 0x0d, 0x37, 0x56, 0x87, 0x46, 0x02, 0x42, 0x18, 0x56, 0x46, 0xe3, 0x88, 0xb8, 0x67, 0xa4, 0xe7, - 0x7b, 0x2e, 0x65, 0xdd, 0x5f, 0xdd, 0xc9, 0xe0, 0xf0, 0x31, 0xac, 0x6b, 0x92, 0x4e, 0xa7, 0xf4, - 0x2f, 0x2d, 0x68, 0x1d, 0x74, 0xbd, 0x1e, 0x19, 0xbe, 0x7b, 0xd5, 0xf1, 0x09, 0x6c, 0x15, 0xc8, - 0x32, 0x9d, 0x72, 0xe7, 0xb0, 0x22, 0xbf, 0xf4, 0x36, 0x1d, 0x70, 0x1f, 0xea, 0x0a, 0x9f, 0xe9, - 0x64, 0x1d, 0x02, 0xca, 0xe9, 0xfe, 0x36, 0x25, 0x3e, 0x86, 0x75, 0x8d, 0xdb, 0x74, 0x72, 0xff, - 0xd9, 0x82, 0xad, 0xb3, 0xcc, 0x0d, 0x73, 0x32, 0xe8, 0x5d, 0x78, 0xdd, 0x51, 0x52, 0xb1, 0xf4, - 0xb3, 0xad, 0x57, 0x3f, 0x6d, 0xbd, 0x3c, 0x41, 0x98, 0xdc, 0x8e, 0x09, 0x9c, 0xd1, 0xba, 0x52, - 0xae, 0xf5, 0xbc, 0xae, 0x75, 0xea, 0x5d, 0xd5, 0x8c, 0x77, 0x9d, 0x82, 0x5d, 0x24, 0xe8, 0x54, - 0x73, 0xc9, 0xbb, 0xff, 0x5d, 0x03, 0xfe, 0x04, 0x8d, 0xbe, 0x0b, 0xcb, 0xbd, 0xf4, 0x85, 0x13, - 0x35, 0x93, 0x7d, 0x99, 0x67, 0x5e, 0x7b, 0xc3, 0x84, 0xa6, 0x01, 0xba, 0x07, 0xb5, 0x9f, 0x24, - 0xe3, 0x6f, 0xb4, 0x2e, 0x88, 0xd4, 0xc1, 0xbc, 0xfd, 0x9e, 0x8e, 0xe4, 0xfb, 0x2e, 0x93, 0xd9, - 0xaa, 0xdc, 0xa7, 0x4e, 0x75, 0xe5, 0xbe, 0xec, 0x08, 0x76, 0x1f, 0xea, 0x7d, 0xf5, 0x65, 0x12, - 0x6d, 0x26, 0xef, 0xcc, 0xb9, 0x47, 0x52, 0xbb, 0x65, 0x5e, 0xa0, 0x01, 0xba, 0x0f, 0x2b, 0x54, - 0x79, 0xc4, 0x43, 0x89, 0x6e, 0xb9, 0x67, 0x46, 0x7b, 0xd3, 0x88, 0xa7, 0x01, 0xfa, 0x31, 0x6c, - 0xf6, 0xcd, 0x2f, 0x68, 0xe8, 0x56, 0x8e, 0xab, 0xfe, 0x82, 0x65, 0xe3, 0xeb, 0x48, 0x68, 0x80, - 0xce, 0x61, 0xab, 0x5f, 0xf4, 0x1c, 0x85, 0x3e, 0x4a, 0x3f, 0x50, 0xf8, 0x4e, 0x66, 0xdf, 0xbe, - 0x9e, 0x88, 0x06, 0xe8, 0x19, 0xa0, 0x48, 0x7b, 0x93, 0x41, 0xdb, 0x62, 0xaf, 0xf1, 0xbd, 0xc9, - 0xfe, 0xa0, 0x64, 0x95, 0x06, 0xa8, 0x07, 0xad, 0x7e, 0xc1, 0xc0, 0x1f, 0xe1, 0xcc, 0x9f, 0x02, - 0x8c, 0x8f, 0x1d, 0xf6, 0x47, 0xd7, 0xd2, 0x70, 0xb9, 0xfb, 0xda, 0xc4, 0x5a, 0xca, 0x6d, 0x1c, - 0xb8, 0x4b, 0xb9, 0x0b, 0x46, 0xdd, 0xcf, 0x61, 0xbd, 0xaf, 0x8f, 0x70, 0x91, 0x79, 0x97, 0xf4, - 0xb2, 0x9b, 0x65, 0xcb, 0x34, 0x40, 0xc7, 0xd0, 0xb8, 0xc8, 0xce, 0x24, 0x51, 0xf2, 0xcf, 0x08, - 0x7d, 0x34, 0x6b, 0xdb, 0x45, 0x4b, 0x52, 0xe5, 0xdc, 0x90, 0x4f, 0x55, 0x59, 0x9f, 0x3b, 0xaa, - 0x2a, 0x9b, 0xa6, 0x83, 0x27, 0xb0, 0x36, 0xc8, 0xcf, 0xbd, 0xd0, 0xfb, 0xc9, 0xa8, 0xca, 0x30, - 0xc8, 0xb3, 0xb7, 0x8b, 0x17, 0xf9, 0xf7, 0xfa, 0xf9, 0x99, 0x92, 0xfc, 0x9e, 0x69, 0xbc, 0x65, - 0x6f, 0x17, 0x2f, 0xf2, 0x40, 0x55, 0x5b, 0x1f, 0x19, 0xa8, 0xb9, 0xf6, 0xca, 0xde, 0x34, 0xe2, - 0x69, 0x80, 0x3e, 0x81, 0xa5, 0x04, 0x87, 0x50, 0x8e, 0x28, 0xde, 0xb8, 0xae, 0xe1, 0x78, 0x6a, - 0x92, 0x39, 0x03, 0xe5, 0x29, 0xa8, 0x9a, 0x9a, 0xb2, 0x13, 0x86, 0x67, 0xb2, 0xef, 0x55, 0x5a, - 0x62, 0x79, 0x40, 0xc6, 0xd6, 0x5c, 0x1e, 0x90, 0xb9, 0x97, 0x8e, 0xbd, 0x27, 0xd7, 0xc2, 0x4a, - 0xef, 0xd1, 0x5b, 0x6c, 0xe9, 0x3d, 0x86, 0xae, 0x37, 0xce, 0xf2, 0x4a, 0x9f, 0x2a, 0xb3, 0x7c, - 0xb6, 0x13, 0x96, 0x59, 0x3e, 0xd7, 0xd2, 0xc6, 0xaa, 0xe9, 0x9d, 0x58, 0x41, 0xb8, 0x89, 0x16, - 0xa0, 0x20, 0xdc, 0x64, 0x55, 0xfe, 0x02, 0x9a, 0xc6, 0x56, 0x04, 0x7d, 0x28, 0xf6, 0x15, 0xb5, - 0x4d, 0xf6, 0x4e, 0x39, 0x01, 0x17, 0x57, 0xef, 0x05, 0xa4, 0xb8, 0xc6, 0x8e, 0x45, 0x8a, 0x5b, - 0xd0, 0x44, 0xdc, 0x87, 0x15, 0xb5, 0x4e, 0x97, 0xae, 0x98, 0xeb, 0x13, 0xa4, 0x2b, 0x6a, 0x45, - 0xfd, 0x31, 0x34, 0x72, 0x95, 0xa1, 0x3c, 0x4a, 0xbd, 0x7a, 0x95, 0x47, 0x69, 0x2a, 0x26, 0x5f, - 0x40, 0xd3, 0x58, 0x69, 0x4a, 0xcb, 0x15, 0xd5, 0xc4, 0xd2, 0x72, 0xc5, 0x85, 0xea, 0x3d, 0xa8, - 0x49, 0xb4, 0xf4, 0x7d, 0xb5, 0xaa, 0x93, 0xbe, 0x9f, 0x2d, 0xbe, 0x8e, 0xa1, 0x91, 0xfb, 0xa8, - 0xd4, 0x4e, 0xaf, 0x0c, 0xa5, 0x76, 0xa6, 0x32, 0xee, 0x47, 0xb0, 0x61, 0xae, 0x74, 0xd0, 0x4e, - 0xee, 0x3a, 0xd6, 0x2a, 0x36, 0xfb, 0xd6, 0x35, 0x14, 0x34, 0xd8, 0x6f, 0xbc, 0xa8, 0xef, 0xf2, - 0x3f, 0xe2, 0x7d, 0xca, 0x7e, 0x3f, 0x5b, 0x60, 0xff, 0xb2, 0xfb, 0xe4, 0x7f, 0x01, 0x00, 0x00, - 0xff, 0xff, 0x14, 0x45, 0xba, 0x3b, 0xa4, 0x27, 0x00, 0x00, +var fileDescriptor_group_40c147a29abb4e60 = []byte{ + // 2381 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0x4f, 0x6f, 0x1c, 0x49, + 0x15, 0x57, 0xdb, 0x1e, 0xdb, 0xf3, 0x6c, 0x67, 0xec, 0x72, 0xc6, 0x1e, 0x77, 0xbc, 0x59, 0xa7, + 0x37, 0x2c, 0x11, 0x2c, 0xb6, 0x70, 0xa4, 0x08, 0x58, 0x44, 0x88, 0xff, 0xc5, 0x93, 0xf8, 0x0f, + 0xee, 0xc9, 0x72, 0x88, 0x84, 0xc2, 0x64, 0xba, 0x3c, 0x1a, 0x3c, 0xd3, 0xdd, 0xee, 0xea, 0xb1, + 0x03, 0x97, 0x15, 0x97, 0x95, 0x16, 0x21, 0x01, 0x42, 0xe2, 0x04, 0x82, 0x3d, 0xc1, 0x81, 0x03, + 0x07, 0x38, 0x23, 0x3e, 0x06, 0x57, 0xbe, 0x00, 0x9f, 0x00, 0x09, 0x75, 0x55, 0x75, 0x75, 0x75, + 0x57, 0x75, 0x7b, 0xd2, 0x4e, 0x36, 0x97, 0x96, 0xea, 0xd5, 0xab, 0x7a, 0xbf, 0xf7, 0xaa, 0xde, + 0xab, 0x7a, 0xaf, 0x1a, 0x16, 0xba, 0x81, 0x37, 0xf4, 0x37, 0xe8, 0x77, 0xdd, 0x0f, 0xbc, 0xd0, + 0x43, 0x15, 0xda, 0x30, 0xef, 0x1c, 0xfb, 0xd8, 0x7d, 0xd1, 0x3c, 0xdc, 0xf0, 0xcf, 0xba, 0x1b, + 0xb4, 0x67, 0x83, 0x38, 0x67, 0x2f, 0x2e, 0xc9, 0xc6, 0x25, 0x61, 0x9c, 0xe6, 0x57, 0xf3, 0x59, + 0x82, 0xb6, 0xef, 0xe3, 0x80, 0x33, 0x5a, 0xdf, 0x03, 0xd8, 0xf6, 0x06, 0x03, 0xcf, 0xb5, 0x31, + 0xf1, 0x51, 0x03, 0xa6, 0x76, 0x83, 0x60, 0xdb, 0x73, 0x70, 0xc3, 0x58, 0x33, 0xee, 0x55, 0xec, + 0xb8, 0x89, 0x96, 0x60, 0x72, 0x37, 0x08, 0x0e, 0x49, 0xb7, 0x31, 0xb6, 0x66, 0xdc, 0xab, 0xda, + 0xbc, 0x65, 0x3d, 0x01, 0xf4, 0x38, 0x02, 0xf5, 0xc8, 0x71, 0x0e, 0xf1, 0xe0, 0x25, 0x0e, 0x9a, + 0xee, 0xa9, 0x17, 0x71, 0x7f, 0x42, 0x70, 0xd0, 0xdc, 0xa1, 0xd3, 0x54, 0x6d, 0xde, 0x42, 0xab, + 0x50, 0xb5, 0xbd, 0x3e, 0x3e, 0xc0, 0x17, 0xb8, 0x4f, 0x27, 0xaa, 0xd8, 0x09, 0xc1, 0xfa, 0xaf, + 0x01, 0x37, 0xb6, 0x03, 0xdc, 0x0e, 0x31, 0x9d, 0xd2, 0xc6, 0xe7, 0xe8, 0x11, 0xdc, 0x68, 0xba, + 0xbd, 0x90, 0x4d, 0x7d, 0xd0, 0x23, 0x61, 0xc3, 0x58, 0x1b, 0xbf, 0x37, 0xb3, 0xb9, 0xb2, 0xce, + 0xec, 0xa2, 0xca, 0xb6, 0x33, 0x03, 0xd0, 0x77, 0xa0, 0x4a, 0xb9, 0xa2, 0x4e, 0x2a, 0x73, 0x66, + 0x73, 0x75, 0x9d, 0xe0, 0xe0, 0x02, 0x07, 0x2f, 0xda, 0x7e, 0xef, 0x85, 0xdf, 0x0e, 0xda, 0x03, + 0xb2, 0x2e, 0x78, 0xec, 0x84, 0x1d, 0xad, 0xc1, 0xcc, 0xb1, 0x8f, 0x83, 0x76, 0xd8, 0xf3, 0xdc, + 0xe6, 0x4e, 0x63, 0x9c, 0x2a, 0x23, 0x93, 0x90, 0x09, 0xd3, 0xc7, 0x3e, 0xd7, 0x75, 0x82, 0x76, + 0x8b, 0x36, 0x1d, 0x7d, 0xe9, 0xe2, 0x80, 0x77, 0x57, 0xf8, 0xe8, 0x84, 0x64, 0x7d, 0x0a, 0xb5, + 0x94, 0xc2, 0x65, 0x96, 0x20, 0xad, 0xe0, 0xf8, 0x6b, 0x29, 0x68, 0x05, 0x30, 0xff, 0x18, 0x87, + 0xb4, 0x4d, 0x68, 0x1f, 0x3e, 0x8f, 0x60, 0x33, 0x86, 0x1d, 0x61, 0xf0, 0xaa, 0x2d, 0x93, 0xb2, + 0x66, 0x19, 0x2b, 0x36, 0xcb, 0x78, 0xda, 0x2c, 0xd6, 0xe7, 0x06, 0x2c, 0x64, 0x84, 0x96, 0xd2, + 0x7b, 0x0b, 0xe6, 0x84, 0x22, 0x14, 0xe9, 0x38, 0xdd, 0x1a, 0xc5, 0xba, 0xa7, 0x87, 0x58, 0x7f, + 0x30, 0xa0, 0xd6, 0xe2, 0x58, 0x62, 0xfd, 0x0f, 0xa0, 0xd6, 0x8d, 0xdb, 0x7b, 0x5e, 0xd0, 0xc2, + 0x21, 0x45, 0x34, 0xb3, 0x69, 0x15, 0xcd, 0xcc, 0x38, 0xed, 0xec, 0xd0, 0x94, 0x25, 0xc6, 0x34, + 0x1b, 0xa4, 0x70, 0x7b, 0x59, 0xbb, 0x30, 0x9f, 0x86, 0x47, 0x7c, 0xf4, 0x4d, 0xd9, 0x65, 0x39, + 0xb4, 0x05, 0xee, 0x0f, 0x49, 0x87, 0x2d, 0x31, 0x59, 0x3f, 0x03, 0x33, 0xb6, 0xf8, 0x23, 0xdf, + 0xef, 0xf7, 0x3a, 0x74, 0xfe, 0xc8, 0x02, 0x91, 0xc2, 0x32, 0x44, 0xa3, 0x18, 0xa2, 0x66, 0xa9, + 0x6f, 0x03, 0xec, 0x05, 0xde, 0x20, 0xb5, 0xd8, 0x12, 0xc5, 0xfa, 0xbd, 0x01, 0xb7, 0x72, 0x85, + 0x97, 0x5a, 0xf8, 0xa7, 0x30, 0x1f, 0x07, 0x88, 0x21, 0x26, 0xa1, 0xb4, 0xf6, 0xef, 0xe7, 0xad, + 0x10, 0x67, 0xb5, 0x95, 0x81, 0x56, 0x08, 0xab, 0x8f, 0x71, 0x18, 0x61, 0xb5, 0xf1, 0xb9, 0xc6, + 0x38, 0x79, 0xa1, 0xec, 0x7a, 0xeb, 0xfa, 0x47, 0x03, 0xde, 0x2b, 0x10, 0x5b, 0x6a, 0x95, 0xb5, + 0x76, 0x19, 0x2b, 0x6b, 0x97, 0x7f, 0x1a, 0x50, 0x7f, 0x16, 0xb4, 0x5d, 0x72, 0x8a, 0x03, 0xda, + 0x49, 0xe3, 0x56, 0x64, 0x91, 0x06, 0x4c, 0xf1, 0x60, 0xc0, 0x4d, 0x12, 0x37, 0xd1, 0x87, 0x70, + 0xe3, 0xb8, 0xef, 0xc8, 0x31, 0x8f, 0x59, 0x26, 0x43, 0x8d, 0xf8, 0x8e, 0xf0, 0xa5, 0xcc, 0xc7, + 0x4c, 0x94, 0xa1, 0x66, 0xed, 0x38, 0x51, 0x1c, 0x67, 0x2a, 0x99, 0x38, 0xf3, 0x14, 0x96, 0x74, + 0x0a, 0x94, 0xf3, 0xa0, 0xcf, 0x0c, 0x98, 0x7d, 0xe2, 0xf5, 0x5c, 0x71, 0x32, 0xe5, 0x5b, 0xe1, + 0x36, 0x80, 0x8d, 0xcf, 0x0f, 0x31, 0x21, 0xed, 0x2e, 0xe6, 0x16, 0x90, 0x28, 0x45, 0xb1, 0xf1, + 0x6a, 0x8d, 0xad, 0x2d, 0x98, 0x93, 0x70, 0x94, 0x53, 0xe6, 0xdf, 0x91, 0x4b, 0x66, 0xfc, 0x31, + 0xea, 0xf0, 0x5c, 0x82, 0xf9, 0x09, 0x20, 0xa3, 0x30, 0x8a, 0xed, 0x9e, 0xdd, 0xfd, 0x92, 0x65, + 0xc6, 0x15, 0xcb, 0x48, 0xa1, 0x62, 0x22, 0x1b, 0x2a, 0xa2, 0xfe, 0xfd, 0xb6, 0xeb, 0xf4, 0xb1, + 0x13, 0x39, 0x3d, 0x5b, 0x4f, 0x89, 0x82, 0x2c, 0x98, 0x65, 0x2d, 0x1b, 0x93, 0x61, 0x3f, 0x6c, + 0x4c, 0xd2, 0x78, 0x91, 0xa2, 0x59, 0x27, 0xb0, 0x9a, 0xaf, 0x5a, 0x39, 0x73, 0x9d, 0xc2, 0xec, + 0xc9, 0xb0, 0x17, 0x8e, 0xb0, 0xf4, 0xd7, 0x3b, 0x18, 0xb7, 0x60, 0x4e, 0x92, 0x53, 0x0e, 0xeb, + 0x17, 0x06, 0xd4, 0xe3, 0x68, 0x9b, 0x5c, 0x82, 0x8a, 0x51, 0x5f, 0x2b, 0x94, 0x45, 0x01, 0x72, + 0xaf, 0xd7, 0x0f, 0x71, 0x40, 0x17, 0xb4, 0x62, 0xf3, 0x56, 0x24, 0xef, 0x08, 0xbf, 0x0a, 0x5b, + 0xf8, 0x9c, 0xae, 0x64, 0xc5, 0x8e, 0x9b, 0xd6, 0x5f, 0x0d, 0x58, 0xd2, 0x61, 0x2c, 0x75, 0x18, + 0xec, 0x01, 0x0c, 0x92, 0xdb, 0x21, 0x3b, 0x06, 0x3e, 0xcc, 0x0b, 0x77, 0x4c, 0xda, 0xde, 0xb0, + 0xdf, 0xa7, 0xa7, 0xa9, 0x34, 0x32, 0x92, 0xec, 0x72, 0xb8, 0x4c, 0x8f, 0xb8, 0x69, 0xfd, 0x5a, + 0x81, 0x2b, 0xae, 0x4a, 0x85, 0x41, 0x40, 0x82, 0x35, 0x46, 0xef, 0x50, 0xb2, 0xb8, 0xeb, 0x05, + 0x81, 0xdf, 0x1a, 0xb0, 0xac, 0x85, 0xf4, 0x2e, 0x4d, 0x68, 0xfd, 0xcd, 0x00, 0xf4, 0xb4, 0xd7, + 0x39, 0x93, 0xf8, 0x8a, 0x8d, 0xf4, 0x35, 0x98, 0x8f, 0xf8, 0xb1, 0xc3, 0x14, 0x97, 0x4c, 0xa5, + 0xd0, 0x23, 0xf0, 0x36, 0x6e, 0x13, 0xcf, 0xe5, 0xe6, 0xe2, 0xad, 0xac, 0xb1, 0x2a, 0xc5, 0x2e, + 0x37, 0x99, 0x71, 0xb9, 0x8f, 0xa1, 0xda, 0x74, 0x36, 0x59, 0xe8, 0xc8, 0x3d, 0xea, 0xa9, 0x68, + 0x1a, 0x70, 0x58, 0xca, 0xc2, 0x5b, 0xd6, 0xa7, 0xb0, 0xa8, 0xa8, 0x5b, 0x6a, 0x01, 0x1e, 0xc0, + 0x9c, 0x40, 0x21, 0xad, 0xc1, 0x3c, 0x77, 0x75, 0xd1, 0x67, 0xa7, 0xd9, 0xac, 0x21, 0xf5, 0xf5, + 0xe8, 0x38, 0xc0, 0x0e, 0x45, 0x11, 0xfb, 0x7a, 0x3a, 0xd0, 0x1a, 0x4a, 0xa0, 0x5d, 0x83, 0x19, + 0x4f, 0x8d, 0x53, 0xde, 0x88, 0x71, 0xea, 0x33, 0xe6, 0x10, 0x8a, 0xdc, 0x6b, 0x65, 0x2f, 0x23, + 0xdf, 0xe0, 0x13, 0x76, 0xeb, 0xef, 0x06, 0xdc, 0x6c, 0xba, 0x17, 0xbd, 0x10, 0x47, 0xc8, 0x9e, + 0x79, 0x22, 0x42, 0x5f, 0x1d, 0x87, 0xf3, 0x0f, 0xa9, 0x64, 0xa3, 0x4d, 0xa4, 0x36, 0xda, 0x47, + 0xb0, 0xc0, 0x64, 0xc9, 0xbb, 0xb5, 0x42, 0x77, 0xab, 0xda, 0x51, 0xb8, 0xe9, 0x7e, 0x6e, 0x40, + 0x5d, 0x03, 0xfb, 0x4b, 0xdd, 0x3a, 0x2e, 0xdc, 0x14, 0x97, 0xf2, 0x7e, 0x7f, 0x14, 0x67, 0xbd, + 0xde, 0x85, 0xf7, 0x37, 0xd2, 0xb9, 0x24, 0x09, 0x7c, 0xa7, 0xf1, 0xea, 0x77, 0x06, 0x4c, 0x6f, + 0x1f, 0xb6, 0x28, 0x5b, 0x3a, 0x8b, 0x36, 0x5e, 0xaf, 0x4c, 0x70, 0x0f, 0x6a, 0x4c, 0x56, 0x9b, + 0x84, 0x38, 0x38, 0x6a, 0x0f, 0xe2, 0x6b, 0x5f, 0x96, 0x8c, 0xee, 0xf2, 0x9c, 0x95, 0x91, 0x9a, + 0x0e, 0x37, 0x55, 0x9a, 0x18, 0x85, 0xf7, 0x99, 0xd8, 0x58, 0xd1, 0xa2, 0xac, 0x72, 0x6c, 0x74, + 0x66, 0xb6, 0x2c, 0x09, 0x01, 0xed, 0x00, 0xfc, 0xa0, 0xdd, 0xed, 0xb9, 0xd4, 0xd4, 0xbc, 0xc2, + 0x71, 0x57, 0x03, 0x9d, 0xdf, 0xee, 0x13, 0x5e, 0x5b, 0x1a, 0x37, 0xc2, 0x12, 0x7e, 0x61, 0xc0, + 0x6c, 0x82, 0x8a, 0xf8, 0xe8, 0x1b, 0x50, 0x8d, 0xcd, 0x47, 0x78, 0x5d, 0xa6, 0x16, 0xdf, 0x4e, + 0x38, 0xdd, 0x4e, 0x38, 0xde, 0x10, 0x4e, 0x61, 0x8b, 0xe1, 0x80, 0x50, 0x94, 0x15, 0x3b, 0x21, + 0x58, 0x17, 0x09, 0x44, 0x12, 0x59, 0x2e, 0x2d, 0xd3, 0x78, 0x33, 0xb6, 0x51, 0xc3, 0x89, 0xf5, + 0x27, 0x03, 0xe6, 0x24, 0xc1, 0xef, 0xca, 0x38, 0x26, 0x4c, 0xc7, 0xb6, 0xe0, 0xb6, 0x11, 0x6d, + 0xeb, 0x38, 0xa9, 0xba, 0x68, 0xdc, 0xdd, 0x49, 0xbb, 0xbb, 0x33, 0x82, 0xce, 0x67, 0x50, 0x67, + 0x4d, 0x56, 0xbd, 0x6a, 0x85, 0xed, 0x70, 0x48, 0x8a, 0x27, 0x5d, 0x82, 0x49, 0xc6, 0x16, 0x9f, + 0xa4, 0xac, 0x35, 0xc2, 0xe6, 0x6b, 0xc0, 0x92, 0x4e, 0x18, 0xcb, 0xcc, 0x10, 0xef, 0xa2, 0xe9, + 0xb4, 0xd7, 0xc7, 0x57, 0x82, 0xa0, 0x61, 0xcb, 0x89, 0xc3, 0x0a, 0x6b, 0xa5, 0x8b, 0x93, 0xe3, + 0x99, 0xe2, 0xe4, 0x08, 0x97, 0xb2, 0x3a, 0x2c, 0x2a, 0x38, 0x88, 0x6f, 0x1d, 0xc0, 0x8d, 0x1d, + 0xdc, 0xc7, 0x52, 0x51, 0xf3, 0x3a, 0x46, 0x5f, 0x80, 0x5a, 0x6a, 0x36, 0xe2, 0x5b, 0x87, 0x50, + 0x8b, 0x17, 0x76, 0xeb, 0xa7, 0x4d, 0xe7, 0xba, 0x12, 0x1e, 0x26, 0x25, 0x41, 0x36, 0x1d, 0xf1, + 0xd1, 0xd7, 0x93, 0x40, 0xc9, 0x9d, 0x48, 0xd9, 0xcb, 0x82, 0xc1, 0xfa, 0x87, 0x92, 0x82, 0x90, + 0xed, 0xc3, 0x56, 0x31, 0x2c, 0x13, 0xa6, 0x23, 0xa3, 0x49, 0xa1, 0x53, 0xb4, 0x33, 0xae, 0x31, + 0xfe, 0x66, 0x7c, 0x58, 0xb3, 0x7e, 0xff, 0x52, 0xef, 0xf9, 0x14, 0x37, 0xf1, 0xd1, 0xf7, 0x61, + 0x8a, 0x9d, 0x1b, 0xb1, 0x2b, 0x8f, 0x7a, 0xdc, 0xc4, 0xc3, 0xd0, 0xae, 0xc6, 0xbf, 0xbf, 0xa2, + 0x55, 0x82, 0xe5, 0xaa, 0x39, 0x5a, 0xdc, 0x06, 0x60, 0x12, 0xa4, 0xf0, 0x27, 0x51, 0xac, 0x5f, + 0x1a, 0xd0, 0xb0, 0xf1, 0xc0, 0xbb, 0xc0, 0xaf, 0x65, 0xfe, 0x06, 0x4c, 0x31, 0x27, 0x20, 0xfc, + 0xfe, 0x1d, 0x37, 0x5f, 0xab, 0x02, 0xee, 0x64, 0x2a, 0xe0, 0x8e, 0x75, 0x08, 0x2b, 0x39, 0x68, + 0xd8, 0xc1, 0x4f, 0x86, 0x9d, 0x0e, 0x26, 0x84, 0xd7, 0x98, 0xe3, 0x66, 0xe4, 0xa1, 0xa7, 0xed, + 0x5e, 0x1f, 0x3b, 0x1c, 0x0d, 0x6f, 0x59, 0x9f, 0x1b, 0x50, 0x7f, 0xe4, 0x38, 0x6f, 0x43, 0x35, + 0x47, 0x55, 0xcd, 0x29, 0x54, 0xed, 0x09, 0x2c, 0xe9, 0xa0, 0x94, 0xd2, 0xab, 0x07, 0xb5, 0x9d, + 0x1e, 0x19, 0xf4, 0x08, 0x11, 0x31, 0xc2, 0x84, 0x69, 0x2f, 0x53, 0x93, 0xf5, 0xfc, 0x91, 0x6f, + 0xef, 0x0d, 0x98, 0xea, 0xa6, 0x6f, 0xb7, 0xbc, 0x69, 0xed, 0xc2, 0x7c, 0x5a, 0x14, 0x2b, 0x33, + 0x74, 0x46, 0x29, 0x33, 0x24, 0x4c, 0xd6, 0x5f, 0x0c, 0x40, 0x87, 0xc3, 0x10, 0x67, 0x8e, 0x93, + 0xb7, 0x84, 0x3a, 0x32, 0xdc, 0x50, 0x2e, 0x1a, 0xf1, 0x16, 0xb2, 0x60, 0x76, 0x30, 0x0c, 0xb1, + 0xd3, 0xc2, 0x1d, 0xcf, 0x75, 0x08, 0xcd, 0xfe, 0xe6, 0xec, 0x14, 0xcd, 0xda, 0x87, 0x45, 0x05, + 0x69, 0x39, 0xa5, 0x7f, 0x61, 0x40, 0x63, 0xbb, 0xed, 0x76, 0x70, 0xff, 0xdd, 0xab, 0x6e, 0x1d, + 0xc1, 0x4a, 0x0e, 0x96, 0x72, 0xca, 0x9d, 0xc2, 0xac, 0x98, 0xe9, 0x6d, 0x6e, 0xc0, 0x2d, 0x98, + 0x93, 0xe4, 0x94, 0xc3, 0xda, 0x07, 0x94, 0xd1, 0xfd, 0x6d, 0x22, 0xde, 0x87, 0x45, 0x45, 0x5a, + 0x39, 0xdc, 0x7f, 0x36, 0x60, 0xa5, 0x95, 0x3a, 0x61, 0x8e, 0x7a, 0x9d, 0x33, 0xb7, 0x3d, 0x88, + 0x6f, 0x2c, 0xdd, 0x74, 0xea, 0xd5, 0x4d, 0x52, 0x2f, 0x97, 0x33, 0xc6, 0xa7, 0x63, 0xdc, 0x4e, + 0x69, 0x3d, 0x5e, 0xac, 0xf5, 0x84, 0xaa, 0x75, 0xb2, 0xbb, 0x2a, 0xa9, 0xdd, 0x75, 0x0c, 0x66, + 0x1e, 0xd0, 0x72, 0x75, 0xc9, 0x80, 0xbe, 0x40, 0xb1, 0x92, 0x41, 0x6b, 0xe8, 0xf3, 0x92, 0x7c, + 0x5c, 0xaf, 0xc8, 0x00, 0x35, 0x8a, 0x80, 0x8e, 0xa5, 0x22, 0x40, 0x81, 0xfa, 0xd1, 0x61, 0x78, + 0x2b, 0x57, 0x68, 0xa9, 0x15, 0xbc, 0x56, 0xb5, 0xe2, 0x92, 0x5e, 0x8b, 0x12, 0x1c, 0x5f, 0xda, + 0x83, 0xeb, 0xaf, 0xd8, 0xc5, 0x46, 0x91, 0x5c, 0xce, 0x04, 0x6f, 0xe2, 0xd9, 0xf5, 0x3f, 0x63, + 0x50, 0x4f, 0xef, 0x2f, 0xa9, 0xa2, 0x9a, 0xe3, 0x04, 0x25, 0x76, 0xc0, 0x08, 0x0e, 0xf0, 0x2d, + 0xc9, 0xb5, 0x2a, 0x3c, 0xeb, 0xef, 0x7a, 0x5e, 0xb7, 0x8f, 0xd9, 0x0f, 0x12, 0x2f, 0x87, 0xa7, + 0xeb, 0xad, 0x30, 0xe8, 0xb9, 0xdd, 0x1f, 0xb6, 0xfb, 0x43, 0x2c, 0x39, 0xde, 0x03, 0x98, 0x3a, + 0x6d, 0x77, 0xf0, 0x27, 0xf6, 0x01, 0x2d, 0xf0, 0x5c, 0x35, 0x30, 0x66, 0x46, 0xdf, 0x86, 0x6a, + 0x20, 0xd2, 0x8c, 0x29, 0x3a, 0xf2, 0x96, 0x32, 0xb2, 0xe9, 0x86, 0xf7, 0x37, 0xd9, 0xc0, 0x84, + 0x1b, 0x7d, 0x04, 0x63, 0xf8, 0x55, 0x63, 0x7a, 0x04, 0x69, 0x63, 0xf8, 0x95, 0xf5, 0x14, 0x96, + 0x74, 0x36, 0x2e, 0xe5, 0xbf, 0x9b, 0xff, 0x5b, 0x04, 0xf6, 0xf7, 0x09, 0xfa, 0x2e, 0xcc, 0x74, + 0x92, 0x7f, 0x16, 0x50, 0x3d, 0x1e, 0x97, 0xfa, 0x71, 0xc3, 0x5c, 0xd2, 0x91, 0x89, 0x8f, 0x1e, + 0x40, 0xf5, 0x27, 0xf1, 0xf3, 0x15, 0x5a, 0xe4, 0x4c, 0xf2, 0xc3, 0x9a, 0x79, 0x53, 0x25, 0xb2, + 0x71, 0xe7, 0xf1, 0xdb, 0x88, 0x18, 0x27, 0xbf, 0xca, 0x88, 0x71, 0xe9, 0x27, 0x94, 0x2d, 0x98, + 0xeb, 0xca, 0xff, 0x1a, 0xa0, 0xe5, 0xf8, 0xcf, 0x91, 0xcc, 0x6f, 0x0f, 0x66, 0x43, 0xdf, 0x41, + 0x7c, 0xf4, 0x10, 0x66, 0x89, 0xf4, 0x08, 0x8f, 0x62, 0xdd, 0x32, 0x3f, 0x0e, 0x98, 0xcb, 0x5a, + 0x3a, 0xf1, 0xd1, 0x8f, 0x61, 0xb9, 0xab, 0x7f, 0x01, 0x47, 0x77, 0x32, 0x52, 0xd5, 0x17, 0x68, + 0xd3, 0xba, 0x8a, 0x85, 0xf8, 0xe8, 0x14, 0x56, 0xba, 0x79, 0xcf, 0xc9, 0xe8, 0x83, 0x64, 0x82, + 0xdc, 0x77, 0x6e, 0xf3, 0xee, 0xd5, 0x4c, 0xc4, 0x47, 0x27, 0x80, 0x42, 0xe5, 0x4d, 0x15, 0xad, + 0xf2, 0xb1, 0xda, 0xf7, 0x62, 0xf3, 0xbd, 0x82, 0x5e, 0xe2, 0xa3, 0x0e, 0x34, 0xba, 0x39, 0x0f, + 0x76, 0xc8, 0x4a, 0xfd, 0xe6, 0xa3, 0x7d, 0xac, 0x34, 0x3f, 0xb8, 0x92, 0x87, 0xe1, 0xee, 0x2a, + 0x2f, 0x4e, 0x02, 0xb7, 0xf6, 0xc1, 0x4c, 0xe0, 0xce, 0x79, 0xaa, 0x7a, 0x06, 0x8b, 0x5d, 0xf5, + 0x09, 0x06, 0xe9, 0x47, 0x89, 0x5d, 0x76, 0xbb, 0xa8, 0x9b, 0xf8, 0x68, 0x1f, 0x6a, 0x67, 0xe9, + 0x37, 0x05, 0x14, 0xff, 0xeb, 0xa4, 0x3e, 0xad, 0x98, 0x66, 0x5e, 0x97, 0x50, 0x39, 0x53, 0xa4, + 0x97, 0x55, 0x56, 0xdf, 0x0d, 0x64, 0x95, 0x75, 0xd5, 0xfd, 0x23, 0x58, 0xe8, 0x65, 0xeb, 0xd6, + 0xe8, 0x56, 0x5c, 0x6a, 0xd6, 0x14, 0xe2, 0xcd, 0xd5, 0xfc, 0x4e, 0x36, 0x5f, 0x37, 0x5b, 0x13, + 0x16, 0xf3, 0xe9, 0xca, 0xd3, 0xe6, 0x6a, 0x7e, 0x27, 0x73, 0x54, 0xb9, 0x74, 0x21, 0x1c, 0x35, + 0x53, 0x1e, 0x31, 0x97, 0xb5, 0x74, 0xe2, 0xa3, 0xfb, 0x30, 0x1d, 0xd3, 0x10, 0xca, 0x30, 0x45, + 0x03, 0x17, 0x15, 0x1a, 0x0b, 0x4d, 0x22, 0x66, 0xa0, 0x2c, 0x07, 0x91, 0x43, 0x53, 0xba, 0x42, + 0x78, 0x22, 0xea, 0x56, 0x52, 0x49, 0x4b, 0x2c, 0x90, 0xb6, 0xb4, 0x26, 0x16, 0x48, 0x5f, 0x0b, + 0x8b, 0x76, 0x4f, 0xa6, 0x04, 0x25, 0x76, 0x8f, 0x5a, 0x22, 0x13, 0xbb, 0x47, 0x53, 0xb5, 0x8a, + 0xa2, 0xbc, 0x54, 0x67, 0x12, 0x51, 0x3e, 0x5d, 0xc9, 0x12, 0x51, 0x3e, 0x53, 0x92, 0x8a, 0x54, + 0x53, 0x2b, 0x29, 0x39, 0xee, 0xc6, 0x53, 0xf8, 0x1c, 0x77, 0x13, 0x59, 0xf5, 0x73, 0xa8, 0x6b, + 0x4b, 0x09, 0xe8, 0x7d, 0x3e, 0x2e, 0xaf, 0xec, 0x61, 0xae, 0x15, 0x33, 0x30, 0xb8, 0x6a, 0x2e, + 0x2f, 0xe0, 0x6a, 0x2b, 0x0e, 0x02, 0x6e, 0x4e, 0x11, 0xe0, 0x21, 0xcc, 0xca, 0x79, 0xb6, 0xd8, + 0x8a, 0x99, 0x3c, 0x5f, 0x6c, 0x45, 0x25, 0x29, 0xdf, 0x87, 0x5a, 0x26, 0xb3, 0x13, 0x4b, 0xa9, + 0x66, 0x9f, 0x62, 0x29, 0x75, 0xc9, 0xe0, 0x73, 0xa8, 0x6b, 0x33, 0x45, 0x61, 0xb9, 0xbc, 0x9c, + 0x56, 0x58, 0x2e, 0x3f, 0xd1, 0x7c, 0x00, 0x55, 0x41, 0x16, 0x7b, 0x5f, 0xce, 0xca, 0xc4, 0xde, + 0x4f, 0x27, 0x4f, 0xfb, 0x50, 0xcb, 0x4c, 0x2a, 0xb4, 0x53, 0x33, 0x3b, 0xa1, 0x9d, 0x2e, 0x0d, + 0xfb, 0x51, 0xf6, 0x96, 0x13, 0x67, 0x2a, 0x68, 0x2d, 0x73, 0x1c, 0x2b, 0x19, 0x97, 0x79, 0xe7, + 0x0a, 0x0e, 0x76, 0x74, 0xe7, 0xa4, 0x10, 0xf2, 0xd1, 0x9d, 0x93, 0xd7, 0xc8, 0x47, 0x77, 0x6e, + 0x16, 0xc2, 0x7c, 0x25, 0x73, 0x39, 0x97, 0x7d, 0x45, 0xcd, 0x18, 0x64, 0x5f, 0xd1, 0xdd, 0xea, + 0x4f, 0x00, 0xa9, 0x37, 0x3f, 0x31, 0xa5, 0xf6, 0xe2, 0x2d, 0xa6, 0xd4, 0x5f, 0x19, 0xb7, 0x6a, + 0xcf, 0xe7, 0xd6, 0xd9, 0xbf, 0xc8, 0x1f, 0xd3, 0xef, 0xcb, 0x49, 0x7a, 0xef, 0xbc, 0xff, 0xff, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xe6, 0x70, 0x4b, 0xcf, 0xa7, 0x2c, 0x00, 0x00, } diff --git a/pkg/proto/group/group.proto b/pkg/proto/group/group.proto index f0db47bad..db9d23273 100644 --- a/pkg/proto/group/group.proto +++ b/pkg/proto/group/group.proto @@ -1,5 +1,6 @@ syntax = "proto3"; import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +import "Open_IM/pkg/proto/sdk_ws/wrappers.proto"; option go_package = "./group;group"; package group; @@ -13,7 +14,6 @@ message GroupAddMemberInfo{ int32 RoleLevel = 2; } - message CreateGroupReq{ repeated GroupAddMemberInfo InitMemberList = 1; server_api_params.GroupInfo GroupInfo = 2; @@ -43,7 +43,7 @@ message GetGroupsInfoResp{ message SetGroupInfoReq{ - server_api_params.GroupInfo GroupInfo = 1; + server_api_params.GroupInfoForSet groupInfoForSet = 1; string OpUserID = 2; //app manager or group owner string OperationID = 3; } @@ -391,8 +391,42 @@ message SetGroupMemberNicknameResp{ CommonResp CommonResp = 1; } +message GetJoinedSuperGroupListReq { + string operationID = 1; + string userID = 2; + string opUserID = 3; +} +message GetJoinedSuperGroupListResp { + CommonResp commonResp = 1; + repeated server_api_params.GroupInfo GroupList = 3; +} +message GetSuperGroupsInfoReq { + repeated string GroupIDList = 1; + string OperationID = 2; + string OpUserID = 3; //No verification permission +} + +message GetSuperGroupsInfoResp { + CommonResp commonResp = 1; + repeated server_api_params.GroupInfo GroupInfoList = 3; +} + +message SetGroupMemberInfoReq{ + string groupID = 1; + string userID = 2; + string opUserID = 3; + string operationID = 4; + google.protobuf.StringValue nickname = 5; + google.protobuf.StringValue faceURL = 6; + google.protobuf.Int32Value roleLevel = 7; + google.protobuf.StringValue ex = 8; +} + +message SetGroupMemberInfoResp{ + CommonResp CommonResp = 1; +} service group{ rpc createGroup(CreateGroupReq) returns(CreateGroupResp); @@ -429,6 +463,10 @@ service group{ rpc SetGroupMemberNickname(SetGroupMemberNicknameReq) returns (SetGroupMemberNicknameResp); + rpc GetJoinedSuperGroupList(GetJoinedSuperGroupListReq) returns (GetJoinedSuperGroupListResp); + rpc GetSuperGroupsInfo(GetSuperGroupsInfoReq) returns (GetSuperGroupsInfoResp); + rpc SetGroupMemberInfo(SetGroupMemberInfoReq) returns (SetGroupMemberInfoResp); + } diff --git a/pkg/proto/organization/organization.pb.go b/pkg/proto/organization/organization.pb.go index 803c23fad..4aec922db 100644 --- a/pkg/proto/organization/organization.pb.go +++ b/pkg/proto/organization/organization.pb.go @@ -37,7 +37,7 @@ func (m *CreateDepartmentReq) Reset() { *m = CreateDepartmentReq{} } func (m *CreateDepartmentReq) String() string { return proto.CompactTextString(m) } func (*CreateDepartmentReq) ProtoMessage() {} func (*CreateDepartmentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{0} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{0} } func (m *CreateDepartmentReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateDepartmentReq.Unmarshal(m, b) @@ -91,7 +91,7 @@ func (m *CreateDepartmentResp) Reset() { *m = CreateDepartmentResp{} } func (m *CreateDepartmentResp) String() string { return proto.CompactTextString(m) } func (*CreateDepartmentResp) ProtoMessage() {} func (*CreateDepartmentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{1} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{1} } func (m *CreateDepartmentResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateDepartmentResp.Unmarshal(m, b) @@ -145,7 +145,7 @@ func (m *UpdateDepartmentReq) Reset() { *m = UpdateDepartmentReq{} } func (m *UpdateDepartmentReq) String() string { return proto.CompactTextString(m) } func (*UpdateDepartmentReq) ProtoMessage() {} func (*UpdateDepartmentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{2} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{2} } func (m *UpdateDepartmentReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateDepartmentReq.Unmarshal(m, b) @@ -198,7 +198,7 @@ func (m *UpdateDepartmentResp) Reset() { *m = UpdateDepartmentResp{} } func (m *UpdateDepartmentResp) String() string { return proto.CompactTextString(m) } func (*UpdateDepartmentResp) ProtoMessage() {} func (*UpdateDepartmentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{3} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{3} } func (m *UpdateDepartmentResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateDepartmentResp.Unmarshal(m, b) @@ -245,7 +245,7 @@ func (m *GetSubDepartmentReq) Reset() { *m = GetSubDepartmentReq{} } func (m *GetSubDepartmentReq) String() string { return proto.CompactTextString(m) } func (*GetSubDepartmentReq) ProtoMessage() {} func (*GetSubDepartmentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{4} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{4} } func (m *GetSubDepartmentReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetSubDepartmentReq.Unmarshal(m, b) @@ -299,7 +299,7 @@ func (m *GetSubDepartmentResp) Reset() { *m = GetSubDepartmentResp{} } func (m *GetSubDepartmentResp) String() string { return proto.CompactTextString(m) } func (*GetSubDepartmentResp) ProtoMessage() {} func (*GetSubDepartmentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{5} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{5} } func (m *GetSubDepartmentResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetSubDepartmentResp.Unmarshal(m, b) @@ -353,7 +353,7 @@ func (m *DeleteDepartmentReq) Reset() { *m = DeleteDepartmentReq{} } func (m *DeleteDepartmentReq) String() string { return proto.CompactTextString(m) } func (*DeleteDepartmentReq) ProtoMessage() {} func (*DeleteDepartmentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{6} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{6} } func (m *DeleteDepartmentReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteDepartmentReq.Unmarshal(m, b) @@ -406,7 +406,7 @@ func (m *DeleteDepartmentResp) Reset() { *m = DeleteDepartmentResp{} } func (m *DeleteDepartmentResp) String() string { return proto.CompactTextString(m) } func (*DeleteDepartmentResp) ProtoMessage() {} func (*DeleteDepartmentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{7} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{7} } func (m *DeleteDepartmentResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteDepartmentResp.Unmarshal(m, b) @@ -452,7 +452,7 @@ func (m *GetDepartmentParentIDListReq) Reset() { *m = GetDepartmentParen func (m *GetDepartmentParentIDListReq) String() string { return proto.CompactTextString(m) } func (*GetDepartmentParentIDListReq) ProtoMessage() {} func (*GetDepartmentParentIDListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{8} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{8} } func (m *GetDepartmentParentIDListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetDepartmentParentIDListReq.Unmarshal(m, b) @@ -499,7 +499,7 @@ func (m *GetDepartmentParentIDListResp) Reset() { *m = GetDepartmentPare func (m *GetDepartmentParentIDListResp) String() string { return proto.CompactTextString(m) } func (*GetDepartmentParentIDListResp) ProtoMessage() {} func (*GetDepartmentParentIDListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{9} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{9} } func (m *GetDepartmentParentIDListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetDepartmentParentIDListResp.Unmarshal(m, b) @@ -544,6 +544,7 @@ type CreateOrganizationUserReq struct { OrganizationUser *sdk_ws.OrganizationUser `protobuf:"bytes,1,opt,name=organizationUser" json:"organizationUser,omitempty"` OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + IsRegister bool `protobuf:"varint,4,opt,name=IsRegister" json:"IsRegister,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -553,7 +554,7 @@ func (m *CreateOrganizationUserReq) Reset() { *m = CreateOrganizationUse func (m *CreateOrganizationUserReq) String() string { return proto.CompactTextString(m) } func (*CreateOrganizationUserReq) ProtoMessage() {} func (*CreateOrganizationUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{10} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{10} } func (m *CreateOrganizationUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateOrganizationUserReq.Unmarshal(m, b) @@ -594,6 +595,13 @@ func (m *CreateOrganizationUserReq) GetOpUserID() string { return "" } +func (m *CreateOrganizationUserReq) GetIsRegister() bool { + if m != nil { + return m.IsRegister + } + return false +} + type CreateOrganizationUserResp struct { ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` @@ -606,7 +614,7 @@ func (m *CreateOrganizationUserResp) Reset() { *m = CreateOrganizationUs func (m *CreateOrganizationUserResp) String() string { return proto.CompactTextString(m) } func (*CreateOrganizationUserResp) ProtoMessage() {} func (*CreateOrganizationUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{11} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{11} } func (m *CreateOrganizationUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateOrganizationUserResp.Unmarshal(m, b) @@ -653,7 +661,7 @@ func (m *UpdateOrganizationUserReq) Reset() { *m = UpdateOrganizationUse func (m *UpdateOrganizationUserReq) String() string { return proto.CompactTextString(m) } func (*UpdateOrganizationUserReq) ProtoMessage() {} func (*UpdateOrganizationUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{12} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{12} } func (m *UpdateOrganizationUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateOrganizationUserReq.Unmarshal(m, b) @@ -706,7 +714,7 @@ func (m *UpdateOrganizationUserResp) Reset() { *m = UpdateOrganizationUs func (m *UpdateOrganizationUserResp) String() string { return proto.CompactTextString(m) } func (*UpdateOrganizationUserResp) ProtoMessage() {} func (*UpdateOrganizationUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{13} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{13} } func (m *UpdateOrganizationUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateOrganizationUserResp.Unmarshal(m, b) @@ -753,7 +761,7 @@ func (m *CreateDepartmentMemberReq) Reset() { *m = CreateDepartmentMembe func (m *CreateDepartmentMemberReq) String() string { return proto.CompactTextString(m) } func (*CreateDepartmentMemberReq) ProtoMessage() {} func (*CreateDepartmentMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{14} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{14} } func (m *CreateDepartmentMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateDepartmentMemberReq.Unmarshal(m, b) @@ -806,7 +814,7 @@ func (m *CreateDepartmentMemberResp) Reset() { *m = CreateDepartmentMemb func (m *CreateDepartmentMemberResp) String() string { return proto.CompactTextString(m) } func (*CreateDepartmentMemberResp) ProtoMessage() {} func (*CreateDepartmentMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{15} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{15} } func (m *CreateDepartmentMemberResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateDepartmentMemberResp.Unmarshal(m, b) @@ -853,7 +861,7 @@ func (m *GetUserInDepartmentReq) Reset() { *m = GetUserInDepartmentReq{} func (m *GetUserInDepartmentReq) String() string { return proto.CompactTextString(m) } func (*GetUserInDepartmentReq) ProtoMessage() {} func (*GetUserInDepartmentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{16} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{16} } func (m *GetUserInDepartmentReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserInDepartmentReq.Unmarshal(m, b) @@ -907,7 +915,7 @@ func (m *GetUserInDepartmentResp) Reset() { *m = GetUserInDepartmentResp func (m *GetUserInDepartmentResp) String() string { return proto.CompactTextString(m) } func (*GetUserInDepartmentResp) ProtoMessage() {} func (*GetUserInDepartmentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{17} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{17} } func (m *GetUserInDepartmentResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserInDepartmentResp.Unmarshal(m, b) @@ -961,7 +969,7 @@ func (m *UpdateUserInDepartmentReq) Reset() { *m = UpdateUserInDepartmen func (m *UpdateUserInDepartmentReq) String() string { return proto.CompactTextString(m) } func (*UpdateUserInDepartmentReq) ProtoMessage() {} func (*UpdateUserInDepartmentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{18} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{18} } func (m *UpdateUserInDepartmentReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateUserInDepartmentReq.Unmarshal(m, b) @@ -1014,7 +1022,7 @@ func (m *UpdateUserInDepartmentResp) Reset() { *m = UpdateUserInDepartme func (m *UpdateUserInDepartmentResp) String() string { return proto.CompactTextString(m) } func (*UpdateUserInDepartmentResp) ProtoMessage() {} func (*UpdateUserInDepartmentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{19} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{19} } func (m *UpdateUserInDepartmentResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateUserInDepartmentResp.Unmarshal(m, b) @@ -1062,7 +1070,7 @@ func (m *DeleteUserInDepartmentReq) Reset() { *m = DeleteUserInDepartmen func (m *DeleteUserInDepartmentReq) String() string { return proto.CompactTextString(m) } func (*DeleteUserInDepartmentReq) ProtoMessage() {} func (*DeleteUserInDepartmentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{20} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{20} } func (m *DeleteUserInDepartmentReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteUserInDepartmentReq.Unmarshal(m, b) @@ -1122,7 +1130,7 @@ func (m *DeleteUserInDepartmentResp) Reset() { *m = DeleteUserInDepartme func (m *DeleteUserInDepartmentResp) String() string { return proto.CompactTextString(m) } func (*DeleteUserInDepartmentResp) ProtoMessage() {} func (*DeleteUserInDepartmentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{21} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{21} } func (m *DeleteUserInDepartmentResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteUserInDepartmentResp.Unmarshal(m, b) @@ -1169,7 +1177,7 @@ func (m *DeleteOrganizationUserReq) Reset() { *m = DeleteOrganizationUse func (m *DeleteOrganizationUserReq) String() string { return proto.CompactTextString(m) } func (*DeleteOrganizationUserReq) ProtoMessage() {} func (*DeleteOrganizationUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{22} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{22} } func (m *DeleteOrganizationUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteOrganizationUserReq.Unmarshal(m, b) @@ -1222,7 +1230,7 @@ func (m *DeleteOrganizationUserResp) Reset() { *m = DeleteOrganizationUs func (m *DeleteOrganizationUserResp) String() string { return proto.CompactTextString(m) } func (*DeleteOrganizationUserResp) ProtoMessage() {} func (*DeleteOrganizationUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{23} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{23} } func (m *DeleteOrganizationUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteOrganizationUserResp.Unmarshal(m, b) @@ -1269,7 +1277,7 @@ func (m *GetDepartmentMemberReq) Reset() { *m = GetDepartmentMemberReq{} func (m *GetDepartmentMemberReq) String() string { return proto.CompactTextString(m) } func (*GetDepartmentMemberReq) ProtoMessage() {} func (*GetDepartmentMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{24} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{24} } func (m *GetDepartmentMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetDepartmentMemberReq.Unmarshal(m, b) @@ -1323,7 +1331,7 @@ func (m *GetDepartmentMemberResp) Reset() { *m = GetDepartmentMemberResp func (m *GetDepartmentMemberResp) String() string { return proto.CompactTextString(m) } func (*GetDepartmentMemberResp) ProtoMessage() {} func (*GetDepartmentMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{25} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{25} } func (m *GetDepartmentMemberResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetDepartmentMemberResp.Unmarshal(m, b) @@ -1376,7 +1384,7 @@ func (m *GetDepartmentRelatedGroupIDListReq) Reset() { *m = GetDepartmen func (m *GetDepartmentRelatedGroupIDListReq) String() string { return proto.CompactTextString(m) } func (*GetDepartmentRelatedGroupIDListReq) ProtoMessage() {} func (*GetDepartmentRelatedGroupIDListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{26} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{26} } func (m *GetDepartmentRelatedGroupIDListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetDepartmentRelatedGroupIDListReq.Unmarshal(m, b) @@ -1423,7 +1431,7 @@ func (m *GetDepartmentRelatedGroupIDListResp) Reset() { *m = GetDepartme func (m *GetDepartmentRelatedGroupIDListResp) String() string { return proto.CompactTextString(m) } func (*GetDepartmentRelatedGroupIDListResp) ProtoMessage() {} func (*GetDepartmentRelatedGroupIDListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{27} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{27} } func (m *GetDepartmentRelatedGroupIDListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetDepartmentRelatedGroupIDListResp.Unmarshal(m, b) @@ -1997,62 +2005,64 @@ var _Organization_serviceDesc = grpc.ServiceDesc{ } func init() { - proto.RegisterFile("organization/organization.proto", fileDescriptor_organization_6d9a9b5829486353) + proto.RegisterFile("organization/organization.proto", fileDescriptor_organization_2845c40b2de0bcf0) } -var fileDescriptor_organization_6d9a9b5829486353 = []byte{ - // 846 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcf, 0x6e, 0xd3, 0x4c, - 0x10, 0x97, 0x9b, 0xef, 0x2b, 0x74, 0x52, 0xa1, 0x68, 0x5b, 0x85, 0xd4, 0x50, 0x35, 0x75, 0x5b, - 0x35, 0x2a, 0x52, 0x02, 0xe5, 0xc8, 0x8d, 0x06, 0xa5, 0x91, 0x28, 0x41, 0x41, 0x3d, 0x94, 0x4b, - 0xe4, 0xe0, 0x25, 0x8a, 0xd2, 0xda, 0xdb, 0xb5, 0x43, 0x45, 0x1f, 0x80, 0x2b, 0x27, 0x2e, 0x88, - 0x27, 0xe0, 0xc4, 0x9b, 0xf0, 0x4a, 0xc8, 0x6b, 0x37, 0x59, 0xef, 0x8e, 0x93, 0xd4, 0x4d, 0x51, - 0x39, 0x7a, 0xb2, 0xfb, 0x9b, 0x7f, 0x3b, 0x33, 0xbf, 0x09, 0x6c, 0x78, 0xbc, 0x67, 0xbb, 0xfd, - 0x4b, 0x3b, 0xe8, 0x7b, 0x6e, 0x4d, 0xfe, 0xa8, 0x32, 0xee, 0x05, 0x1e, 0x59, 0x96, 0x65, 0xe6, - 0x66, 0x8b, 0x51, 0xb7, 0xd3, 0x3c, 0xaa, 0xb1, 0x41, 0xaf, 0x26, 0x0e, 0xd4, 0x7c, 0x67, 0xd0, - 0xb9, 0xf0, 0x6b, 0x17, 0x7e, 0x74, 0xc1, 0xfa, 0x6e, 0xc0, 0xca, 0x01, 0xa7, 0x76, 0x40, 0xeb, - 0x94, 0xd9, 0x3c, 0x38, 0xa3, 0x6e, 0xd0, 0xa6, 0xe7, 0xe4, 0x15, 0x3c, 0x70, 0x46, 0x82, 0xa6, - 0xfb, 0xd1, 0x2b, 0x19, 0x65, 0xa3, 0x92, 0xdf, 0x5f, 0xaf, 0xfa, 0x94, 0x7f, 0xa2, 0xbc, 0x63, - 0xb3, 0x7e, 0x87, 0xd9, 0xdc, 0x3e, 0xf3, 0xab, 0xd2, 0x4d, 0xe5, 0x12, 0x29, 0x43, 0xde, 0x63, - 0x94, 0x0b, 0x73, 0x9a, 0xf5, 0xd2, 0x42, 0xd9, 0xa8, 0x2c, 0xb5, 0x65, 0x11, 0x31, 0xe1, 0xbe, - 0xc7, 0x8e, 0x7d, 0xca, 0x9b, 0xf5, 0x52, 0x4e, 0xfc, 0x3c, 0xfa, 0xb6, 0xbe, 0x1a, 0xb0, 0xaa, - 0x1b, 0xe7, 0x33, 0x52, 0x82, 0x7b, 0x94, 0xf3, 0x03, 0xcf, 0xa1, 0xc2, 0xac, 0xff, 0xdb, 0x57, - 0x9f, 0xa4, 0x08, 0x8b, 0x94, 0xf3, 0x23, 0xbf, 0x17, 0xeb, 0x8a, 0xbf, 0x10, 0x7f, 0x72, 0x19, - 0xfc, 0x11, 0xe1, 0x3a, 0x66, 0xce, 0xdd, 0x0c, 0xd7, 0x21, 0xac, 0xea, 0xb6, 0x65, 0x89, 0x96, - 0x75, 0x01, 0x2b, 0x0d, 0x1a, 0xbc, 0x1b, 0x76, 0x93, 0x5e, 0x5a, 0xb0, 0x2c, 0x19, 0x5c, 0x17, - 0x68, 0x4b, 0xed, 0x84, 0x6c, 0x0e, 0x19, 0xd7, 0x35, 0xdf, 0x3c, 0xe3, 0xaf, 0xfb, 0x7e, 0x50, - 0xca, 0x95, 0x73, 0xd7, 0x4a, 0x49, 0x78, 0x29, 0x0c, 0x45, 0x9d, 0x9e, 0x52, 0x35, 0xe1, 0xb7, - 0x1f, 0x8a, 0x43, 0x58, 0xd5, 0x15, 0x67, 0xca, 0xa6, 0x03, 0x8f, 0x1b, 0x34, 0x18, 0xc3, 0xbc, - 0xb5, 0xb9, 0x30, 0x30, 0xf4, 0x6f, 0x6e, 0xbe, 0x58, 0x43, 0x58, 0x9f, 0xa0, 0x25, 0x53, 0x0a, - 0x2d, 0x58, 0x66, 0x12, 0x8a, 0x48, 0xe0, 0x52, 0x3b, 0x21, 0xb3, 0x7e, 0x1a, 0xb0, 0x16, 0xf5, - 0x88, 0x96, 0xd4, 0xfa, 0xc2, 0x18, 0x86, 0xae, 0xb5, 0xa0, 0xe0, 0x29, 0xe2, 0xb8, 0x32, 0xb7, - 0x90, 0x67, 0xa0, 0x21, 0x68, 0x97, 0x6f, 0x98, 0xd3, 0x37, 0x60, 0xa6, 0xd9, 0x9a, 0x29, 0xb3, - 0xa1, 0xf3, 0x51, 0xc9, 0xff, 0x1b, 0xce, 0xa7, 0xd9, 0x9a, 0xd9, 0x79, 0x75, 0x3a, 0x1c, 0xd1, - 0xb3, 0xee, 0xc8, 0x79, 0x47, 0x11, 0x4f, 0x70, 0x5e, 0x43, 0xd0, 0x2e, 0xcf, 0x2b, 0xf3, 0xba, - 0xad, 0x99, 0x9c, 0x77, 0xa1, 0xd8, 0xa0, 0x81, 0x00, 0x77, 0x93, 0x9d, 0xa9, 0x08, 0x8b, 0xc3, - 0xc8, 0x86, 0xa8, 0x8e, 0xe3, 0xaf, 0x1b, 0xda, 0xff, 0xc3, 0x80, 0x87, 0xa8, 0xc2, 0x4c, 0x85, - 0xdd, 0x82, 0xc2, 0x50, 0x41, 0x8a, 0xe7, 0x31, 0x96, 0x1c, 0x4d, 0xa9, 0x76, 0x59, 0x2a, 0x04, - 0x2c, 0x24, 0x77, 0xef, 0x2d, 0xa4, 0xd9, 0x9a, 0xe9, 0x2d, 0x7c, 0x33, 0x60, 0x2d, 0x1a, 0x15, - 0x7f, 0xed, 0x3d, 0x68, 0x33, 0xe3, 0x3f, 0x7d, 0x66, 0x84, 0x7e, 0xa6, 0x99, 0x95, 0xc9, 0xcf, - 0xf3, 0x2b, 0x37, 0xb1, 0x66, 0x77, 0x3b, 0xcf, 0x7e, 0xe4, 0xc2, 0x9c, 0x7a, 0xd6, 0xa5, 0x28, - 0x5b, 0xac, 0x5f, 0xdd, 0x3e, 0xa1, 0xf8, 0x15, 0x95, 0xf0, 0x7c, 0x1a, 0x10, 0xf9, 0x00, 0xa5, - 0x30, 0xc2, 0x2a, 0x9a, 0x44, 0xb4, 0x76, 0x53, 0x4a, 0x59, 0x33, 0x20, 0x15, 0xc8, 0xe2, 0x60, - 0x25, 0x2c, 0x6e, 0xd3, 0x53, 0x3b, 0xa0, 0x4e, 0x83, 0x7b, 0x43, 0x36, 0xe6, 0x2f, 0x4a, 0x58, - 0x0c, 0x3d, 0x2c, 0x7b, 0x72, 0x03, 0x88, 0xc9, 0xc4, 0x82, 0x20, 0x13, 0x9a, 0xdc, 0xfa, 0x0c, - 0x5b, 0x53, 0x75, 0x66, 0x8a, 0x58, 0x19, 0xf2, 0xbd, 0x31, 0x48, 0x4c, 0x66, 0x64, 0xd1, 0xfe, - 0xef, 0x3c, 0x24, 0x16, 0x38, 0x72, 0x02, 0x05, 0x75, 0x6a, 0x90, 0xcd, 0x6a, 0x62, 0xef, 0x43, - 0x96, 0x37, 0xd3, 0x9a, 0x76, 0xc4, 0x67, 0x21, 0xb4, 0xba, 0x2c, 0xa8, 0xd0, 0xc8, 0xa2, 0xa3, - 0x42, 0xa3, 0xfb, 0xc6, 0x09, 0x14, 0x54, 0x0e, 0xaf, 0x42, 0x23, 0xdb, 0x85, 0x0a, 0x8d, 0xae, - 0x01, 0x27, 0x50, 0x50, 0x49, 0xb1, 0x0a, 0x8d, 0xb0, 0x75, 0x15, 0x1a, 0xe5, 0xd5, 0x01, 0xac, - 0xa5, 0xf2, 0x57, 0xb2, 0xa7, 0xd9, 0x96, 0x4a, 0xa7, 0xcd, 0x27, 0x33, 0x9f, 0xf5, 0x19, 0x19, - 0x40, 0x11, 0x67, 0x84, 0x64, 0x17, 0x4b, 0x22, 0xd2, 0xf9, 0xcc, 0xca, 0x6c, 0x07, 0x23, 0x65, - 0x38, 0x03, 0x53, 0x95, 0xa5, 0x72, 0x4a, 0x55, 0xd9, 0x04, 0x42, 0x37, 0x80, 0x22, 0xde, 0x3a, - 0x55, 0x65, 0xa9, 0x3d, 0x5d, 0x55, 0x36, 0xa1, 0x13, 0x8f, 0xc2, 0xa8, 0xb6, 0x11, 0x3c, 0x8c, - 0x48, 0x03, 0xc6, 0xc3, 0x88, 0x36, 0xcb, 0xae, 0xd8, 0x8e, 0xd5, 0xa1, 0x46, 0xb6, 0xb5, 0xbc, - 0x23, 0xe3, 0xd8, 0xdc, 0x99, 0xe1, 0x94, 0x1c, 0x3d, 0x4d, 0x0d, 0x1a, 0x3d, 0x4c, 0x53, 0x65, - 0xb6, 0x83, 0xf2, 0xbb, 0x98, 0xa6, 0x2c, 0x95, 0x62, 0xe1, 0xef, 0x02, 0x55, 0x16, 0x45, 0x4f, - 0xcb, 0xd3, 0xf6, 0x84, 0xaa, 0x19, 0x27, 0x69, 0x67, 0x86, 0x53, 0x3e, 0x23, 0x5f, 0x0c, 0xd8, - 0x98, 0xd2, 0xc4, 0xc9, 0xd3, 0x09, 0x50, 0xe8, 0x9c, 0x31, 0x9f, 0x5d, 0xf3, 0x86, 0xcf, 0x5e, - 0xae, 0xbf, 0x7f, 0x54, 0x4d, 0xfc, 0x4f, 0xf7, 0x42, 0xfe, 0xe8, 0x2e, 0x8a, 0x3f, 0xe1, 0x9e, - 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x3f, 0xfc, 0xb9, 0x33, 0xd8, 0x13, 0x00, 0x00, +var fileDescriptor_organization_2845c40b2de0bcf0 = []byte{ + // 869 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4f, 0x4f, 0x13, 0x41, + 0x14, 0xcf, 0x52, 0x44, 0x78, 0x25, 0xa6, 0x19, 0x48, 0x6d, 0x57, 0x91, 0xb2, 0x40, 0x68, 0x30, + 0x69, 0x15, 0x8f, 0xde, 0xa4, 0xa6, 0x34, 0x11, 0x6b, 0xd6, 0x70, 0xc0, 0x4b, 0xb3, 0xb5, 0x63, + 0xd3, 0x14, 0xba, 0xc3, 0xcc, 0x56, 0x22, 0x1f, 0xc0, 0xab, 0x27, 0x2f, 0xc6, 0x4f, 0xe0, 0xc9, + 0xcf, 0xe1, 0xc5, 0xaf, 0x64, 0x76, 0xb7, 0xb4, 0xb3, 0x33, 0x6f, 0xdb, 0xb2, 0x2d, 0x86, 0xe3, + 0xbc, 0x9d, 0xf9, 0xbd, 0xf7, 0x7e, 0x6f, 0xe6, 0xfd, 0x59, 0xd8, 0x74, 0x79, 0xdb, 0xe9, 0x75, + 0xae, 0x1c, 0xaf, 0xe3, 0xf6, 0xca, 0xf2, 0xa2, 0xc4, 0xb8, 0xeb, 0xb9, 0x64, 0x55, 0x96, 0x99, + 0x5b, 0x75, 0x46, 0x7b, 0x8d, 0xda, 0x71, 0x99, 0x75, 0xdb, 0xe5, 0x60, 0x43, 0x59, 0xb4, 0xba, + 0x8d, 0x4b, 0x51, 0xbe, 0x14, 0xe1, 0x01, 0xeb, 0x87, 0x01, 0x6b, 0x87, 0x9c, 0x3a, 0x1e, 0xad, + 0x50, 0xe6, 0x70, 0xef, 0x9c, 0xf6, 0x3c, 0x9b, 0x5e, 0x90, 0xd7, 0xf0, 0xa0, 0x35, 0x14, 0xd4, + 0x7a, 0x9f, 0xdc, 0x9c, 0x51, 0x30, 0x8a, 0xe9, 0x83, 0x8d, 0x92, 0xa0, 0xfc, 0x33, 0xe5, 0x0d, + 0x87, 0x75, 0x1a, 0xcc, 0xe1, 0xce, 0xb9, 0x28, 0x49, 0x27, 0x95, 0x43, 0xa4, 0x00, 0x69, 0x97, + 0x51, 0x1e, 0x98, 0x53, 0xab, 0xe4, 0x16, 0x0a, 0x46, 0x71, 0xc5, 0x96, 0x45, 0xc4, 0x84, 0x65, + 0x97, 0x9d, 0x08, 0xca, 0x6b, 0x95, 0x5c, 0x2a, 0xf8, 0x3c, 0x5c, 0x5b, 0xdf, 0x0c, 0x58, 0xd7, + 0x8d, 0x13, 0x8c, 0xe4, 0xe0, 0x3e, 0xe5, 0xfc, 0xd0, 0x6d, 0xd1, 0xc0, 0xac, 0x7b, 0xf6, 0xf5, + 0x92, 0x64, 0x61, 0x89, 0x72, 0x7e, 0x2c, 0xda, 0x03, 0x5d, 0x83, 0x15, 0xe2, 0x4f, 0x2a, 0x81, + 0x3f, 0x01, 0x5d, 0x27, 0xac, 0x75, 0x37, 0xe9, 0x3a, 0x82, 0x75, 0xdd, 0xb6, 0x24, 0x6c, 0x59, + 0x97, 0xb0, 0x56, 0xa5, 0xde, 0xfb, 0x7e, 0x33, 0xea, 0xa5, 0x05, 0xab, 0x92, 0xc1, 0x95, 0x00, + 0x6d, 0xc5, 0x8e, 0xc8, 0xe6, 0x10, 0x71, 0x5d, 0xf3, 0xec, 0x11, 0x7f, 0xd3, 0x11, 0x5e, 0x2e, + 0x55, 0x48, 0xdd, 0x28, 0x24, 0xfe, 0x21, 0x9f, 0x8a, 0x0a, 0x3d, 0xa3, 0x6a, 0xc0, 0x6f, 0x9f, + 0x8a, 0x23, 0x58, 0xd7, 0x15, 0x27, 0x8a, 0x66, 0x0b, 0x1e, 0x57, 0xa9, 0x37, 0x82, 0x79, 0xe7, + 0xf0, 0xc0, 0x40, 0xdf, 0xbf, 0xb9, 0xf9, 0x62, 0xf5, 0x61, 0x63, 0x8c, 0x96, 0x44, 0x21, 0xb4, + 0x60, 0x95, 0x49, 0x28, 0x41, 0x00, 0x57, 0xec, 0x88, 0xcc, 0xfa, 0x63, 0x40, 0x3e, 0xcc, 0x11, + 0x75, 0x29, 0xf5, 0xf9, 0x1c, 0xfa, 0xae, 0xd5, 0x21, 0xe3, 0x2a, 0xe2, 0xc1, 0xcb, 0xdc, 0x46, + 0xae, 0x81, 0x86, 0xa0, 0x1d, 0x9e, 0x2d, 0xa6, 0xe4, 0x09, 0x40, 0x4d, 0xd8, 0xb4, 0xdd, 0x11, + 0x1e, 0xe5, 0xb9, 0xc5, 0x82, 0x51, 0x5c, 0xb6, 0x25, 0x89, 0xf5, 0x16, 0xcc, 0x38, 0x5f, 0x12, + 0x45, 0xfe, 0x97, 0x01, 0xf9, 0x30, 0x25, 0xdc, 0x7d, 0x72, 0x7c, 0xe7, 0xe3, 0x6c, 0x4d, 0xec, + 0xbc, 0x5a, 0x3d, 0x8e, 0xe9, 0x79, 0x73, 0xe8, 0x7c, 0x4b, 0x11, 0x8f, 0x71, 0x5e, 0x43, 0xd0, + 0x0e, 0xcf, 0xee, 0x7c, 0x9c, 0xad, 0x89, 0x9c, 0xef, 0x41, 0xb6, 0x4a, 0xbd, 0x00, 0xbc, 0x17, + 0xcd, 0x5c, 0x59, 0x58, 0xea, 0x87, 0x36, 0x84, 0xef, 0x7c, 0xb0, 0x9a, 0xd1, 0xfe, 0x9f, 0x06, + 0x3c, 0x44, 0x15, 0x26, 0x7a, 0xf8, 0x75, 0xc8, 0xf4, 0x15, 0xa4, 0x41, 0xbd, 0xc6, 0x82, 0xa3, + 0x29, 0xd5, 0x0e, 0x4b, 0x0f, 0x01, 0xa3, 0xe4, 0xee, 0xdd, 0x85, 0x38, 0x5b, 0x13, 0xdd, 0x85, + 0xef, 0x06, 0xe4, 0xc3, 0x52, 0xf2, 0xdf, 0xee, 0x83, 0x56, 0x53, 0x16, 0xf5, 0x9a, 0xe2, 0xfb, + 0x19, 0x67, 0x56, 0x22, 0x3f, 0x2f, 0xae, 0xdd, 0xc4, 0x92, 0xdd, 0xed, 0x5c, 0xfb, 0xa1, 0x0b, + 0x73, 0xca, 0x59, 0x57, 0xc1, 0xb3, 0xc5, 0xf2, 0xd5, 0xed, 0x37, 0x1c, 0xbf, 0xc3, 0x27, 0x3c, + 0x9f, 0x04, 0x44, 0x3e, 0x42, 0xce, 0x67, 0x58, 0x45, 0x93, 0x1a, 0xb1, 0xbd, 0x98, 0xa7, 0xac, + 0x19, 0x10, 0x0b, 0x64, 0x71, 0xb0, 0x22, 0x16, 0xdb, 0xf4, 0xcc, 0xf1, 0x68, 0xab, 0xca, 0xdd, + 0x3e, 0x1b, 0xf5, 0x37, 0x0a, 0x2d, 0x86, 0x4e, 0xcb, 0xbe, 0x9c, 0x00, 0x06, 0xcd, 0xc6, 0x42, + 0xd0, 0x6c, 0x68, 0x72, 0xeb, 0x0b, 0x6c, 0x4f, 0xd4, 0x99, 0x88, 0xb1, 0x02, 0xa4, 0xdb, 0x23, + 0x90, 0x41, 0xb3, 0x23, 0x8b, 0x0e, 0xfe, 0xa6, 0x21, 0x32, 0xe0, 0x91, 0x53, 0xc8, 0xa8, 0x55, + 0x83, 0x6c, 0x95, 0x22, 0x73, 0x21, 0x32, 0xdc, 0x99, 0xd6, 0xa4, 0x2d, 0x82, 0xf9, 0xd0, 0xea, + 0x30, 0xa1, 0x42, 0x23, 0x83, 0x90, 0x0a, 0x8d, 0xce, 0x23, 0xa7, 0x90, 0x51, 0x7b, 0x7c, 0x15, + 0x1a, 0x99, 0x3e, 0x54, 0x68, 0x74, 0x4c, 0x38, 0x85, 0x8c, 0xda, 0x34, 0xab, 0xd0, 0x48, 0x37, + 0xaf, 0x42, 0xa3, 0x7d, 0xb7, 0x07, 0xf9, 0xd8, 0xfe, 0x96, 0xec, 0x6b, 0xb6, 0xc5, 0xb6, 0xdb, + 0xe6, 0xd3, 0xa9, 0xf7, 0x0a, 0x46, 0xba, 0x90, 0xc5, 0x3b, 0x42, 0xb2, 0x87, 0x05, 0x11, 0xc9, + 0x7c, 0x66, 0x71, 0xba, 0x8d, 0xa1, 0x32, 0xbc, 0x03, 0x53, 0x95, 0xc5, 0xf6, 0x94, 0xaa, 0xb2, + 0x31, 0x0d, 0x5d, 0x17, 0xb2, 0x78, 0xea, 0x54, 0x95, 0xc5, 0xe6, 0x74, 0x55, 0xd9, 0x98, 0x4c, + 0x3c, 0xa4, 0x51, 0x4d, 0x23, 0x38, 0x8d, 0x48, 0x02, 0xc6, 0x69, 0x44, 0x93, 0x65, 0x33, 0x98, + 0x9e, 0xd5, 0xa2, 0x46, 0x76, 0xb4, 0xb8, 0x23, 0xe5, 0xd8, 0xdc, 0x9d, 0x62, 0x97, 0xcc, 0x9e, + 0xa6, 0x06, 0x65, 0x0f, 0xd3, 0x54, 0x9c, 0x6e, 0xa3, 0x7c, 0x2f, 0x26, 0x29, 0x8b, 0x6d, 0xb1, + 0xf0, 0x7b, 0x81, 0x2a, 0x0b, 0xd9, 0xd3, 0xe2, 0xb4, 0x33, 0xe6, 0xd5, 0x8c, 0x82, 0xb4, 0x3b, + 0xc5, 0x2e, 0xc1, 0xc8, 0x57, 0x03, 0x36, 0x27, 0x24, 0x71, 0xf2, 0x6c, 0x0c, 0x14, 0x5a, 0x67, + 0xcc, 0xe7, 0x37, 0x3c, 0x21, 0xd8, 0xab, 0x8d, 0x0f, 0x8f, 0x4a, 0x91, 0xff, 0x78, 0x2f, 0xe5, + 0x45, 0x73, 0x29, 0xf8, 0x49, 0xf7, 0xe2, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x63, 0xff, 0x09, + 0x1d, 0xf8, 0x13, 0x00, 0x00, } diff --git a/pkg/proto/organization/organization.proto b/pkg/proto/organization/organization.proto index 8c3bd5026..ef7aedbf7 100644 --- a/pkg/proto/organization/organization.proto +++ b/pkg/proto/organization/organization.proto @@ -67,6 +67,7 @@ message CreateOrganizationUserReq{ server_api_params.OrganizationUser organizationUser = 1; string operationID = 2; string opUserID = 3; + bool IsRegister = 4; } diff --git a/pkg/proto/relay/relay.pb.go b/pkg/proto/relay/relay.pb.go index 37334a8b2..7affbc050 100644 --- a/pkg/proto/relay/relay.pb.go +++ b/pkg/proto/relay/relay.pb.go @@ -37,7 +37,7 @@ func (m *OnlinePushMsgReq) Reset() { *m = OnlinePushMsgReq{} } func (m *OnlinePushMsgReq) String() string { return proto.CompactTextString(m) } func (*OnlinePushMsgReq) ProtoMessage() {} func (*OnlinePushMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_34094e5333f6005a, []int{0} + return fileDescriptor_relay_eb517eee82ca0aca, []int{0} } func (m *OnlinePushMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OnlinePushMsgReq.Unmarshal(m, b) @@ -79,17 +79,17 @@ func (m *OnlinePushMsgReq) GetPushToUserID() string { } type OnlinePushMsgResp struct { - Resp []*SingleMsgToUser `protobuf:"bytes,1,rep,name=resp" json:"resp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Resp []*SingleMsgToUserPlatform `protobuf:"bytes,1,rep,name=resp" json:"resp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *OnlinePushMsgResp) Reset() { *m = OnlinePushMsgResp{} } func (m *OnlinePushMsgResp) String() string { return proto.CompactTextString(m) } func (*OnlinePushMsgResp) ProtoMessage() {} func (*OnlinePushMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_34094e5333f6005a, []int{1} + return fileDescriptor_relay_eb517eee82ca0aca, []int{1} } func (m *OnlinePushMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OnlinePushMsgResp.Unmarshal(m, b) @@ -109,14 +109,160 @@ func (m *OnlinePushMsgResp) XXX_DiscardUnknown() { var xxx_messageInfo_OnlinePushMsgResp proto.InternalMessageInfo -func (m *OnlinePushMsgResp) GetResp() []*SingleMsgToUser { +func (m *OnlinePushMsgResp) GetResp() []*SingleMsgToUserPlatform { if m != nil { return m.Resp } return nil } -type SingleMsgToUser struct { +type SingelMsgToUserResultList struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Resp []*SingleMsgToUserPlatform `protobuf:"bytes,2,rep,name=resp" json:"resp,omitempty"` + OnlinePush bool `protobuf:"varint,3,opt,name=onlinePush" json:"onlinePush,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SingelMsgToUserResultList) Reset() { *m = SingelMsgToUserResultList{} } +func (m *SingelMsgToUserResultList) String() string { return proto.CompactTextString(m) } +func (*SingelMsgToUserResultList) ProtoMessage() {} +func (*SingelMsgToUserResultList) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_eb517eee82ca0aca, []int{2} +} +func (m *SingelMsgToUserResultList) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SingelMsgToUserResultList.Unmarshal(m, b) +} +func (m *SingelMsgToUserResultList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SingelMsgToUserResultList.Marshal(b, m, deterministic) +} +func (dst *SingelMsgToUserResultList) XXX_Merge(src proto.Message) { + xxx_messageInfo_SingelMsgToUserResultList.Merge(dst, src) +} +func (m *SingelMsgToUserResultList) XXX_Size() int { + return xxx_messageInfo_SingelMsgToUserResultList.Size(m) +} +func (m *SingelMsgToUserResultList) XXX_DiscardUnknown() { + xxx_messageInfo_SingelMsgToUserResultList.DiscardUnknown(m) +} + +var xxx_messageInfo_SingelMsgToUserResultList proto.InternalMessageInfo + +func (m *SingelMsgToUserResultList) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *SingelMsgToUserResultList) GetResp() []*SingleMsgToUserPlatform { + if m != nil { + return m.Resp + } + return nil +} + +func (m *SingelMsgToUserResultList) GetOnlinePush() bool { + if m != nil { + return m.OnlinePush + } + return false +} + +type OnlineBatchPushOneMsgReq struct { + OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` + MsgData *sdk_ws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"` + PushToUserIDList []string `protobuf:"bytes,3,rep,name=pushToUserIDList" json:"pushToUserIDList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OnlineBatchPushOneMsgReq) Reset() { *m = OnlineBatchPushOneMsgReq{} } +func (m *OnlineBatchPushOneMsgReq) String() string { return proto.CompactTextString(m) } +func (*OnlineBatchPushOneMsgReq) ProtoMessage() {} +func (*OnlineBatchPushOneMsgReq) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_eb517eee82ca0aca, []int{3} +} +func (m *OnlineBatchPushOneMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OnlineBatchPushOneMsgReq.Unmarshal(m, b) +} +func (m *OnlineBatchPushOneMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OnlineBatchPushOneMsgReq.Marshal(b, m, deterministic) +} +func (dst *OnlineBatchPushOneMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_OnlineBatchPushOneMsgReq.Merge(dst, src) +} +func (m *OnlineBatchPushOneMsgReq) XXX_Size() int { + return xxx_messageInfo_OnlineBatchPushOneMsgReq.Size(m) +} +func (m *OnlineBatchPushOneMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_OnlineBatchPushOneMsgReq.DiscardUnknown(m) +} + +var xxx_messageInfo_OnlineBatchPushOneMsgReq proto.InternalMessageInfo + +func (m *OnlineBatchPushOneMsgReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *OnlineBatchPushOneMsgReq) GetMsgData() *sdk_ws.MsgData { + if m != nil { + return m.MsgData + } + return nil +} + +func (m *OnlineBatchPushOneMsgReq) GetPushToUserIDList() []string { + if m != nil { + return m.PushToUserIDList + } + return nil +} + +type OnlineBatchPushOneMsgResp struct { + SinglePushResult []*SingelMsgToUserResultList `protobuf:"bytes,1,rep,name=singlePushResult" json:"singlePushResult,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OnlineBatchPushOneMsgResp) Reset() { *m = OnlineBatchPushOneMsgResp{} } +func (m *OnlineBatchPushOneMsgResp) String() string { return proto.CompactTextString(m) } +func (*OnlineBatchPushOneMsgResp) ProtoMessage() {} +func (*OnlineBatchPushOneMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_eb517eee82ca0aca, []int{4} +} +func (m *OnlineBatchPushOneMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OnlineBatchPushOneMsgResp.Unmarshal(m, b) +} +func (m *OnlineBatchPushOneMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OnlineBatchPushOneMsgResp.Marshal(b, m, deterministic) +} +func (dst *OnlineBatchPushOneMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_OnlineBatchPushOneMsgResp.Merge(dst, src) +} +func (m *OnlineBatchPushOneMsgResp) XXX_Size() int { + return xxx_messageInfo_OnlineBatchPushOneMsgResp.Size(m) +} +func (m *OnlineBatchPushOneMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_OnlineBatchPushOneMsgResp.DiscardUnknown(m) +} + +var xxx_messageInfo_OnlineBatchPushOneMsgResp proto.InternalMessageInfo + +func (m *OnlineBatchPushOneMsgResp) GetSinglePushResult() []*SingelMsgToUserResultList { + if m != nil { + return m.SinglePushResult + } + return nil +} + +type SingleMsgToUserPlatform struct { ResultCode int64 `protobuf:"varint,1,opt,name=ResultCode" json:"ResultCode,omitempty"` RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` RecvPlatFormID int32 `protobuf:"varint,3,opt,name=RecvPlatFormID" json:"RecvPlatFormID,omitempty"` @@ -125,45 +271,45 @@ type SingleMsgToUser struct { XXX_sizecache int32 `json:"-"` } -func (m *SingleMsgToUser) Reset() { *m = SingleMsgToUser{} } -func (m *SingleMsgToUser) String() string { return proto.CompactTextString(m) } -func (*SingleMsgToUser) ProtoMessage() {} -func (*SingleMsgToUser) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_34094e5333f6005a, []int{2} +func (m *SingleMsgToUserPlatform) Reset() { *m = SingleMsgToUserPlatform{} } +func (m *SingleMsgToUserPlatform) String() string { return proto.CompactTextString(m) } +func (*SingleMsgToUserPlatform) ProtoMessage() {} +func (*SingleMsgToUserPlatform) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_eb517eee82ca0aca, []int{5} } -func (m *SingleMsgToUser) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SingleMsgToUser.Unmarshal(m, b) +func (m *SingleMsgToUserPlatform) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SingleMsgToUserPlatform.Unmarshal(m, b) } -func (m *SingleMsgToUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SingleMsgToUser.Marshal(b, m, deterministic) +func (m *SingleMsgToUserPlatform) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SingleMsgToUserPlatform.Marshal(b, m, deterministic) } -func (dst *SingleMsgToUser) XXX_Merge(src proto.Message) { - xxx_messageInfo_SingleMsgToUser.Merge(dst, src) +func (dst *SingleMsgToUserPlatform) XXX_Merge(src proto.Message) { + xxx_messageInfo_SingleMsgToUserPlatform.Merge(dst, src) } -func (m *SingleMsgToUser) XXX_Size() int { - return xxx_messageInfo_SingleMsgToUser.Size(m) +func (m *SingleMsgToUserPlatform) XXX_Size() int { + return xxx_messageInfo_SingleMsgToUserPlatform.Size(m) } -func (m *SingleMsgToUser) XXX_DiscardUnknown() { - xxx_messageInfo_SingleMsgToUser.DiscardUnknown(m) +func (m *SingleMsgToUserPlatform) XXX_DiscardUnknown() { + xxx_messageInfo_SingleMsgToUserPlatform.DiscardUnknown(m) } -var xxx_messageInfo_SingleMsgToUser proto.InternalMessageInfo +var xxx_messageInfo_SingleMsgToUserPlatform proto.InternalMessageInfo -func (m *SingleMsgToUser) GetResultCode() int64 { +func (m *SingleMsgToUserPlatform) GetResultCode() int64 { if m != nil { return m.ResultCode } return 0 } -func (m *SingleMsgToUser) GetRecvID() string { +func (m *SingleMsgToUserPlatform) GetRecvID() string { if m != nil { return m.RecvID } return "" } -func (m *SingleMsgToUser) GetRecvPlatFormID() int32 { +func (m *SingleMsgToUserPlatform) GetRecvPlatFormID() int32 { if m != nil { return m.RecvPlatFormID } @@ -183,7 +329,7 @@ func (m *GetUsersOnlineStatusReq) Reset() { *m = GetUsersOnlineStatusReq func (m *GetUsersOnlineStatusReq) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusReq) ProtoMessage() {} func (*GetUsersOnlineStatusReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_34094e5333f6005a, []int{3} + return fileDescriptor_relay_eb517eee82ca0aca, []int{6} } func (m *GetUsersOnlineStatusReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusReq.Unmarshal(m, b) @@ -238,7 +384,7 @@ func (m *GetUsersOnlineStatusResp) Reset() { *m = GetUsersOnlineStatusRe func (m *GetUsersOnlineStatusResp) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp) ProtoMessage() {} func (*GetUsersOnlineStatusResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_34094e5333f6005a, []int{4} + return fileDescriptor_relay_eb517eee82ca0aca, []int{7} } func (m *GetUsersOnlineStatusResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp.Unmarshal(m, b) @@ -300,7 +446,7 @@ func (m *GetUsersOnlineStatusResp_SuccessDetail) Reset() { func (m *GetUsersOnlineStatusResp_SuccessDetail) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp_SuccessDetail) ProtoMessage() {} func (*GetUsersOnlineStatusResp_SuccessDetail) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_34094e5333f6005a, []int{4, 0} + return fileDescriptor_relay_eb517eee82ca0aca, []int{7, 0} } func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Unmarshal(m, b) @@ -347,7 +493,7 @@ func (m *GetUsersOnlineStatusResp_FailedDetail) Reset() { *m = GetUsersO func (m *GetUsersOnlineStatusResp_FailedDetail) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp_FailedDetail) ProtoMessage() {} func (*GetUsersOnlineStatusResp_FailedDetail) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_34094e5333f6005a, []int{4, 1} + return fileDescriptor_relay_eb517eee82ca0aca, []int{7, 1} } func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Unmarshal(m, b) @@ -403,7 +549,7 @@ func (m *GetUsersOnlineStatusResp_SuccessResult) Reset() { func (m *GetUsersOnlineStatusResp_SuccessResult) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp_SuccessResult) ProtoMessage() {} func (*GetUsersOnlineStatusResp_SuccessResult) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_34094e5333f6005a, []int{4, 2} + return fileDescriptor_relay_eb517eee82ca0aca, []int{7, 2} } func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Unmarshal(m, b) @@ -444,15 +590,104 @@ func (m *GetUsersOnlineStatusResp_SuccessResult) GetDetailPlatformStatus() []*Ge return nil } +type KickUserOfflineReq struct { + OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` + PlatformID int32 `protobuf:"varint,2,opt,name=platformID" json:"platformID,omitempty"` + KickUserIDList []string `protobuf:"bytes,3,rep,name=kickUserIDList" json:"kickUserIDList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KickUserOfflineReq) Reset() { *m = KickUserOfflineReq{} } +func (m *KickUserOfflineReq) String() string { return proto.CompactTextString(m) } +func (*KickUserOfflineReq) ProtoMessage() {} +func (*KickUserOfflineReq) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_eb517eee82ca0aca, []int{8} +} +func (m *KickUserOfflineReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KickUserOfflineReq.Unmarshal(m, b) +} +func (m *KickUserOfflineReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KickUserOfflineReq.Marshal(b, m, deterministic) +} +func (dst *KickUserOfflineReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_KickUserOfflineReq.Merge(dst, src) +} +func (m *KickUserOfflineReq) XXX_Size() int { + return xxx_messageInfo_KickUserOfflineReq.Size(m) +} +func (m *KickUserOfflineReq) XXX_DiscardUnknown() { + xxx_messageInfo_KickUserOfflineReq.DiscardUnknown(m) +} + +var xxx_messageInfo_KickUserOfflineReq proto.InternalMessageInfo + +func (m *KickUserOfflineReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *KickUserOfflineReq) GetPlatformID() int32 { + if m != nil { + return m.PlatformID + } + return 0 +} + +func (m *KickUserOfflineReq) GetKickUserIDList() []string { + if m != nil { + return m.KickUserIDList + } + return nil +} + +type KickUserOfflineResp struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KickUserOfflineResp) Reset() { *m = KickUserOfflineResp{} } +func (m *KickUserOfflineResp) String() string { return proto.CompactTextString(m) } +func (*KickUserOfflineResp) ProtoMessage() {} +func (*KickUserOfflineResp) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_eb517eee82ca0aca, []int{9} +} +func (m *KickUserOfflineResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KickUserOfflineResp.Unmarshal(m, b) +} +func (m *KickUserOfflineResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KickUserOfflineResp.Marshal(b, m, deterministic) +} +func (dst *KickUserOfflineResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_KickUserOfflineResp.Merge(dst, src) +} +func (m *KickUserOfflineResp) XXX_Size() int { + return xxx_messageInfo_KickUserOfflineResp.Size(m) +} +func (m *KickUserOfflineResp) XXX_DiscardUnknown() { + xxx_messageInfo_KickUserOfflineResp.DiscardUnknown(m) +} + +var xxx_messageInfo_KickUserOfflineResp proto.InternalMessageInfo + func init() { proto.RegisterType((*OnlinePushMsgReq)(nil), "relay.OnlinePushMsgReq") proto.RegisterType((*OnlinePushMsgResp)(nil), "relay.OnlinePushMsgResp") - proto.RegisterType((*SingleMsgToUser)(nil), "relay.SingleMsgToUser") + proto.RegisterType((*SingelMsgToUserResultList)(nil), "relay.SingelMsgToUserResultList") + proto.RegisterType((*OnlineBatchPushOneMsgReq)(nil), "relay.OnlineBatchPushOneMsgReq") + proto.RegisterType((*OnlineBatchPushOneMsgResp)(nil), "relay.OnlineBatchPushOneMsgResp") + proto.RegisterType((*SingleMsgToUserPlatform)(nil), "relay.SingleMsgToUserPlatform") proto.RegisterType((*GetUsersOnlineStatusReq)(nil), "relay.GetUsersOnlineStatusReq") proto.RegisterType((*GetUsersOnlineStatusResp)(nil), "relay.GetUsersOnlineStatusResp") proto.RegisterType((*GetUsersOnlineStatusResp_SuccessDetail)(nil), "relay.GetUsersOnlineStatusResp.SuccessDetail") proto.RegisterType((*GetUsersOnlineStatusResp_FailedDetail)(nil), "relay.GetUsersOnlineStatusResp.FailedDetail") proto.RegisterType((*GetUsersOnlineStatusResp_SuccessResult)(nil), "relay.GetUsersOnlineStatusResp.SuccessResult") + proto.RegisterType((*KickUserOfflineReq)(nil), "relay.KickUserOfflineReq") + proto.RegisterType((*KickUserOfflineResp)(nil), "relay.KickUserOfflineResp") } // Reference imports to suppress errors if they are not otherwise used. @@ -468,6 +703,9 @@ const _ = grpc.SupportPackageIsVersion4 type OnlineMessageRelayServiceClient interface { OnlinePushMsg(ctx context.Context, in *OnlinePushMsgReq, opts ...grpc.CallOption) (*OnlinePushMsgResp, error) GetUsersOnlineStatus(ctx context.Context, in *GetUsersOnlineStatusReq, opts ...grpc.CallOption) (*GetUsersOnlineStatusResp, error) + OnlineBatchPushOneMsg(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error) + SuperGroupOnlineBatchPushOneMsg(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error) + KickUserOffline(ctx context.Context, in *KickUserOfflineReq, opts ...grpc.CallOption) (*KickUserOfflineResp, error) } type onlineMessageRelayServiceClient struct { @@ -496,11 +734,41 @@ func (c *onlineMessageRelayServiceClient) GetUsersOnlineStatus(ctx context.Conte return out, nil } +func (c *onlineMessageRelayServiceClient) OnlineBatchPushOneMsg(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error) { + out := new(OnlineBatchPushOneMsgResp) + err := grpc.Invoke(ctx, "/relay.OnlineMessageRelayService/OnlineBatchPushOneMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *onlineMessageRelayServiceClient) SuperGroupOnlineBatchPushOneMsg(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error) { + out := new(OnlineBatchPushOneMsgResp) + err := grpc.Invoke(ctx, "/relay.OnlineMessageRelayService/SuperGroupOnlineBatchPushOneMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *onlineMessageRelayServiceClient) KickUserOffline(ctx context.Context, in *KickUserOfflineReq, opts ...grpc.CallOption) (*KickUserOfflineResp, error) { + out := new(KickUserOfflineResp) + err := grpc.Invoke(ctx, "/relay.OnlineMessageRelayService/KickUserOffline", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for OnlineMessageRelayService service type OnlineMessageRelayServiceServer interface { OnlinePushMsg(context.Context, *OnlinePushMsgReq) (*OnlinePushMsgResp, error) GetUsersOnlineStatus(context.Context, *GetUsersOnlineStatusReq) (*GetUsersOnlineStatusResp, error) + OnlineBatchPushOneMsg(context.Context, *OnlineBatchPushOneMsgReq) (*OnlineBatchPushOneMsgResp, error) + SuperGroupOnlineBatchPushOneMsg(context.Context, *OnlineBatchPushOneMsgReq) (*OnlineBatchPushOneMsgResp, error) + KickUserOffline(context.Context, *KickUserOfflineReq) (*KickUserOfflineResp, error) } func RegisterOnlineMessageRelayServiceServer(s *grpc.Server, srv OnlineMessageRelayServiceServer) { @@ -543,6 +811,60 @@ func _OnlineMessageRelayService_GetUsersOnlineStatus_Handler(srv interface{}, ct return interceptor(ctx, in, info, handler) } +func _OnlineMessageRelayService_OnlineBatchPushOneMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OnlineBatchPushOneMsgReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OnlineMessageRelayServiceServer).OnlineBatchPushOneMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/relay.OnlineMessageRelayService/OnlineBatchPushOneMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OnlineMessageRelayServiceServer).OnlineBatchPushOneMsg(ctx, req.(*OnlineBatchPushOneMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OnlineMessageRelayService_SuperGroupOnlineBatchPushOneMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OnlineBatchPushOneMsgReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OnlineMessageRelayServiceServer).SuperGroupOnlineBatchPushOneMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/relay.OnlineMessageRelayService/SuperGroupOnlineBatchPushOneMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OnlineMessageRelayServiceServer).SuperGroupOnlineBatchPushOneMsg(ctx, req.(*OnlineBatchPushOneMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OnlineMessageRelayService_KickUserOffline_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KickUserOfflineReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OnlineMessageRelayServiceServer).KickUserOffline(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/relay.OnlineMessageRelayService/KickUserOffline", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OnlineMessageRelayServiceServer).KickUserOffline(ctx, req.(*KickUserOfflineReq)) + } + return interceptor(ctx, in, info, handler) +} + var _OnlineMessageRelayService_serviceDesc = grpc.ServiceDesc{ ServiceName: "relay.OnlineMessageRelayService", HandlerType: (*OnlineMessageRelayServiceServer)(nil), @@ -555,48 +877,72 @@ var _OnlineMessageRelayService_serviceDesc = grpc.ServiceDesc{ MethodName: "GetUsersOnlineStatus", Handler: _OnlineMessageRelayService_GetUsersOnlineStatus_Handler, }, + { + MethodName: "OnlineBatchPushOneMsg", + Handler: _OnlineMessageRelayService_OnlineBatchPushOneMsg_Handler, + }, + { + MethodName: "SuperGroupOnlineBatchPushOneMsg", + Handler: _OnlineMessageRelayService_SuperGroupOnlineBatchPushOneMsg_Handler, + }, + { + MethodName: "KickUserOffline", + Handler: _OnlineMessageRelayService_KickUserOffline_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "relay/relay.proto", } -func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_34094e5333f6005a) } +func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_eb517eee82ca0aca) } -var fileDescriptor_relay_34094e5333f6005a = []byte{ - // 554 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x5d, 0x8f, 0xd2, 0x40, - 0x14, 0x4d, 0x65, 0x3f, 0xdc, 0x0b, 0xb8, 0x32, 0xd9, 0xec, 0xd6, 0x3e, 0x20, 0xf6, 0xc1, 0x10, - 0xa3, 0x25, 0x41, 0xdf, 0x7c, 0x30, 0xd9, 0x25, 0x6b, 0x48, 0x6c, 0x20, 0x83, 0x46, 0xe3, 0x0b, - 0x99, 0x85, 0xbb, 0xdd, 0x66, 0x0b, 0x1d, 0xe6, 0xb6, 0x10, 0xff, 0x84, 0x3f, 0xc2, 0x3f, 0xa1, - 0x3f, 0xcf, 0x74, 0xa6, 0x60, 0x4b, 0x58, 0x37, 0xfb, 0x42, 0x38, 0x77, 0xee, 0x3d, 0xf7, 0x9c, - 0xd3, 0x76, 0xa0, 0xa1, 0x30, 0x12, 0x3f, 0x3a, 0xfa, 0xd7, 0x93, 0x2a, 0x4e, 0x62, 0xb6, 0xaf, - 0x81, 0xf3, 0x62, 0x20, 0x71, 0x3e, 0xee, 0xfb, 0x1d, 0x79, 0x1b, 0x74, 0xf4, 0x49, 0x87, 0xa6, - 0xb7, 0xe3, 0x15, 0x75, 0x56, 0x64, 0x3a, 0xdd, 0x9f, 0x16, 0x3c, 0x1d, 0xcc, 0xa3, 0x70, 0x8e, - 0xc3, 0x94, 0x6e, 0x7c, 0x0a, 0x38, 0x2e, 0x58, 0x0b, 0xaa, 0x03, 0x89, 0x4a, 0x24, 0x61, 0x3c, - 0xef, 0xf7, 0x6c, 0xab, 0x65, 0xb5, 0x8f, 0x78, 0xb1, 0xc4, 0xde, 0xc1, 0xe1, 0x8c, 0x82, 0x9e, - 0x48, 0x84, 0xfd, 0xa8, 0x65, 0xb5, 0xab, 0x5d, 0xc7, 0x23, 0x54, 0x4b, 0x54, 0x63, 0x21, 0xc3, - 0xb1, 0x14, 0x4a, 0xcc, 0xc8, 0xf3, 0x4d, 0x07, 0x5f, 0xb7, 0x32, 0x17, 0x6a, 0x32, 0xa5, 0x9b, - 0xcf, 0xf1, 0x17, 0x42, 0xd5, 0xef, 0xd9, 0x15, 0x4d, 0x5c, 0xaa, 0xb9, 0x1f, 0xa0, 0xb1, 0xa5, - 0x87, 0x24, 0x7b, 0x05, 0x7b, 0x0a, 0x49, 0xda, 0x56, 0xab, 0xd2, 0xae, 0x76, 0x4f, 0x3d, 0xe3, - 0x75, 0x14, 0xce, 0x83, 0x08, 0x7d, 0x0a, 0xcc, 0x30, 0xd7, 0x3d, 0xee, 0x02, 0x8e, 0xb7, 0x0e, - 0x58, 0x13, 0x80, 0x23, 0xa5, 0x51, 0x72, 0x11, 0x4f, 0x51, 0xdb, 0xa9, 0xf0, 0x42, 0x85, 0x9d, - 0xc2, 0x01, 0xc7, 0xc9, 0xb2, 0xdf, 0xd3, 0x66, 0x8e, 0x78, 0x8e, 0xd8, 0x4b, 0x78, 0x92, 0xfd, - 0x1b, 0x46, 0x22, 0xb9, 0x8c, 0xd5, 0x2c, 0x57, 0xbc, 0xcf, 0xb7, 0xaa, 0xee, 0x0a, 0xce, 0x3e, - 0x62, 0x92, 0xad, 0x22, 0xa3, 0x7d, 0x94, 0x88, 0x24, 0xa5, 0x2c, 0xca, 0x26, 0x40, 0xaa, 0x8d, - 0x7d, 0x0a, 0x29, 0xd1, 0xfa, 0x8f, 0x78, 0xa1, 0x92, 0x45, 0x1d, 0x17, 0xa2, 0x36, 0xfb, 0x8b, - 0x25, 0xe6, 0xc0, 0xe3, 0x58, 0x96, 0x02, 0xdb, 0x60, 0xf7, 0xf7, 0x1e, 0xd8, 0xbb, 0x37, 0x93, - 0x64, 0x36, 0x1c, 0xa2, 0x52, 0x1b, 0xcb, 0xfb, 0x7c, 0x0d, 0x33, 0xbf, 0xa8, 0x94, 0x4f, 0xc1, - 0xda, 0xaf, 0x41, 0x6c, 0x04, 0x75, 0x4a, 0x27, 0x13, 0x24, 0x32, 0xe1, 0xd8, 0x15, 0x9d, 0xf7, - 0x9b, 0x3c, 0xef, 0xbb, 0x36, 0x79, 0xa3, 0xe2, 0x10, 0x2f, 0x73, 0xb0, 0x21, 0xd4, 0xae, 0x45, - 0x18, 0xe1, 0x34, 0xe7, 0xdc, 0xd3, 0x9c, 0xaf, 0xef, 0xe3, 0xbc, 0xd4, 0x33, 0x3d, 0x4c, 0x44, - 0x18, 0xf1, 0x12, 0x83, 0x73, 0x01, 0xf5, 0x7c, 0xa3, 0x39, 0xce, 0x22, 0x92, 0x91, 0x48, 0xae, - 0x63, 0x35, 0xcb, 0x5f, 0xd6, 0x0d, 0xce, 0xbc, 0x92, 0x66, 0x5d, 0x7b, 0x35, 0xc8, 0xf9, 0x06, - 0xb5, 0xe2, 0x8a, 0xac, 0x2f, 0x2d, 0x86, 0x9c, 0xa3, 0x87, 0xa7, 0xe8, 0xfc, 0xb2, 0x36, 0xfa, - 0xf2, 0x08, 0xfe, 0x71, 0x5b, 0x25, 0xee, 0x3b, 0xb4, 0x31, 0x01, 0x27, 0x53, 0xad, 0x6a, 0x98, - 0xbb, 0x30, 0xb9, 0x3c, 0xf0, 0x71, 0xe4, 0xd9, 0xed, 0xa4, 0xea, 0xfe, 0xb1, 0xe0, 0x99, 0x19, - 0xf4, 0x91, 0x48, 0x04, 0xc8, 0x33, 0xce, 0x11, 0xaa, 0x65, 0x38, 0x41, 0x76, 0x0e, 0xf5, 0xd2, - 0x47, 0xc8, 0xce, 0xf2, 0x9d, 0xdb, 0x57, 0x85, 0x63, 0xef, 0x3e, 0x20, 0xc9, 0xbe, 0xc2, 0xc9, - 0x2e, 0x85, 0xac, 0xf9, 0x5f, 0xf9, 0x0b, 0xe7, 0xf9, 0x3d, 0xf6, 0xce, 0x1b, 0xdf, 0x8f, 0x3d, - 0x73, 0xdb, 0xbd, 0x97, 0x57, 0x5a, 0xf6, 0xd5, 0x81, 0xbe, 0xcc, 0xde, 0xfe, 0x0d, 0x00, 0x00, - 0xff, 0xff, 0x8e, 0xdc, 0xcc, 0x70, 0x0b, 0x05, 0x00, 0x00, +var fileDescriptor_relay_eb517eee82ca0aca = []byte{ + // 749 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x4e, 0xdb, 0x5a, + 0x10, 0x96, 0x31, 0xe1, 0x67, 0x80, 0x0b, 0x9c, 0x0b, 0x17, 0xe3, 0x45, 0xc8, 0xf5, 0xe2, 0x2a, + 0xba, 0x6a, 0x13, 0x29, 0xed, 0xae, 0x3b, 0x88, 0xa0, 0x51, 0x89, 0x82, 0x4e, 0x5a, 0xb5, 0x62, + 0x13, 0x99, 0xe4, 0x24, 0x58, 0x71, 0xe2, 0xc3, 0x19, 0x1b, 0xc4, 0xa6, 0xdb, 0xee, 0xfa, 0x08, + 0x5d, 0xf4, 0x25, 0xfa, 0x02, 0x7d, 0xb0, 0xea, 0xfc, 0xc4, 0xb5, 0xf3, 0x03, 0x65, 0xc1, 0x06, + 0x31, 0x73, 0xe6, 0xcc, 0xcc, 0xf7, 0x7d, 0x73, 0x26, 0x86, 0x5d, 0xc1, 0x42, 0xff, 0xbe, 0xaa, + 0xfe, 0x56, 0xb8, 0x88, 0xe2, 0x88, 0x14, 0x94, 0xe1, 0xfe, 0xdb, 0xe2, 0x6c, 0xdc, 0x69, 0x34, + 0xab, 0x7c, 0x38, 0xa8, 0xaa, 0x93, 0x2a, 0xf6, 0x86, 0x9d, 0x3b, 0xac, 0xde, 0xa1, 0x8e, 0xf4, + 0xbe, 0x5a, 0xb0, 0xd3, 0x1a, 0x87, 0xc1, 0x98, 0x5d, 0x24, 0x78, 0xdd, 0xc4, 0x01, 0x65, 0x37, + 0xa4, 0x04, 0x1b, 0x2d, 0xce, 0x84, 0x1f, 0x07, 0xd1, 0xb8, 0x51, 0x77, 0xac, 0x92, 0x55, 0x5e, + 0xa7, 0x59, 0x17, 0x79, 0x0d, 0xab, 0x23, 0x1c, 0xd4, 0xfd, 0xd8, 0x77, 0x96, 0x4a, 0x56, 0x79, + 0xa3, 0xe6, 0x56, 0x90, 0x89, 0x5b, 0x26, 0x3a, 0x3e, 0x0f, 0x3a, 0xdc, 0x17, 0xfe, 0x08, 0x2b, + 0x4d, 0x1d, 0x41, 0x27, 0xa1, 0xc4, 0x83, 0x4d, 0x9e, 0xe0, 0xf5, 0xfb, 0xe8, 0x03, 0x32, 0xd1, + 0xa8, 0x3b, 0xb6, 0x4a, 0x9c, 0xf3, 0x79, 0x67, 0xb0, 0x3b, 0xd5, 0x0f, 0x72, 0x52, 0x83, 0x65, + 0xc1, 0x90, 0x3b, 0x56, 0xc9, 0x2e, 0x6f, 0xd4, 0x8a, 0x15, 0x8d, 0xb5, 0x1d, 0x8c, 0x07, 0x21, + 0x6b, 0xe2, 0x40, 0x5f, 0xbe, 0x08, 0xfd, 0xb8, 0x1f, 0x89, 0x11, 0x55, 0xb1, 0xde, 0x17, 0x0b, + 0x0e, 0x65, 0x04, 0x0b, 0xd3, 0x08, 0xca, 0x30, 0x09, 0xe3, 0xf3, 0x00, 0x63, 0xf2, 0x0f, 0xac, + 0x24, 0xba, 0x09, 0x8d, 0xce, 0x58, 0x69, 0xa5, 0xa5, 0x3f, 0xaf, 0x44, 0x8a, 0x00, 0x51, 0xda, + 0xb2, 0x02, 0xb5, 0x46, 0x33, 0x1e, 0xef, 0x9b, 0x05, 0x8e, 0xc6, 0x74, 0xec, 0xc7, 0xdd, 0x6b, + 0xe9, 0x6b, 0x8d, 0xd9, 0x33, 0x73, 0xfd, 0x3f, 0xec, 0x64, 0x79, 0x95, 0xa0, 0x1d, 0xbb, 0x64, + 0x97, 0xd7, 0xe9, 0x8c, 0xdf, 0x0b, 0xe0, 0x70, 0x41, 0x7f, 0xc8, 0xc9, 0x39, 0xec, 0xa0, 0x82, + 0x2f, 0xfd, 0x9a, 0x41, 0xa3, 0x43, 0x29, 0xc3, 0xce, 0x5c, 0x96, 0xe9, 0xcc, 0x4d, 0xef, 0x1e, + 0x0e, 0x16, 0x90, 0x29, 0x69, 0xd4, 0x41, 0x27, 0x51, 0x8f, 0x29, 0x22, 0x6c, 0x9a, 0xf1, 0x48, + 0xc9, 0x28, 0xeb, 0xde, 0x36, 0xea, 0x8a, 0x86, 0x75, 0x6a, 0x2c, 0xf2, 0x1f, 0xfc, 0x25, 0xff, + 0x93, 0x79, 0x4e, 0x23, 0x31, 0x32, 0x73, 0x55, 0xa0, 0x53, 0x5e, 0xef, 0x0e, 0x0e, 0xce, 0x58, + 0x2c, 0x4b, 0xa2, 0x46, 0xdb, 0x8e, 0xfd, 0x38, 0x41, 0x29, 0x42, 0x11, 0x20, 0xf9, 0x4d, 0x93, + 0xa5, 0x68, 0xca, 0x78, 0xa4, 0x48, 0x51, 0x46, 0x24, 0x5d, 0x3f, 0xeb, 0x22, 0x2e, 0xac, 0x45, + 0x3c, 0x37, 0xd6, 0xa9, 0xed, 0xfd, 0x58, 0x06, 0x67, 0x7e, 0x65, 0xe4, 0xc4, 0x81, 0x55, 0x26, + 0x44, 0x0a, 0xb9, 0x40, 0x27, 0xa6, 0xc4, 0xcb, 0x84, 0x68, 0xe2, 0x60, 0x82, 0x57, 0x5b, 0xa4, + 0x0d, 0x5b, 0x98, 0x74, 0xbb, 0x0c, 0xd1, 0xa8, 0x61, 0x2b, 0x35, 0x5e, 0x1a, 0x35, 0x16, 0x55, + 0xaa, 0xb4, 0xb3, 0x97, 0x68, 0x3e, 0x07, 0xb9, 0x80, 0xcd, 0xbe, 0x1f, 0x84, 0xac, 0x67, 0x72, + 0x2e, 0xab, 0x9c, 0x2f, 0x1e, 0xcb, 0x79, 0xaa, 0xee, 0xd4, 0x59, 0xec, 0x07, 0x21, 0xcd, 0x65, + 0x70, 0x4f, 0x60, 0xcb, 0x54, 0xd4, 0xc7, 0x92, 0x22, 0x6e, 0xb4, 0x36, 0x63, 0x9e, 0xda, 0x12, + 0x2b, 0xaa, 0xac, 0x13, 0xac, 0xda, 0x72, 0x3f, 0xc1, 0x66, 0xb6, 0x44, 0xe6, 0xd9, 0xda, 0xb9, + 0x67, 0xfb, 0x64, 0x16, 0xdd, 0xef, 0x56, 0xda, 0x9f, 0xa1, 0x60, 0xd1, 0x4a, 0x58, 0xd0, 0x1b, + 0xf1, 0x61, 0xaf, 0xa7, 0xba, 0x9a, 0x4c, 0xb0, 0xe6, 0xe5, 0x89, 0x72, 0x18, 0xee, 0xe6, 0xa6, + 0xf2, 0x3e, 0x03, 0x79, 0x17, 0x74, 0x87, 0x32, 0x41, 0xab, 0xdf, 0x97, 0x09, 0xcc, 0xca, 0x88, + 0x66, 0x57, 0x46, 0x76, 0x1a, 0x8b, 0x00, 0x13, 0x6a, 0xcd, 0xb8, 0x16, 0x68, 0xc6, 0x23, 0x9f, + 0xcc, 0xd0, 0xe4, 0xcd, 0xad, 0x86, 0x29, 0xaf, 0xb7, 0x0f, 0x7f, 0xcf, 0xd4, 0x47, 0x5e, 0xfb, + 0x69, 0x4f, 0x16, 0x46, 0x93, 0x21, 0xfa, 0x03, 0x46, 0x25, 0xd4, 0x36, 0x13, 0xb7, 0x41, 0x97, + 0x91, 0x63, 0xd8, 0xca, 0x6d, 0x70, 0x72, 0x60, 0xa8, 0x98, 0xfe, 0x9d, 0x71, 0x9d, 0xf9, 0x07, + 0xc8, 0xc9, 0x47, 0xd8, 0x9b, 0x47, 0x1c, 0x29, 0x3e, 0xc8, 0xea, 0x8d, 0x7b, 0xf4, 0x08, 0xeb, + 0xe4, 0x12, 0xf6, 0xe7, 0xae, 0x3a, 0x72, 0x94, 0xeb, 0x65, 0x76, 0x51, 0xbb, 0xa5, 0x87, 0x03, + 0x90, 0x93, 0x1e, 0x1c, 0xb5, 0x13, 0xce, 0xc4, 0x99, 0x88, 0x12, 0xfe, 0x6c, 0x55, 0xde, 0xc2, + 0xf6, 0x94, 0x26, 0xe4, 0xd0, 0x5c, 0x9a, 0x9d, 0x15, 0xd7, 0x5d, 0x74, 0x84, 0xfc, 0x78, 0xf7, + 0x72, 0xbb, 0xa2, 0x3f, 0x1b, 0xde, 0xf0, 0x2b, 0x25, 0xe1, 0xd5, 0x8a, 0xfa, 0x2a, 0x78, 0xf5, + 0x2b, 0x00, 0x00, 0xff, 0xff, 0x01, 0x6a, 0x94, 0x1f, 0x54, 0x08, 0x00, 0x00, } diff --git a/pkg/proto/relay/relay.proto b/pkg/proto/relay/relay.proto index d8c5f1b7e..0203aa7ad 100644 --- a/pkg/proto/relay/relay.proto +++ b/pkg/proto/relay/relay.proto @@ -9,8 +9,23 @@ message OnlinePushMsgReq { string pushToUserID = 3; } message OnlinePushMsgResp{ -repeated SingleMsgToUser resp = 1; -}//message SendMsgByWSReq{ +repeated SingleMsgToUserPlatform resp = 1; +} +message SingelMsgToUserResultList{ + string userID =1; + repeated SingleMsgToUserPlatform resp = 2; + bool onlinePush = 3; + +} +message OnlineBatchPushOneMsgReq{ + string OperationID = 1; + server_api_params.MsgData msgData = 2; + repeated string pushToUserIDList = 3; +} +message OnlineBatchPushOneMsgResp{ + repeated SingelMsgToUserResultList singlePushResult= 1; +} +//message SendMsgByWSReq{ // string SendID = 1; // string RecvID = 2; // string Content = 3; @@ -22,7 +37,7 @@ repeated SingleMsgToUser resp = 1; // int64 PlatformID = 9; //} -message SingleMsgToUser{ +message SingleMsgToUserPlatform{ int64 ResultCode = 1; string RecvID = 2; int32 RecvPlatFormID = 3; @@ -52,10 +67,21 @@ message GetUsersOnlineStatusResp{ repeated SuccessDetail detailPlatformStatus = 3; } +} +message KickUserOfflineReq{ + string operationID = 1; +int32 platformID = 2; + repeated string kickUserIDList = 3; +} +message KickUserOfflineResp{ + } service OnlineMessageRelayService { rpc OnlinePushMsg(OnlinePushMsgReq) returns(OnlinePushMsgResp); rpc GetUsersOnlineStatus(GetUsersOnlineStatusReq)returns(GetUsersOnlineStatusResp); + rpc OnlineBatchPushOneMsg(OnlineBatchPushOneMsgReq) returns(OnlineBatchPushOneMsgResp); + rpc SuperGroupOnlineBatchPushOneMsg(OnlineBatchPushOneMsgReq) returns(OnlineBatchPushOneMsgResp); + rpc KickUserOffline(KickUserOfflineReq) returns(KickUserOfflineResp); // rpc SendMsgByWS(SendMsgByWSReq) returns(MsgToUserResp); } diff --git a/pkg/proto/rtc/rtc.pb.go b/pkg/proto/rtc/rtc.pb.go index a546f0f12..1a13ddc6f 100644 --- a/pkg/proto/rtc/rtc.pb.go +++ b/pkg/proto/rtc/rtc.pb.go @@ -1,922 +1,861 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc v3.15.5 -// source: proto/rtc.proto +// source: rtc/rtc.proto -package proto +package rtc // import "./rtc" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" import ( - context "context" + context "golang.org/x/net/context" grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type CommonResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *CommonResp) Reset() { - *x = CommonResp{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommonResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommonResp) ProtoMessage() {} - -func (x *CommonResp) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CommonResp.ProtoReflect.Descriptor instead. +func (m *CommonResp) Reset() { *m = CommonResp{} } +func (m *CommonResp) String() string { return proto.CompactTextString(m) } +func (*CommonResp) ProtoMessage() {} func (*CommonResp) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{0} + return fileDescriptor_rtc_2059f33abbeeea7e, []int{0} +} +func (m *CommonResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommonResp.Unmarshal(m, b) +} +func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) +} +func (dst *CommonResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommonResp.Merge(dst, src) +} +func (m *CommonResp) XXX_Size() int { + return xxx_messageInfo_CommonResp.Size(m) +} +func (m *CommonResp) XXX_DiscardUnknown() { + xxx_messageInfo_CommonResp.DiscardUnknown(m) } -func (x *CommonResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode +var xxx_messageInfo_CommonResp proto.InternalMessageInfo + +func (m *CommonResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode } return 0 } -func (x *CommonResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg +func (m *CommonResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg } return "" } type MsgData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SendID string `protobuf:"bytes,1,opt,name=sendID,proto3" json:"sendID,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=recvID,proto3" json:"recvID,omitempty"` - GroupID string `protobuf:"bytes,3,opt,name=groupID,proto3" json:"groupID,omitempty"` - ClientMsgID string `protobuf:"bytes,4,opt,name=clientMsgID,proto3" json:"clientMsgID,omitempty"` - ServerMsgID string `protobuf:"bytes,5,opt,name=serverMsgID,proto3" json:"serverMsgID,omitempty"` - SenderPlatformID int32 `protobuf:"varint,6,opt,name=senderPlatformID,proto3" json:"senderPlatformID,omitempty"` - SenderNickname string `protobuf:"bytes,7,opt,name=senderNickname,proto3" json:"senderNickname,omitempty"` - SenderFaceURL string `protobuf:"bytes,8,opt,name=senderFaceURL,proto3" json:"senderFaceURL,omitempty"` - SessionType int32 `protobuf:"varint,9,opt,name=sessionType,proto3" json:"sessionType,omitempty"` - MsgFrom int32 `protobuf:"varint,10,opt,name=msgFrom,proto3" json:"msgFrom,omitempty"` - ContentType int32 `protobuf:"varint,11,opt,name=contentType,proto3" json:"contentType,omitempty"` - Content []byte `protobuf:"bytes,12,opt,name=content,proto3" json:"content,omitempty"` - Seq uint32 `protobuf:"varint,14,opt,name=seq,proto3" json:"seq,omitempty"` - SendTime int64 `protobuf:"varint,15,opt,name=sendTime,proto3" json:"sendTime,omitempty"` - CreateTime int64 `protobuf:"varint,16,opt,name=createTime,proto3" json:"createTime,omitempty"` - Status int32 `protobuf:"varint,17,opt,name=status,proto3" json:"status,omitempty"` - Options map[string]bool `protobuf:"bytes,18,rep,name=options,proto3" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,19,opt,name=offlinePushInfo,proto3" json:"offlinePushInfo,omitempty"` + SendID string `protobuf:"bytes,1,opt,name=sendID" json:"sendID,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=recvID" json:"recvID,omitempty"` + GroupID string `protobuf:"bytes,3,opt,name=groupID" json:"groupID,omitempty"` + ClientMsgID string `protobuf:"bytes,4,opt,name=clientMsgID" json:"clientMsgID,omitempty"` + ServerMsgID string `protobuf:"bytes,5,opt,name=serverMsgID" json:"serverMsgID,omitempty"` + SenderPlatformID int32 `protobuf:"varint,6,opt,name=senderPlatformID" json:"senderPlatformID,omitempty"` + SenderNickname string `protobuf:"bytes,7,opt,name=senderNickname" json:"senderNickname,omitempty"` + SenderFaceURL string `protobuf:"bytes,8,opt,name=senderFaceURL" json:"senderFaceURL,omitempty"` + SessionType int32 `protobuf:"varint,9,opt,name=sessionType" json:"sessionType,omitempty"` + MsgFrom int32 `protobuf:"varint,10,opt,name=msgFrom" json:"msgFrom,omitempty"` + ContentType int32 `protobuf:"varint,11,opt,name=contentType" json:"contentType,omitempty"` + Content []byte `protobuf:"bytes,12,opt,name=content,proto3" json:"content,omitempty"` + Seq uint32 `protobuf:"varint,14,opt,name=seq" json:"seq,omitempty"` + SendTime int64 `protobuf:"varint,15,opt,name=sendTime" json:"sendTime,omitempty"` + CreateTime int64 `protobuf:"varint,16,opt,name=createTime" json:"createTime,omitempty"` + Status int32 `protobuf:"varint,17,opt,name=status" json:"status,omitempty"` + Options map[string]bool `protobuf:"bytes,18,rep,name=options" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,19,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *MsgData) Reset() { - *x = MsgData{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgData) ProtoMessage() {} - -func (x *MsgData) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MsgData.ProtoReflect.Descriptor instead. +func (m *MsgData) Reset() { *m = MsgData{} } +func (m *MsgData) String() string { return proto.CompactTextString(m) } +func (*MsgData) ProtoMessage() {} func (*MsgData) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{1} + return fileDescriptor_rtc_2059f33abbeeea7e, []int{1} +} +func (m *MsgData) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MsgData.Unmarshal(m, b) +} +func (m *MsgData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MsgData.Marshal(b, m, deterministic) +} +func (dst *MsgData) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgData.Merge(dst, src) +} +func (m *MsgData) XXX_Size() int { + return xxx_messageInfo_MsgData.Size(m) +} +func (m *MsgData) XXX_DiscardUnknown() { + xxx_messageInfo_MsgData.DiscardUnknown(m) } -func (x *MsgData) GetSendID() string { - if x != nil { - return x.SendID +var xxx_messageInfo_MsgData proto.InternalMessageInfo + +func (m *MsgData) GetSendID() string { + if m != nil { + return m.SendID } return "" } -func (x *MsgData) GetRecvID() string { - if x != nil { - return x.RecvID +func (m *MsgData) GetRecvID() string { + if m != nil { + return m.RecvID } return "" } -func (x *MsgData) GetGroupID() string { - if x != nil { - return x.GroupID +func (m *MsgData) GetGroupID() string { + if m != nil { + return m.GroupID } return "" } -func (x *MsgData) GetClientMsgID() string { - if x != nil { - return x.ClientMsgID +func (m *MsgData) GetClientMsgID() string { + if m != nil { + return m.ClientMsgID } return "" } -func (x *MsgData) GetServerMsgID() string { - if x != nil { - return x.ServerMsgID +func (m *MsgData) GetServerMsgID() string { + if m != nil { + return m.ServerMsgID } return "" } -func (x *MsgData) GetSenderPlatformID() int32 { - if x != nil { - return x.SenderPlatformID +func (m *MsgData) GetSenderPlatformID() int32 { + if m != nil { + return m.SenderPlatformID } return 0 } -func (x *MsgData) GetSenderNickname() string { - if x != nil { - return x.SenderNickname +func (m *MsgData) GetSenderNickname() string { + if m != nil { + return m.SenderNickname } return "" } -func (x *MsgData) GetSenderFaceURL() string { - if x != nil { - return x.SenderFaceURL +func (m *MsgData) GetSenderFaceURL() string { + if m != nil { + return m.SenderFaceURL } return "" } -func (x *MsgData) GetSessionType() int32 { - if x != nil { - return x.SessionType +func (m *MsgData) GetSessionType() int32 { + if m != nil { + return m.SessionType } return 0 } -func (x *MsgData) GetMsgFrom() int32 { - if x != nil { - return x.MsgFrom +func (m *MsgData) GetMsgFrom() int32 { + if m != nil { + return m.MsgFrom } return 0 } -func (x *MsgData) GetContentType() int32 { - if x != nil { - return x.ContentType +func (m *MsgData) GetContentType() int32 { + if m != nil { + return m.ContentType } return 0 } -func (x *MsgData) GetContent() []byte { - if x != nil { - return x.Content +func (m *MsgData) GetContent() []byte { + if m != nil { + return m.Content } return nil } -func (x *MsgData) GetSeq() uint32 { - if x != nil { - return x.Seq +func (m *MsgData) GetSeq() uint32 { + if m != nil { + return m.Seq } return 0 } -func (x *MsgData) GetSendTime() int64 { - if x != nil { - return x.SendTime +func (m *MsgData) GetSendTime() int64 { + if m != nil { + return m.SendTime } return 0 } -func (x *MsgData) GetCreateTime() int64 { - if x != nil { - return x.CreateTime +func (m *MsgData) GetCreateTime() int64 { + if m != nil { + return m.CreateTime } return 0 } -func (x *MsgData) GetStatus() int32 { - if x != nil { - return x.Status +func (m *MsgData) GetStatus() int32 { + if m != nil { + return m.Status } return 0 } -func (x *MsgData) GetOptions() map[string]bool { - if x != nil { - return x.Options +func (m *MsgData) GetOptions() map[string]bool { + if m != nil { + return m.Options } return nil } -func (x *MsgData) GetOfflinePushInfo() *OfflinePushInfo { - if x != nil { - return x.OfflinePushInfo +func (m *MsgData) GetOfflinePushInfo() *OfflinePushInfo { + if m != nil { + return m.OfflinePushInfo } return nil } type GroupInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID,omitempty"` - GroupName string `protobuf:"bytes,2,opt,name=groupName,proto3" json:"groupName,omitempty"` - Notification string `protobuf:"bytes,3,opt,name=notification,proto3" json:"notification,omitempty"` - Introduction string `protobuf:"bytes,4,opt,name=introduction,proto3" json:"introduction,omitempty"` - FaceURL string `protobuf:"bytes,5,opt,name=faceURL,proto3" json:"faceURL,omitempty"` - OwnerUserID string `protobuf:"bytes,6,opt,name=ownerUserID,proto3" json:"ownerUserID,omitempty"` - CreateTime uint32 `protobuf:"varint,7,opt,name=createTime,proto3" json:"createTime,omitempty"` - MemberCount uint32 `protobuf:"varint,8,opt,name=memberCount,proto3" json:"memberCount,omitempty"` - Ex string `protobuf:"bytes,9,opt,name=ex,proto3" json:"ex,omitempty"` - Status int32 `protobuf:"varint,10,opt,name=status,proto3" json:"status,omitempty"` - CreatorUserID string `protobuf:"bytes,11,opt,name=creatorUserID,proto3" json:"creatorUserID,omitempty"` - GroupType int32 `protobuf:"varint,12,opt,name=groupType,proto3" json:"groupType,omitempty"` + GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` + GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"` + Notification string `protobuf:"bytes,3,opt,name=notification" json:"notification,omitempty"` + Introduction string `protobuf:"bytes,4,opt,name=introduction" json:"introduction,omitempty"` + FaceURL string `protobuf:"bytes,5,opt,name=faceURL" json:"faceURL,omitempty"` + OwnerUserID string `protobuf:"bytes,6,opt,name=ownerUserID" json:"ownerUserID,omitempty"` + CreateTime uint32 `protobuf:"varint,7,opt,name=createTime" json:"createTime,omitempty"` + MemberCount uint32 `protobuf:"varint,8,opt,name=memberCount" json:"memberCount,omitempty"` + Ex string `protobuf:"bytes,9,opt,name=ex" json:"ex,omitempty"` + Status int32 `protobuf:"varint,10,opt,name=status" json:"status,omitempty"` + CreatorUserID string `protobuf:"bytes,11,opt,name=creatorUserID" json:"creatorUserID,omitempty"` + GroupType int32 `protobuf:"varint,12,opt,name=groupType" json:"groupType,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *GroupInfo) Reset() { - *x = GroupInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GroupInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupInfo) ProtoMessage() {} - -func (x *GroupInfo) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GroupInfo.ProtoReflect.Descriptor instead. +func (m *GroupInfo) Reset() { *m = GroupInfo{} } +func (m *GroupInfo) String() string { return proto.CompactTextString(m) } +func (*GroupInfo) ProtoMessage() {} func (*GroupInfo) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{2} + return fileDescriptor_rtc_2059f33abbeeea7e, []int{2} +} +func (m *GroupInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupInfo.Unmarshal(m, b) +} +func (m *GroupInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupInfo.Marshal(b, m, deterministic) +} +func (dst *GroupInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupInfo.Merge(dst, src) +} +func (m *GroupInfo) XXX_Size() int { + return xxx_messageInfo_GroupInfo.Size(m) +} +func (m *GroupInfo) XXX_DiscardUnknown() { + xxx_messageInfo_GroupInfo.DiscardUnknown(m) } -func (x *GroupInfo) GetGroupID() string { - if x != nil { - return x.GroupID +var xxx_messageInfo_GroupInfo proto.InternalMessageInfo + +func (m *GroupInfo) GetGroupID() string { + if m != nil { + return m.GroupID } return "" } -func (x *GroupInfo) GetGroupName() string { - if x != nil { - return x.GroupName +func (m *GroupInfo) GetGroupName() string { + if m != nil { + return m.GroupName } return "" } -func (x *GroupInfo) GetNotification() string { - if x != nil { - return x.Notification +func (m *GroupInfo) GetNotification() string { + if m != nil { + return m.Notification } return "" } -func (x *GroupInfo) GetIntroduction() string { - if x != nil { - return x.Introduction +func (m *GroupInfo) GetIntroduction() string { + if m != nil { + return m.Introduction } return "" } -func (x *GroupInfo) GetFaceURL() string { - if x != nil { - return x.FaceURL +func (m *GroupInfo) GetFaceURL() string { + if m != nil { + return m.FaceURL } return "" } -func (x *GroupInfo) GetOwnerUserID() string { - if x != nil { - return x.OwnerUserID +func (m *GroupInfo) GetOwnerUserID() string { + if m != nil { + return m.OwnerUserID } return "" } -func (x *GroupInfo) GetCreateTime() uint32 { - if x != nil { - return x.CreateTime +func (m *GroupInfo) GetCreateTime() uint32 { + if m != nil { + return m.CreateTime } return 0 } -func (x *GroupInfo) GetMemberCount() uint32 { - if x != nil { - return x.MemberCount +func (m *GroupInfo) GetMemberCount() uint32 { + if m != nil { + return m.MemberCount } return 0 } -func (x *GroupInfo) GetEx() string { - if x != nil { - return x.Ex +func (m *GroupInfo) GetEx() string { + if m != nil { + return m.Ex } return "" } -func (x *GroupInfo) GetStatus() int32 { - if x != nil { - return x.Status +func (m *GroupInfo) GetStatus() int32 { + if m != nil { + return m.Status } return 0 } -func (x *GroupInfo) GetCreatorUserID() string { - if x != nil { - return x.CreatorUserID +func (m *GroupInfo) GetCreatorUserID() string { + if m != nil { + return m.CreatorUserID } return "" } -func (x *GroupInfo) GetGroupType() int32 { - if x != nil { - return x.GroupType +func (m *GroupInfo) GetGroupType() int32 { + if m != nil { + return m.GroupType } return 0 } type GroupMemberFullInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID,omitempty"` - UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID,omitempty"` - RoleLevel int32 `protobuf:"varint,3,opt,name=roleLevel,proto3" json:"roleLevel,omitempty"` - JoinTime int32 `protobuf:"varint,4,opt,name=joinTime,proto3" json:"joinTime,omitempty"` - Nickname string `protobuf:"bytes,5,opt,name=nickname,proto3" json:"nickname,omitempty"` - FaceURL string `protobuf:"bytes,6,opt,name=faceURL,proto3" json:"faceURL,omitempty"` - AppMangerLevel int32 `protobuf:"varint,7,opt,name=appMangerLevel,proto3" json:"appMangerLevel,omitempty"` //if >0 - JoinSource int32 `protobuf:"varint,8,opt,name=joinSource,proto3" json:"joinSource,omitempty"` - OperatorUserID string `protobuf:"bytes,9,opt,name=operatorUserID,proto3" json:"operatorUserID,omitempty"` - Ex string `protobuf:"bytes,10,opt,name=ex,proto3" json:"ex,omitempty"` + GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + RoleLevel int32 `protobuf:"varint,3,opt,name=roleLevel" json:"roleLevel,omitempty"` + JoinTime int32 `protobuf:"varint,4,opt,name=joinTime" json:"joinTime,omitempty"` + Nickname string `protobuf:"bytes,5,opt,name=nickname" json:"nickname,omitempty"` + FaceURL string `protobuf:"bytes,6,opt,name=faceURL" json:"faceURL,omitempty"` + AppMangerLevel int32 `protobuf:"varint,7,opt,name=appMangerLevel" json:"appMangerLevel,omitempty"` + JoinSource int32 `protobuf:"varint,8,opt,name=joinSource" json:"joinSource,omitempty"` + OperatorUserID string `protobuf:"bytes,9,opt,name=operatorUserID" json:"operatorUserID,omitempty"` + Ex string `protobuf:"bytes,10,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *GroupMemberFullInfo) Reset() { - *x = GroupMemberFullInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GroupMemberFullInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupMemberFullInfo) ProtoMessage() {} - -func (x *GroupMemberFullInfo) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GroupMemberFullInfo.ProtoReflect.Descriptor instead. +func (m *GroupMemberFullInfo) Reset() { *m = GroupMemberFullInfo{} } +func (m *GroupMemberFullInfo) String() string { return proto.CompactTextString(m) } +func (*GroupMemberFullInfo) ProtoMessage() {} func (*GroupMemberFullInfo) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{3} + return fileDescriptor_rtc_2059f33abbeeea7e, []int{3} +} +func (m *GroupMemberFullInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupMemberFullInfo.Unmarshal(m, b) +} +func (m *GroupMemberFullInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupMemberFullInfo.Marshal(b, m, deterministic) +} +func (dst *GroupMemberFullInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupMemberFullInfo.Merge(dst, src) +} +func (m *GroupMemberFullInfo) XXX_Size() int { + return xxx_messageInfo_GroupMemberFullInfo.Size(m) +} +func (m *GroupMemberFullInfo) XXX_DiscardUnknown() { + xxx_messageInfo_GroupMemberFullInfo.DiscardUnknown(m) } -func (x *GroupMemberFullInfo) GetGroupID() string { - if x != nil { - return x.GroupID +var xxx_messageInfo_GroupMemberFullInfo proto.InternalMessageInfo + +func (m *GroupMemberFullInfo) GetGroupID() string { + if m != nil { + return m.GroupID } return "" } -func (x *GroupMemberFullInfo) GetUserID() string { - if x != nil { - return x.UserID +func (m *GroupMemberFullInfo) GetUserID() string { + if m != nil { + return m.UserID } return "" } -func (x *GroupMemberFullInfo) GetRoleLevel() int32 { - if x != nil { - return x.RoleLevel +func (m *GroupMemberFullInfo) GetRoleLevel() int32 { + if m != nil { + return m.RoleLevel } return 0 } -func (x *GroupMemberFullInfo) GetJoinTime() int32 { - if x != nil { - return x.JoinTime +func (m *GroupMemberFullInfo) GetJoinTime() int32 { + if m != nil { + return m.JoinTime } return 0 } -func (x *GroupMemberFullInfo) GetNickname() string { - if x != nil { - return x.Nickname +func (m *GroupMemberFullInfo) GetNickname() string { + if m != nil { + return m.Nickname } return "" } -func (x *GroupMemberFullInfo) GetFaceURL() string { - if x != nil { - return x.FaceURL +func (m *GroupMemberFullInfo) GetFaceURL() string { + if m != nil { + return m.FaceURL } return "" } -func (x *GroupMemberFullInfo) GetAppMangerLevel() int32 { - if x != nil { - return x.AppMangerLevel +func (m *GroupMemberFullInfo) GetAppMangerLevel() int32 { + if m != nil { + return m.AppMangerLevel } return 0 } -func (x *GroupMemberFullInfo) GetJoinSource() int32 { - if x != nil { - return x.JoinSource +func (m *GroupMemberFullInfo) GetJoinSource() int32 { + if m != nil { + return m.JoinSource } return 0 } -func (x *GroupMemberFullInfo) GetOperatorUserID() string { - if x != nil { - return x.OperatorUserID +func (m *GroupMemberFullInfo) GetOperatorUserID() string { + if m != nil { + return m.OperatorUserID } return "" } -func (x *GroupMemberFullInfo) GetEx() string { - if x != nil { - return x.Ex +func (m *GroupMemberFullInfo) GetEx() string { + if m != nil { + return m.Ex } return "" } type ParticipantMetaData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GroupInfo *GroupInfo `protobuf:"bytes,1,opt,name=groupInfo,proto3" json:"groupInfo,omitempty"` - GroupMemberInfo *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=groupMemberInfo,proto3" json:"groupMemberInfo,omitempty"` - UserInfo *PublicUserInfo `protobuf:"bytes,3,opt,name=userInfo,proto3" json:"userInfo,omitempty"` + GroupInfo *GroupInfo `protobuf:"bytes,1,opt,name=groupInfo" json:"groupInfo,omitempty"` + GroupMemberInfo *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=groupMemberInfo" json:"groupMemberInfo,omitempty"` + UserInfo *PublicUserInfo `protobuf:"bytes,3,opt,name=userInfo" json:"userInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *ParticipantMetaData) Reset() { - *x = ParticipantMetaData{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ParticipantMetaData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParticipantMetaData) ProtoMessage() {} - -func (x *ParticipantMetaData) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ParticipantMetaData.ProtoReflect.Descriptor instead. +func (m *ParticipantMetaData) Reset() { *m = ParticipantMetaData{} } +func (m *ParticipantMetaData) String() string { return proto.CompactTextString(m) } +func (*ParticipantMetaData) ProtoMessage() {} func (*ParticipantMetaData) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{4} + return fileDescriptor_rtc_2059f33abbeeea7e, []int{4} +} +func (m *ParticipantMetaData) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ParticipantMetaData.Unmarshal(m, b) +} +func (m *ParticipantMetaData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ParticipantMetaData.Marshal(b, m, deterministic) +} +func (dst *ParticipantMetaData) XXX_Merge(src proto.Message) { + xxx_messageInfo_ParticipantMetaData.Merge(dst, src) +} +func (m *ParticipantMetaData) XXX_Size() int { + return xxx_messageInfo_ParticipantMetaData.Size(m) +} +func (m *ParticipantMetaData) XXX_DiscardUnknown() { + xxx_messageInfo_ParticipantMetaData.DiscardUnknown(m) } -func (x *ParticipantMetaData) GetGroupInfo() *GroupInfo { - if x != nil { - return x.GroupInfo +var xxx_messageInfo_ParticipantMetaData proto.InternalMessageInfo + +func (m *ParticipantMetaData) GetGroupInfo() *GroupInfo { + if m != nil { + return m.GroupInfo } return nil } -func (x *ParticipantMetaData) GetGroupMemberInfo() *GroupMemberFullInfo { - if x != nil { - return x.GroupMemberInfo +func (m *ParticipantMetaData) GetGroupMemberInfo() *GroupMemberFullInfo { + if m != nil { + return m.GroupMemberInfo } return nil } -func (x *ParticipantMetaData) GetUserInfo() *PublicUserInfo { - if x != nil { - return x.UserInfo +func (m *ParticipantMetaData) GetUserInfo() *PublicUserInfo { + if m != nil { + return m.UserInfo } return nil } type PublicUserInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"` - Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty"` - FaceURL string `protobuf:"bytes,3,opt,name=faceURL,proto3" json:"faceURL,omitempty"` - Gender int32 `protobuf:"varint,4,opt,name=gender,proto3" json:"gender,omitempty"` - Ex string `protobuf:"bytes,5,opt,name=ex,proto3" json:"ex,omitempty"` + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Nickname string `protobuf:"bytes,2,opt,name=nickname" json:"nickname,omitempty"` + FaceURL string `protobuf:"bytes,3,opt,name=faceURL" json:"faceURL,omitempty"` + Gender int32 `protobuf:"varint,4,opt,name=gender" json:"gender,omitempty"` + Ex string `protobuf:"bytes,5,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *PublicUserInfo) Reset() { - *x = PublicUserInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PublicUserInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PublicUserInfo) ProtoMessage() {} - -func (x *PublicUserInfo) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PublicUserInfo.ProtoReflect.Descriptor instead. +func (m *PublicUserInfo) Reset() { *m = PublicUserInfo{} } +func (m *PublicUserInfo) String() string { return proto.CompactTextString(m) } +func (*PublicUserInfo) ProtoMessage() {} func (*PublicUserInfo) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{5} + return fileDescriptor_rtc_2059f33abbeeea7e, []int{5} +} +func (m *PublicUserInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PublicUserInfo.Unmarshal(m, b) +} +func (m *PublicUserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PublicUserInfo.Marshal(b, m, deterministic) +} +func (dst *PublicUserInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_PublicUserInfo.Merge(dst, src) +} +func (m *PublicUserInfo) XXX_Size() int { + return xxx_messageInfo_PublicUserInfo.Size(m) +} +func (m *PublicUserInfo) XXX_DiscardUnknown() { + xxx_messageInfo_PublicUserInfo.DiscardUnknown(m) } -func (x *PublicUserInfo) GetUserID() string { - if x != nil { - return x.UserID +var xxx_messageInfo_PublicUserInfo proto.InternalMessageInfo + +func (m *PublicUserInfo) GetUserID() string { + if m != nil { + return m.UserID } return "" } -func (x *PublicUserInfo) GetNickname() string { - if x != nil { - return x.Nickname +func (m *PublicUserInfo) GetNickname() string { + if m != nil { + return m.Nickname } return "" } -func (x *PublicUserInfo) GetFaceURL() string { - if x != nil { - return x.FaceURL +func (m *PublicUserInfo) GetFaceURL() string { + if m != nil { + return m.FaceURL } return "" } -func (x *PublicUserInfo) GetGender() int32 { - if x != nil { - return x.Gender +func (m *PublicUserInfo) GetGender() int32 { + if m != nil { + return m.Gender } return 0 } -func (x *PublicUserInfo) GetEx() string { - if x != nil { - return x.Ex +func (m *PublicUserInfo) GetEx() string { + if m != nil { + return m.Ex } return "" } type GetJoinTokenReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Room string `protobuf:"bytes,1,opt,name=room,proto3" json:"room,omitempty"` - Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` - MetaData *ParticipantMetaData `protobuf:"bytes,3,opt,name=metaData,proto3" json:"metaData,omitempty"` - OperationID string `protobuf:"bytes,4,opt,name=operationID,proto3" json:"operationID,omitempty"` + Room string `protobuf:"bytes,1,opt,name=room" json:"room,omitempty"` + Identity string `protobuf:"bytes,2,opt,name=identity" json:"identity,omitempty"` + MetaData *ParticipantMetaData `protobuf:"bytes,3,opt,name=metaData" json:"metaData,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *GetJoinTokenReq) Reset() { - *x = GetJoinTokenReq{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetJoinTokenReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetJoinTokenReq) ProtoMessage() {} - -func (x *GetJoinTokenReq) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetJoinTokenReq.ProtoReflect.Descriptor instead. +func (m *GetJoinTokenReq) Reset() { *m = GetJoinTokenReq{} } +func (m *GetJoinTokenReq) String() string { return proto.CompactTextString(m) } +func (*GetJoinTokenReq) ProtoMessage() {} func (*GetJoinTokenReq) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{6} + return fileDescriptor_rtc_2059f33abbeeea7e, []int{6} +} +func (m *GetJoinTokenReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetJoinTokenReq.Unmarshal(m, b) +} +func (m *GetJoinTokenReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetJoinTokenReq.Marshal(b, m, deterministic) +} +func (dst *GetJoinTokenReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetJoinTokenReq.Merge(dst, src) +} +func (m *GetJoinTokenReq) XXX_Size() int { + return xxx_messageInfo_GetJoinTokenReq.Size(m) +} +func (m *GetJoinTokenReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetJoinTokenReq.DiscardUnknown(m) } -func (x *GetJoinTokenReq) GetRoom() string { - if x != nil { - return x.Room +var xxx_messageInfo_GetJoinTokenReq proto.InternalMessageInfo + +func (m *GetJoinTokenReq) GetRoom() string { + if m != nil { + return m.Room } return "" } -func (x *GetJoinTokenReq) GetIdentity() string { - if x != nil { - return x.Identity +func (m *GetJoinTokenReq) GetIdentity() string { + if m != nil { + return m.Identity } return "" } -func (x *GetJoinTokenReq) GetMetaData() *ParticipantMetaData { - if x != nil { - return x.MetaData +func (m *GetJoinTokenReq) GetMetaData() *ParticipantMetaData { + if m != nil { + return m.MetaData } return nil } -func (x *GetJoinTokenReq) GetOperationID() string { - if x != nil { - return x.OperationID +func (m *GetJoinTokenReq) GetOperationID() string { + if m != nil { + return m.OperationID } return "" } type GetJoinTokenResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` - Jwt string `protobuf:"bytes,2,opt,name=jwt,proto3" json:"jwt,omitempty"` - LiveURL string `protobuf:"bytes,3,opt,name=liveURL,proto3" json:"liveURL,omitempty"` + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + Jwt string `protobuf:"bytes,2,opt,name=jwt" json:"jwt,omitempty"` + LiveURL string `protobuf:"bytes,3,opt,name=liveURL" json:"liveURL,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *GetJoinTokenResp) Reset() { - *x = GetJoinTokenResp{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetJoinTokenResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetJoinTokenResp) ProtoMessage() {} - -func (x *GetJoinTokenResp) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetJoinTokenResp.ProtoReflect.Descriptor instead. +func (m *GetJoinTokenResp) Reset() { *m = GetJoinTokenResp{} } +func (m *GetJoinTokenResp) String() string { return proto.CompactTextString(m) } +func (*GetJoinTokenResp) ProtoMessage() {} func (*GetJoinTokenResp) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{7} + return fileDescriptor_rtc_2059f33abbeeea7e, []int{7} +} +func (m *GetJoinTokenResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetJoinTokenResp.Unmarshal(m, b) +} +func (m *GetJoinTokenResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetJoinTokenResp.Marshal(b, m, deterministic) +} +func (dst *GetJoinTokenResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetJoinTokenResp.Merge(dst, src) +} +func (m *GetJoinTokenResp) XXX_Size() int { + return xxx_messageInfo_GetJoinTokenResp.Size(m) +} +func (m *GetJoinTokenResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetJoinTokenResp.DiscardUnknown(m) } -func (x *GetJoinTokenResp) GetCommonResp() *CommonResp { - if x != nil { - return x.CommonResp +var xxx_messageInfo_GetJoinTokenResp proto.InternalMessageInfo + +func (m *GetJoinTokenResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp } return nil } -func (x *GetJoinTokenResp) GetJwt() string { - if x != nil { - return x.Jwt +func (m *GetJoinTokenResp) GetJwt() string { + if m != nil { + return m.Jwt } return "" } -func (x *GetJoinTokenResp) GetLiveURL() string { - if x != nil { - return x.LiveURL +func (m *GetJoinTokenResp) GetLiveURL() string { + if m != nil { + return m.LiveURL } return "" } type OfflinePushInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` - Ex string `protobuf:"bytes,3,opt,name=ex,proto3" json:"ex,omitempty"` - IOSPushSound string `protobuf:"bytes,4,opt,name=iOSPushSound,proto3" json:"iOSPushSound,omitempty"` - IOSBadgeCount bool `protobuf:"varint,5,opt,name=iOSBadgeCount,proto3" json:"iOSBadgeCount,omitempty"` + Title string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"` + Desc string `protobuf:"bytes,2,opt,name=desc" json:"desc,omitempty"` + Ex string `protobuf:"bytes,3,opt,name=ex" json:"ex,omitempty"` + IOSPushSound string `protobuf:"bytes,4,opt,name=iOSPushSound" json:"iOSPushSound,omitempty"` + IOSBadgeCount bool `protobuf:"varint,5,opt,name=iOSBadgeCount" json:"iOSBadgeCount,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *OfflinePushInfo) Reset() { - *x = OfflinePushInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OfflinePushInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OfflinePushInfo) ProtoMessage() {} - -func (x *OfflinePushInfo) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OfflinePushInfo.ProtoReflect.Descriptor instead. +func (m *OfflinePushInfo) Reset() { *m = OfflinePushInfo{} } +func (m *OfflinePushInfo) String() string { return proto.CompactTextString(m) } +func (*OfflinePushInfo) ProtoMessage() {} func (*OfflinePushInfo) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{8} + return fileDescriptor_rtc_2059f33abbeeea7e, []int{8} +} +func (m *OfflinePushInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OfflinePushInfo.Unmarshal(m, b) +} +func (m *OfflinePushInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OfflinePushInfo.Marshal(b, m, deterministic) +} +func (dst *OfflinePushInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_OfflinePushInfo.Merge(dst, src) +} +func (m *OfflinePushInfo) XXX_Size() int { + return xxx_messageInfo_OfflinePushInfo.Size(m) +} +func (m *OfflinePushInfo) XXX_DiscardUnknown() { + xxx_messageInfo_OfflinePushInfo.DiscardUnknown(m) } -func (x *OfflinePushInfo) GetTitle() string { - if x != nil { - return x.Title +var xxx_messageInfo_OfflinePushInfo proto.InternalMessageInfo + +func (m *OfflinePushInfo) GetTitle() string { + if m != nil { + return m.Title } return "" } -func (x *OfflinePushInfo) GetDesc() string { - if x != nil { - return x.Desc +func (m *OfflinePushInfo) GetDesc() string { + if m != nil { + return m.Desc } return "" } -func (x *OfflinePushInfo) GetEx() string { - if x != nil { - return x.Ex +func (m *OfflinePushInfo) GetEx() string { + if m != nil { + return m.Ex } return "" } -func (x *OfflinePushInfo) GetIOSPushSound() string { - if x != nil { - return x.IOSPushSound +func (m *OfflinePushInfo) GetIOSPushSound() string { + if m != nil { + return m.IOSPushSound } return "" } -func (x *OfflinePushInfo) GetIOSBadgeCount() bool { - if x != nil { - return x.IOSBadgeCount +func (m *OfflinePushInfo) GetIOSBadgeCount() bool { + if m != nil { + return m.IOSBadgeCount } return false } type SignalReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Payload: + // Types that are valid to be assigned to Payload: // *SignalReq_Invite // *SignalReq_InviteInGroup // *SignalReq_Cancel // *SignalReq_Accept // *SignalReq_HungUp // *SignalReq_Reject - Payload isSignalReq_Payload `protobuf_oneof:"payload"` + Payload isSignalReq_Payload `protobuf_oneof:"payload"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *SignalReq) Reset() { - *x = SignalReq{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalReq) ProtoMessage() {} - -func (x *SignalReq) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalReq.ProtoReflect.Descriptor instead. +func (m *SignalReq) Reset() { *m = SignalReq{} } +func (m *SignalReq) String() string { return proto.CompactTextString(m) } +func (*SignalReq) ProtoMessage() {} func (*SignalReq) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{9} + return fileDescriptor_rtc_2059f33abbeeea7e, []int{9} } +func (m *SignalReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalReq.Unmarshal(m, b) +} +func (m *SignalReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalReq.Marshal(b, m, deterministic) +} +func (dst *SignalReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalReq.Merge(dst, src) +} +func (m *SignalReq) XXX_Size() int { + return xxx_messageInfo_SignalReq.Size(m) +} +func (m *SignalReq) XXX_DiscardUnknown() { + xxx_messageInfo_SignalReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalReq proto.InternalMessageInfo + +type isSignalReq_Payload interface { + isSignalReq_Payload() +} + +type SignalReq_Invite struct { + Invite *SignalInviteReq `protobuf:"bytes,1,opt,name=invite,oneof"` +} +type SignalReq_InviteInGroup struct { + InviteInGroup *SignalInviteInGroupReq `protobuf:"bytes,2,opt,name=inviteInGroup,oneof"` +} +type SignalReq_Cancel struct { + Cancel *SignalCancelReq `protobuf:"bytes,3,opt,name=cancel,oneof"` +} +type SignalReq_Accept struct { + Accept *SignalAcceptReq `protobuf:"bytes,4,opt,name=accept,oneof"` +} +type SignalReq_HungUp struct { + HungUp *SignalHungUpReq `protobuf:"bytes,5,opt,name=hungUp,oneof"` +} +type SignalReq_Reject struct { + Reject *SignalRejectReq `protobuf:"bytes,6,opt,name=reject,oneof"` +} + +func (*SignalReq_Invite) isSignalReq_Payload() {} +func (*SignalReq_InviteInGroup) isSignalReq_Payload() {} +func (*SignalReq_Cancel) isSignalReq_Payload() {} +func (*SignalReq_Accept) isSignalReq_Payload() {} +func (*SignalReq_HungUp) isSignalReq_Payload() {} +func (*SignalReq_Reject) isSignalReq_Payload() {} func (m *SignalReq) GetPayload() isSignalReq_Payload { if m != nil { @@ -925,134 +864,265 @@ func (m *SignalReq) GetPayload() isSignalReq_Payload { return nil } -func (x *SignalReq) GetInvite() *SignalInviteReq { - if x, ok := x.GetPayload().(*SignalReq_Invite); ok { +func (m *SignalReq) GetInvite() *SignalInviteReq { + if x, ok := m.GetPayload().(*SignalReq_Invite); ok { return x.Invite } return nil } -func (x *SignalReq) GetInviteInGroup() *SignalInviteInGroupReq { - if x, ok := x.GetPayload().(*SignalReq_InviteInGroup); ok { +func (m *SignalReq) GetInviteInGroup() *SignalInviteInGroupReq { + if x, ok := m.GetPayload().(*SignalReq_InviteInGroup); ok { return x.InviteInGroup } return nil } -func (x *SignalReq) GetCancel() *SignalCancelReq { - if x, ok := x.GetPayload().(*SignalReq_Cancel); ok { +func (m *SignalReq) GetCancel() *SignalCancelReq { + if x, ok := m.GetPayload().(*SignalReq_Cancel); ok { return x.Cancel } return nil } -func (x *SignalReq) GetAccept() *SignalAcceptReq { - if x, ok := x.GetPayload().(*SignalReq_Accept); ok { +func (m *SignalReq) GetAccept() *SignalAcceptReq { + if x, ok := m.GetPayload().(*SignalReq_Accept); ok { return x.Accept } return nil } -func (x *SignalReq) GetHungUp() *SignalHungUpReq { - if x, ok := x.GetPayload().(*SignalReq_HungUp); ok { +func (m *SignalReq) GetHungUp() *SignalHungUpReq { + if x, ok := m.GetPayload().(*SignalReq_HungUp); ok { return x.HungUp } return nil } -func (x *SignalReq) GetReject() *SignalRejectReq { - if x, ok := x.GetPayload().(*SignalReq_Reject); ok { +func (m *SignalReq) GetReject() *SignalRejectReq { + if x, ok := m.GetPayload().(*SignalReq_Reject); ok { return x.Reject } return nil } -type isSignalReq_Payload interface { - isSignalReq_Payload() +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SignalReq) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SignalReq_OneofMarshaler, _SignalReq_OneofUnmarshaler, _SignalReq_OneofSizer, []interface{}{ + (*SignalReq_Invite)(nil), + (*SignalReq_InviteInGroup)(nil), + (*SignalReq_Cancel)(nil), + (*SignalReq_Accept)(nil), + (*SignalReq_HungUp)(nil), + (*SignalReq_Reject)(nil), + } } -type SignalReq_Invite struct { - Invite *SignalInviteReq `protobuf:"bytes,1,opt,name=invite,proto3,oneof"` +func _SignalReq_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SignalReq) + // payload + switch x := m.Payload.(type) { + case *SignalReq_Invite: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Invite); err != nil { + return err + } + case *SignalReq_InviteInGroup: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.InviteInGroup); err != nil { + return err + } + case *SignalReq_Cancel: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Cancel); err != nil { + return err + } + case *SignalReq_Accept: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Accept); err != nil { + return err + } + case *SignalReq_HungUp: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.HungUp); err != nil { + return err + } + case *SignalReq_Reject: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Reject); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("SignalReq.Payload has unexpected type %T", x) + } + return nil } -type SignalReq_InviteInGroup struct { - InviteInGroup *SignalInviteInGroupReq `protobuf:"bytes,2,opt,name=inviteInGroup,proto3,oneof"` +func _SignalReq_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SignalReq) + switch tag { + case 1: // payload.invite + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalInviteReq) + err := b.DecodeMessage(msg) + m.Payload = &SignalReq_Invite{msg} + return true, err + case 2: // payload.inviteInGroup + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalInviteInGroupReq) + err := b.DecodeMessage(msg) + m.Payload = &SignalReq_InviteInGroup{msg} + return true, err + case 3: // payload.cancel + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalCancelReq) + err := b.DecodeMessage(msg) + m.Payload = &SignalReq_Cancel{msg} + return true, err + case 4: // payload.accept + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalAcceptReq) + err := b.DecodeMessage(msg) + m.Payload = &SignalReq_Accept{msg} + return true, err + case 5: // payload.hungUp + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalHungUpReq) + err := b.DecodeMessage(msg) + m.Payload = &SignalReq_HungUp{msg} + return true, err + case 6: // payload.reject + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalRejectReq) + err := b.DecodeMessage(msg) + m.Payload = &SignalReq_Reject{msg} + return true, err + default: + return false, nil + } } -type SignalReq_Cancel struct { - Cancel *SignalCancelReq `protobuf:"bytes,3,opt,name=cancel,proto3,oneof"` +func _SignalReq_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SignalReq) + // payload + switch x := m.Payload.(type) { + case *SignalReq_Invite: + s := proto.Size(x.Invite) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalReq_InviteInGroup: + s := proto.Size(x.InviteInGroup) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalReq_Cancel: + s := proto.Size(x.Cancel) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalReq_Accept: + s := proto.Size(x.Accept) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalReq_HungUp: + s := proto.Size(x.HungUp) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalReq_Reject: + s := proto.Size(x.Reject) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n } -type SignalReq_Accept struct { - Accept *SignalAcceptReq `protobuf:"bytes,4,opt,name=accept,proto3,oneof"` -} - -type SignalReq_HungUp struct { - HungUp *SignalHungUpReq `protobuf:"bytes,5,opt,name=hungUp,proto3,oneof"` -} - -type SignalReq_Reject struct { - Reject *SignalRejectReq `protobuf:"bytes,6,opt,name=reject,proto3,oneof"` -} - -func (*SignalReq_Invite) isSignalReq_Payload() {} - -func (*SignalReq_InviteInGroup) isSignalReq_Payload() {} - -func (*SignalReq_Cancel) isSignalReq_Payload() {} - -func (*SignalReq_Accept) isSignalReq_Payload() {} - -func (*SignalReq_HungUp) isSignalReq_Payload() {} - -func (*SignalReq_Reject) isSignalReq_Payload() {} - type SignalResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Payload: + // Types that are valid to be assigned to Payload: // *SignalResp_Invite // *SignalResp_InviteInGroup // *SignalResp_Cancel // *SignalResp_Accept // *SignalResp_HungUp // *SignalResp_Reject - Payload isSignalResp_Payload `protobuf_oneof:"payload"` + Payload isSignalResp_Payload `protobuf_oneof:"payload"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *SignalResp) Reset() { - *x = SignalResp{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalResp) ProtoMessage() {} - -func (x *SignalResp) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalResp.ProtoReflect.Descriptor instead. +func (m *SignalResp) Reset() { *m = SignalResp{} } +func (m *SignalResp) String() string { return proto.CompactTextString(m) } +func (*SignalResp) ProtoMessage() {} func (*SignalResp) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{10} + return fileDescriptor_rtc_2059f33abbeeea7e, []int{10} } +func (m *SignalResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalResp.Unmarshal(m, b) +} +func (m *SignalResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalResp.Marshal(b, m, deterministic) +} +func (dst *SignalResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalResp.Merge(dst, src) +} +func (m *SignalResp) XXX_Size() int { + return xxx_messageInfo_SignalResp.Size(m) +} +func (m *SignalResp) XXX_DiscardUnknown() { + xxx_messageInfo_SignalResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalResp proto.InternalMessageInfo + +type isSignalResp_Payload interface { + isSignalResp_Payload() +} + +type SignalResp_Invite struct { + Invite *SignalInviteReply `protobuf:"bytes,1,opt,name=invite,oneof"` +} +type SignalResp_InviteInGroup struct { + InviteInGroup *SignalInviteInGroupReply `protobuf:"bytes,2,opt,name=inviteInGroup,oneof"` +} +type SignalResp_Cancel struct { + Cancel *SignalCancelReply `protobuf:"bytes,3,opt,name=cancel,oneof"` +} +type SignalResp_Accept struct { + Accept *SignalAcceptReply `protobuf:"bytes,4,opt,name=accept,oneof"` +} +type SignalResp_HungUp struct { + HungUp *SignalHungUpReply `protobuf:"bytes,5,opt,name=hungUp,oneof"` +} +type SignalResp_Reject struct { + Reject *SignalRejectReply `protobuf:"bytes,6,opt,name=reject,oneof"` +} + +func (*SignalResp_Invite) isSignalResp_Payload() {} +func (*SignalResp_InviteInGroup) isSignalResp_Payload() {} +func (*SignalResp_Cancel) isSignalResp_Payload() {} +func (*SignalResp_Accept) isSignalResp_Payload() {} +func (*SignalResp_HungUp) isSignalResp_Payload() {} +func (*SignalResp_Reject) isSignalResp_Payload() {} func (m *SignalResp) GetPayload() isSignalResp_Payload { if m != nil { @@ -1061,1827 +1131,51 @@ func (m *SignalResp) GetPayload() isSignalResp_Payload { return nil } -func (x *SignalResp) GetInvite() *SignalInviteReply { - if x, ok := x.GetPayload().(*SignalResp_Invite); ok { +func (m *SignalResp) GetInvite() *SignalInviteReply { + if x, ok := m.GetPayload().(*SignalResp_Invite); ok { return x.Invite } return nil } -func (x *SignalResp) GetInviteInGroup() *SignalInviteInGroupReply { - if x, ok := x.GetPayload().(*SignalResp_InviteInGroup); ok { +func (m *SignalResp) GetInviteInGroup() *SignalInviteInGroupReply { + if x, ok := m.GetPayload().(*SignalResp_InviteInGroup); ok { return x.InviteInGroup } return nil } -func (x *SignalResp) GetCancel() *SignalCancelReply { - if x, ok := x.GetPayload().(*SignalResp_Cancel); ok { +func (m *SignalResp) GetCancel() *SignalCancelReply { + if x, ok := m.GetPayload().(*SignalResp_Cancel); ok { return x.Cancel } return nil } -func (x *SignalResp) GetAccept() *SignalAcceptReply { - if x, ok := x.GetPayload().(*SignalResp_Accept); ok { +func (m *SignalResp) GetAccept() *SignalAcceptReply { + if x, ok := m.GetPayload().(*SignalResp_Accept); ok { return x.Accept } return nil } -func (x *SignalResp) GetHungUp() *SignalHungUpReply { - if x, ok := x.GetPayload().(*SignalResp_HungUp); ok { +func (m *SignalResp) GetHungUp() *SignalHungUpReply { + if x, ok := m.GetPayload().(*SignalResp_HungUp); ok { return x.HungUp } return nil } -func (x *SignalResp) GetReject() *SignalRejectReply { - if x, ok := x.GetPayload().(*SignalResp_Reject); ok { +func (m *SignalResp) GetReject() *SignalRejectReply { + if x, ok := m.GetPayload().(*SignalResp_Reject); ok { return x.Reject } return nil } -type isSignalResp_Payload interface { - isSignalResp_Payload() -} - -type SignalResp_Invite struct { - Invite *SignalInviteReply `protobuf:"bytes,1,opt,name=invite,proto3,oneof"` -} - -type SignalResp_InviteInGroup struct { - InviteInGroup *SignalInviteInGroupReply `protobuf:"bytes,2,opt,name=inviteInGroup,proto3,oneof"` -} - -type SignalResp_Cancel struct { - Cancel *SignalCancelReply `protobuf:"bytes,3,opt,name=cancel,proto3,oneof"` -} - -type SignalResp_Accept struct { - Accept *SignalAcceptReply `protobuf:"bytes,4,opt,name=accept,proto3,oneof"` -} - -type SignalResp_HungUp struct { - HungUp *SignalHungUpReply `protobuf:"bytes,5,opt,name=hungUp,proto3,oneof"` -} - -type SignalResp_Reject struct { - Reject *SignalRejectReply `protobuf:"bytes,6,opt,name=reject,proto3,oneof"` -} - -func (*SignalResp_Invite) isSignalResp_Payload() {} - -func (*SignalResp_InviteInGroup) isSignalResp_Payload() {} - -func (*SignalResp_Cancel) isSignalResp_Payload() {} - -func (*SignalResp_Accept) isSignalResp_Payload() {} - -func (*SignalResp_HungUp) isSignalResp_Payload() {} - -func (*SignalResp_Reject) isSignalResp_Payload() {} - -type InvitationInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - InviterUserID string `protobuf:"bytes,1,opt,name=inviterUserID,proto3" json:"inviterUserID,omitempty"` - InviteeUserIDList []string `protobuf:"bytes,2,rep,name=inviteeUserIDList,proto3" json:"inviteeUserIDList,omitempty"` - CustomData string `protobuf:"bytes,3,opt,name=customData,proto3" json:"customData,omitempty"` - GroupID string `protobuf:"bytes,4,opt,name=groupID,proto3" json:"groupID,omitempty"` - RoomID string `protobuf:"bytes,5,opt,name=roomID,proto3" json:"roomID,omitempty"` - Timeout int32 `protobuf:"varint,6,opt,name=timeout,proto3" json:"timeout,omitempty"` - MediaType string `protobuf:"bytes,7,opt,name=mediaType,proto3" json:"mediaType,omitempty"` - PlatformID int32 `protobuf:"varint,8,opt,name=platformID,proto3" json:"platformID,omitempty"` - SessionType int32 `protobuf:"varint,9,opt,name=sessionType,proto3" json:"sessionType,omitempty"` -} - -func (x *InvitationInfo) Reset() { - *x = InvitationInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InvitationInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InvitationInfo) ProtoMessage() {} - -func (x *InvitationInfo) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InvitationInfo.ProtoReflect.Descriptor instead. -func (*InvitationInfo) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{11} -} - -func (x *InvitationInfo) GetInviterUserID() string { - if x != nil { - return x.InviterUserID - } - return "" -} - -func (x *InvitationInfo) GetInviteeUserIDList() []string { - if x != nil { - return x.InviteeUserIDList - } - return nil -} - -func (x *InvitationInfo) GetCustomData() string { - if x != nil { - return x.CustomData - } - return "" -} - -func (x *InvitationInfo) GetGroupID() string { - if x != nil { - return x.GroupID - } - return "" -} - -func (x *InvitationInfo) GetRoomID() string { - if x != nil { - return x.RoomID - } - return "" -} - -func (x *InvitationInfo) GetTimeout() int32 { - if x != nil { - return x.Timeout - } - return 0 -} - -func (x *InvitationInfo) GetMediaType() string { - if x != nil { - return x.MediaType - } - return "" -} - -func (x *InvitationInfo) GetPlatformID() int32 { - if x != nil { - return x.PlatformID - } - return 0 -} - -func (x *InvitationInfo) GetSessionType() int32 { - if x != nil { - return x.SessionType - } - return 0 -} - -type SignalInviteReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OpUserID string `protobuf:"bytes,1,opt,name=opUserID,proto3" json:"opUserID,omitempty"` - Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation,proto3" json:"invitation,omitempty"` - OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo,proto3" json:"offlinePushInfo,omitempty"` - Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant,proto3" json:"participant,omitempty"` -} - -func (x *SignalInviteReq) Reset() { - *x = SignalInviteReq{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalInviteReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalInviteReq) ProtoMessage() {} - -func (x *SignalInviteReq) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalInviteReq.ProtoReflect.Descriptor instead. -func (*SignalInviteReq) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{12} -} - -func (x *SignalInviteReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -func (x *SignalInviteReq) GetInvitation() *InvitationInfo { - if x != nil { - return x.Invitation - } - return nil -} - -func (x *SignalInviteReq) GetOfflinePushInfo() *OfflinePushInfo { - if x != nil { - return x.OfflinePushInfo - } - return nil -} - -func (x *SignalInviteReq) GetParticipant() *ParticipantMetaData { - if x != nil { - return x.Participant - } - return nil -} - -type SignalInviteReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` - RoomID string `protobuf:"bytes,2,opt,name=roomID,proto3" json:"roomID,omitempty"` - LiveURL string `protobuf:"bytes,3,opt,name=liveURL,proto3" json:"liveURL,omitempty"` -} - -func (x *SignalInviteReply) Reset() { - *x = SignalInviteReply{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalInviteReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalInviteReply) ProtoMessage() {} - -func (x *SignalInviteReply) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalInviteReply.ProtoReflect.Descriptor instead. -func (*SignalInviteReply) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{13} -} - -func (x *SignalInviteReply) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -func (x *SignalInviteReply) GetRoomID() string { - if x != nil { - return x.RoomID - } - return "" -} - -func (x *SignalInviteReply) GetLiveURL() string { - if x != nil { - return x.LiveURL - } - return "" -} - -type SignalInviteInGroupReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OpUserID string `protobuf:"bytes,1,opt,name=opUserID,proto3" json:"opUserID,omitempty"` - Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation,proto3" json:"invitation,omitempty"` - OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo,proto3" json:"offlinePushInfo,omitempty"` - Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant,proto3" json:"participant,omitempty"` -} - -func (x *SignalInviteInGroupReq) Reset() { - *x = SignalInviteInGroupReq{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalInviteInGroupReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalInviteInGroupReq) ProtoMessage() {} - -func (x *SignalInviteInGroupReq) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalInviteInGroupReq.ProtoReflect.Descriptor instead. -func (*SignalInviteInGroupReq) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{14} -} - -func (x *SignalInviteInGroupReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -func (x *SignalInviteInGroupReq) GetInvitation() *InvitationInfo { - if x != nil { - return x.Invitation - } - return nil -} - -func (x *SignalInviteInGroupReq) GetOfflinePushInfo() *OfflinePushInfo { - if x != nil { - return x.OfflinePushInfo - } - return nil -} - -func (x *SignalInviteInGroupReq) GetParticipant() *ParticipantMetaData { - if x != nil { - return x.Participant - } - return nil -} - -type SignalInviteInGroupReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` - RoomID string `protobuf:"bytes,2,opt,name=roomID,proto3" json:"roomID,omitempty"` - LiveURL string `protobuf:"bytes,3,opt,name=liveURL,proto3" json:"liveURL,omitempty"` -} - -func (x *SignalInviteInGroupReply) Reset() { - *x = SignalInviteInGroupReply{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalInviteInGroupReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalInviteInGroupReply) ProtoMessage() {} - -func (x *SignalInviteInGroupReply) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalInviteInGroupReply.ProtoReflect.Descriptor instead. -func (*SignalInviteInGroupReply) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{15} -} - -func (x *SignalInviteInGroupReply) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -func (x *SignalInviteInGroupReply) GetRoomID() string { - if x != nil { - return x.RoomID - } - return "" -} - -func (x *SignalInviteInGroupReply) GetLiveURL() string { - if x != nil { - return x.LiveURL - } - return "" -} - -type SignalCancelReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OpUserID string `protobuf:"bytes,1,opt,name=opUserID,proto3" json:"opUserID,omitempty"` - Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation,proto3" json:"invitation,omitempty"` - OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo,proto3" json:"offlinePushInfo,omitempty"` - Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant,proto3" json:"participant,omitempty"` -} - -func (x *SignalCancelReq) Reset() { - *x = SignalCancelReq{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalCancelReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalCancelReq) ProtoMessage() {} - -func (x *SignalCancelReq) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalCancelReq.ProtoReflect.Descriptor instead. -func (*SignalCancelReq) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{16} -} - -func (x *SignalCancelReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -func (x *SignalCancelReq) GetInvitation() *InvitationInfo { - if x != nil { - return x.Invitation - } - return nil -} - -func (x *SignalCancelReq) GetOfflinePushInfo() *OfflinePushInfo { - if x != nil { - return x.OfflinePushInfo - } - return nil -} - -func (x *SignalCancelReq) GetParticipant() *ParticipantMetaData { - if x != nil { - return x.Participant - } - return nil -} - -type SignalCancelReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *SignalCancelReply) Reset() { - *x = SignalCancelReply{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalCancelReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalCancelReply) ProtoMessage() {} - -func (x *SignalCancelReply) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalCancelReply.ProtoReflect.Descriptor instead. -func (*SignalCancelReply) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{17} -} - -type SignalAcceptReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OpUserID string `protobuf:"bytes,1,opt,name=opUserID,proto3" json:"opUserID,omitempty"` - Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation,proto3" json:"invitation,omitempty"` - OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo,proto3" json:"offlinePushInfo,omitempty"` - Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant,proto3" json:"participant,omitempty"` - OpUserPlatformID int32 `protobuf:"varint,5,opt,name=opUserPlatformID,proto3" json:"opUserPlatformID,omitempty"` -} - -func (x *SignalAcceptReq) Reset() { - *x = SignalAcceptReq{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalAcceptReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalAcceptReq) ProtoMessage() {} - -func (x *SignalAcceptReq) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalAcceptReq.ProtoReflect.Descriptor instead. -func (*SignalAcceptReq) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{18} -} - -func (x *SignalAcceptReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -func (x *SignalAcceptReq) GetInvitation() *InvitationInfo { - if x != nil { - return x.Invitation - } - return nil -} - -func (x *SignalAcceptReq) GetOfflinePushInfo() *OfflinePushInfo { - if x != nil { - return x.OfflinePushInfo - } - return nil -} - -func (x *SignalAcceptReq) GetParticipant() *ParticipantMetaData { - if x != nil { - return x.Participant - } - return nil -} - -func (x *SignalAcceptReq) GetOpUserPlatformID() int32 { - if x != nil { - return x.OpUserPlatformID - } - return 0 -} - -type SignalAcceptReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` - RoomID string `protobuf:"bytes,2,opt,name=roomID,proto3" json:"roomID,omitempty"` - LiveURL string `protobuf:"bytes,3,opt,name=liveURL,proto3" json:"liveURL,omitempty"` -} - -func (x *SignalAcceptReply) Reset() { - *x = SignalAcceptReply{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalAcceptReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalAcceptReply) ProtoMessage() {} - -func (x *SignalAcceptReply) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalAcceptReply.ProtoReflect.Descriptor instead. -func (*SignalAcceptReply) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{19} -} - -func (x *SignalAcceptReply) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -func (x *SignalAcceptReply) GetRoomID() string { - if x != nil { - return x.RoomID - } - return "" -} - -func (x *SignalAcceptReply) GetLiveURL() string { - if x != nil { - return x.LiveURL - } - return "" -} - -type SignalHungUpReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OpUserID string `protobuf:"bytes,1,opt,name=opUserID,proto3" json:"opUserID,omitempty"` - Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation,proto3" json:"invitation,omitempty"` - OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo,proto3" json:"offlinePushInfo,omitempty"` -} - -func (x *SignalHungUpReq) Reset() { - *x = SignalHungUpReq{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalHungUpReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalHungUpReq) ProtoMessage() {} - -func (x *SignalHungUpReq) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalHungUpReq.ProtoReflect.Descriptor instead. -func (*SignalHungUpReq) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{20} -} - -func (x *SignalHungUpReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -func (x *SignalHungUpReq) GetInvitation() *InvitationInfo { - if x != nil { - return x.Invitation - } - return nil -} - -func (x *SignalHungUpReq) GetOfflinePushInfo() *OfflinePushInfo { - if x != nil { - return x.OfflinePushInfo - } - return nil -} - -type SignalHungUpReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *SignalHungUpReply) Reset() { - *x = SignalHungUpReply{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalHungUpReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalHungUpReply) ProtoMessage() {} - -func (x *SignalHungUpReply) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalHungUpReply.ProtoReflect.Descriptor instead. -func (*SignalHungUpReply) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{21} -} - -type SignalRejectReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OpUserID string `protobuf:"bytes,1,opt,name=opUserID,proto3" json:"opUserID,omitempty"` - Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation,proto3" json:"invitation,omitempty"` - OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo,proto3" json:"offlinePushInfo,omitempty"` - Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant,proto3" json:"participant,omitempty"` - OpUserPlatformID int32 `protobuf:"varint,5,opt,name=opUserPlatformID,proto3" json:"opUserPlatformID,omitempty"` -} - -func (x *SignalRejectReq) Reset() { - *x = SignalRejectReq{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalRejectReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalRejectReq) ProtoMessage() {} - -func (x *SignalRejectReq) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalRejectReq.ProtoReflect.Descriptor instead. -func (*SignalRejectReq) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{22} -} - -func (x *SignalRejectReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -func (x *SignalRejectReq) GetInvitation() *InvitationInfo { - if x != nil { - return x.Invitation - } - return nil -} - -func (x *SignalRejectReq) GetOfflinePushInfo() *OfflinePushInfo { - if x != nil { - return x.OfflinePushInfo - } - return nil -} - -func (x *SignalRejectReq) GetParticipant() *ParticipantMetaData { - if x != nil { - return x.Participant - } - return nil -} - -func (x *SignalRejectReq) GetOpUserPlatformID() int32 { - if x != nil { - return x.OpUserPlatformID - } - return 0 -} - -type SignalRejectReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *SignalRejectReply) Reset() { - *x = SignalRejectReply{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalRejectReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalRejectReply) ProtoMessage() {} - -func (x *SignalRejectReply) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalRejectReply.ProtoReflect.Descriptor instead. -func (*SignalRejectReply) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{23} -} - -type SignalMessageAssembleReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SignalReq *SignalReq `protobuf:"bytes,1,opt,name=signalReq,proto3" json:"signalReq,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` -} - -func (x *SignalMessageAssembleReq) Reset() { - *x = SignalMessageAssembleReq{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalMessageAssembleReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalMessageAssembleReq) ProtoMessage() {} - -func (x *SignalMessageAssembleReq) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalMessageAssembleReq.ProtoReflect.Descriptor instead. -func (*SignalMessageAssembleReq) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{24} -} - -func (x *SignalMessageAssembleReq) GetSignalReq() *SignalReq { - if x != nil { - return x.SignalReq - } - return nil -} - -func (x *SignalMessageAssembleReq) GetOperationID() string { - if x != nil { - return x.OperationID - } - return "" -} - -type SignalMessageAssembleResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp,proto3" json:"commonResp,omitempty"` - IsPass bool `protobuf:"varint,2,opt,name=isPass,proto3" json:"isPass,omitempty"` - SignalResp *SignalResp `protobuf:"bytes,3,opt,name=signalResp,proto3" json:"signalResp,omitempty"` - MsgData *MsgData `protobuf:"bytes,4,opt,name=msgData,proto3" json:"msgData,omitempty"` -} - -func (x *SignalMessageAssembleResp) Reset() { - *x = SignalMessageAssembleResp{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_rtc_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalMessageAssembleResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalMessageAssembleResp) ProtoMessage() {} - -func (x *SignalMessageAssembleResp) ProtoReflect() protoreflect.Message { - mi := &file_proto_rtc_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalMessageAssembleResp.ProtoReflect.Descriptor instead. -func (*SignalMessageAssembleResp) Descriptor() ([]byte, []int) { - return file_proto_rtc_proto_rawDescGZIP(), []int{25} -} - -func (x *SignalMessageAssembleResp) GetCommonResp() *CommonResp { - if x != nil { - return x.CommonResp - } - return nil -} - -func (x *SignalMessageAssembleResp) GetIsPass() bool { - if x != nil { - return x.IsPass - } - return false -} - -func (x *SignalMessageAssembleResp) GetSignalResp() *SignalResp { - if x != nil { - return x.SignalResp - } - return nil -} - -func (x *SignalMessageAssembleResp) GetMsgData() *MsgData { - if x != nil { - return x.MsgData - } - return nil -} - -var File_proto_rtc_proto protoreflect.FileDescriptor - -var file_proto_rtc_proto_rawDesc = []byte{ - 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x74, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3e, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0xa4, 0x05, 0x0a, 0x07, 0x4d, 0x73, 0x67, - 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x44, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, - 0x72, 0x65, 0x63, 0x76, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, - 0x63, 0x76, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x20, - 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, - 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x73, 0x67, - 0x49, 0x44, 0x12, 0x2a, 0x0a, 0x10, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x73, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x44, 0x12, 0x26, - 0x0a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4e, 0x69, - 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x46, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x46, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x12, 0x20, 0x0a, 0x0b, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x46, 0x72, 0x6f, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x07, 0x6d, 0x73, 0x67, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x0e, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x03, 0x73, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, - 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x11, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x35, 0x0a, 0x07, 0x6f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x40, 0x0a, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, - 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, - 0x6e, 0x66, 0x6f, 0x1a, 0x3a, 0x0a, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0xf5, 0x02, 0x0a, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, - 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x6f, 0x74, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x74, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0c, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, - 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, - 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x65, - 0x78, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x65, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x44, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x54, 0x79, 0x70, 0x65, 0x22, 0xb7, 0x02, 0x0a, 0x13, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, - 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, - 0x1a, 0x0a, 0x08, 0x6a, 0x6f, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x6a, 0x6f, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, - 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, - 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, - 0x52, 0x4c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, - 0x4c, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x70, 0x70, 0x4d, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x4c, 0x65, - 0x76, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x61, 0x70, 0x70, 0x4d, 0x61, - 0x6e, 0x67, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x6a, 0x6f, 0x69, - 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6a, - 0x6f, 0x69, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x44, 0x12, 0x0e, 0x0a, 0x02, 0x65, 0x78, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x65, - 0x78, 0x22, 0xbe, 0x01, 0x0a, 0x13, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, - 0x74, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2e, 0x0a, 0x09, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x44, 0x0a, 0x0f, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0f, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x31, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e, - 0x66, 0x6f, 0x22, 0x86, 0x01, 0x0a, 0x0e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x55, 0x73, 0x65, - 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1a, 0x0a, - 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, - 0x65, 0x55, 0x52, 0x4c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, - 0x55, 0x52, 0x4c, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x65, - 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x65, 0x78, 0x22, 0x9b, 0x01, 0x0a, 0x0f, - 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, - 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, - 0x6f, 0x6f, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, - 0x36, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, - 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, - 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x71, 0x0a, 0x10, 0x47, 0x65, 0x74, - 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, - 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x10, 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6a, - 0x77, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x55, 0x52, 0x4c, 0x22, 0x95, 0x01, 0x0a, - 0x0f, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, - 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x0e, 0x0a, 0x02, 0x65, 0x78, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x65, 0x78, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x4f, - 0x53, 0x50, 0x75, 0x73, 0x68, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x69, 0x4f, 0x53, 0x50, 0x75, 0x73, 0x68, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x24, - 0x0a, 0x0d, 0x69, 0x4f, 0x53, 0x42, 0x61, 0x64, 0x67, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x4f, 0x53, 0x42, 0x61, 0x64, 0x67, 0x65, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xd7, 0x02, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, - 0x65, 0x71, 0x12, 0x30, 0x0a, 0x06, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, - 0x76, 0x69, 0x74, 0x65, 0x12, 0x45, 0x0a, 0x0d, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x49, 0x6e, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, - 0x49, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x0d, 0x69, 0x6e, - 0x76, 0x69, 0x74, 0x65, 0x49, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x30, 0x0a, 0x06, 0x63, - 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, - 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x12, 0x30, 0x0a, - 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x41, 0x63, 0x63, 0x65, - 0x70, 0x74, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x12, - 0x30, 0x0a, 0x06, 0x68, 0x75, 0x6e, 0x67, 0x55, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x48, 0x75, - 0x6e, 0x67, 0x55, 0x70, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x06, 0x68, 0x75, 0x6e, 0x67, 0x55, - 0x70, 0x12, 0x30, 0x0a, 0x06, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, - 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x6a, - 0x65, 0x63, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xe4, - 0x02, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, - 0x06, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x69, - 0x74, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, 0x76, 0x69, 0x74, - 0x65, 0x12, 0x47, 0x0a, 0x0d, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x49, 0x6e, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x49, 0x6e, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x0d, 0x69, 0x6e, 0x76, - 0x69, 0x74, 0x65, 0x49, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x32, 0x0a, 0x06, 0x63, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, - 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x12, 0x32, - 0x0a, 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x41, 0x63, 0x63, - 0x65, 0x70, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x06, 0x61, 0x63, 0x63, 0x65, - 0x70, 0x74, 0x12, 0x32, 0x0a, 0x06, 0x68, 0x75, 0x6e, 0x67, 0x55, 0x70, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x6c, 0x48, 0x75, 0x6e, 0x67, 0x55, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x06, - 0x68, 0x75, 0x6e, 0x67, 0x55, 0x70, 0x12, 0x32, 0x0a, 0x06, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, - 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xb0, 0x02, 0x0a, 0x0e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x0a, 0x0d, 0x69, 0x6e, 0x76, 0x69, - 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x2c, - 0x0a, 0x11, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x4c, - 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x69, 0x6e, 0x76, 0x69, 0x74, - 0x65, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x44, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x44, 0x12, 0x18, - 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x64, 0x69, - 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x64, - 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x49, 0x44, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0xe4, 0x01, 0x0a, 0x0f, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, - 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x35, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x40, 0x0a, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, - 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, - 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x22, - 0x5b, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, - 0x65, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, - 0x6f, 0x6d, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, - 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x55, 0x52, 0x4c, 0x22, 0xeb, 0x01, 0x0a, - 0x16, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x49, 0x6e, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, - 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, - 0x72, 0x49, 0x44, 0x12, 0x35, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, - 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6f, 0x66, - 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4f, 0x66, 0x66, 0x6c, - 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0f, 0x6f, 0x66, 0x66, - 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3c, 0x0a, 0x0b, - 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, - 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x70, - 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x22, 0x62, 0x0a, 0x18, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x49, 0x6e, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, - 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, - 0x6f, 0x6d, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x55, 0x52, 0x4c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x55, 0x52, 0x4c, 0x22, 0xe4, - 0x01, 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, - 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x35, - 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, - 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, - 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, - 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, - 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, - 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, - 0x69, 0x70, 0x61, 0x6e, 0x74, 0x22, 0x13, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x43, - 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x90, 0x02, 0x0a, 0x0f, 0x53, - 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1a, - 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x35, 0x0a, 0x0a, 0x69, 0x6e, - 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, - 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, - 0x6e, 0x66, 0x6f, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, - 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, - 0x44, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, - 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x6f, 0x70, 0x55, - 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x44, 0x22, 0x5b, 0x0a, - 0x11, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x70, - 0x6c, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x6f, 0x6d, - 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x44, - 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x55, 0x52, 0x4c, 0x22, 0xa6, 0x01, 0x0a, 0x0f, 0x53, - 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x48, 0x75, 0x6e, 0x67, 0x55, 0x70, 0x52, 0x65, 0x71, 0x12, 0x1a, - 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x35, 0x0a, 0x0a, 0x69, 0x6e, - 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, - 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, - 0x6e, 0x66, 0x6f, 0x22, 0x13, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x48, 0x75, 0x6e, - 0x67, 0x55, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x90, 0x02, 0x0a, 0x0f, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, - 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x35, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x40, 0x0a, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, - 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, - 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, - 0x2a, 0x0a, 0x10, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x6f, 0x70, 0x55, 0x73, 0x65, - 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x44, 0x22, 0x13, 0x0a, 0x11, 0x53, - 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x22, 0x6c, 0x0a, 0x18, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x2e, 0x0a, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, - 0x71, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, - 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0xc3, - 0x01, 0x0a, 0x19, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, 0x0a, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x16, 0x0a, 0x06, 0x69, 0x73, 0x50, 0x61, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x06, 0x69, 0x73, 0x50, 0x61, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x6c, 0x52, 0x65, 0x73, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28, 0x0a, 0x07, 0x6d, 0x73, - 0x67, 0x44, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x73, 0x67, - 0x44, 0x61, 0x74, 0x61, 0x32, 0x68, 0x0a, 0x0a, 0x52, 0x74, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x5a, 0x0a, 0x15, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x12, 0x1f, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0b, - 0x5a, 0x09, 0x2e, 0x2f, 0x72, 0x74, 0x63, 0x3b, 0x72, 0x74, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_proto_rtc_proto_rawDescOnce sync.Once - file_proto_rtc_proto_rawDescData = file_proto_rtc_proto_rawDesc -) - -func file_proto_rtc_proto_rawDescGZIP() []byte { - file_proto_rtc_proto_rawDescOnce.Do(func() { - file_proto_rtc_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_rtc_proto_rawDescData) - }) - return file_proto_rtc_proto_rawDescData -} - -var file_proto_rtc_proto_msgTypes = make([]protoimpl.MessageInfo, 27) -var file_proto_rtc_proto_goTypes = []interface{}{ - (*CommonResp)(nil), // 0: proto.CommonResp - (*MsgData)(nil), // 1: proto.MsgData - (*GroupInfo)(nil), // 2: proto.GroupInfo - (*GroupMemberFullInfo)(nil), // 3: proto.GroupMemberFullInfo - (*ParticipantMetaData)(nil), // 4: proto.ParticipantMetaData - (*PublicUserInfo)(nil), // 5: proto.PublicUserInfo - (*GetJoinTokenReq)(nil), // 6: proto.GetJoinTokenReq - (*GetJoinTokenResp)(nil), // 7: proto.GetJoinTokenResp - (*OfflinePushInfo)(nil), // 8: proto.OfflinePushInfo - (*SignalReq)(nil), // 9: proto.SignalReq - (*SignalResp)(nil), // 10: proto.SignalResp - (*InvitationInfo)(nil), // 11: proto.InvitationInfo - (*SignalInviteReq)(nil), // 12: proto.SignalInviteReq - (*SignalInviteReply)(nil), // 13: proto.SignalInviteReply - (*SignalInviteInGroupReq)(nil), // 14: proto.SignalInviteInGroupReq - (*SignalInviteInGroupReply)(nil), // 15: proto.SignalInviteInGroupReply - (*SignalCancelReq)(nil), // 16: proto.SignalCancelReq - (*SignalCancelReply)(nil), // 17: proto.SignalCancelReply - (*SignalAcceptReq)(nil), // 18: proto.SignalAcceptReq - (*SignalAcceptReply)(nil), // 19: proto.SignalAcceptReply - (*SignalHungUpReq)(nil), // 20: proto.SignalHungUpReq - (*SignalHungUpReply)(nil), // 21: proto.SignalHungUpReply - (*SignalRejectReq)(nil), // 22: proto.SignalRejectReq - (*SignalRejectReply)(nil), // 23: proto.SignalRejectReply - (*SignalMessageAssembleReq)(nil), // 24: proto.SignalMessageAssembleReq - (*SignalMessageAssembleResp)(nil), // 25: proto.SignalMessageAssembleResp - nil, // 26: proto.MsgData.OptionsEntry -} -var file_proto_rtc_proto_depIdxs = []int32{ - 26, // 0: proto.MsgData.options:type_name -> proto.MsgData.OptionsEntry - 8, // 1: proto.MsgData.offlinePushInfo:type_name -> proto.OfflinePushInfo - 2, // 2: proto.ParticipantMetaData.groupInfo:type_name -> proto.GroupInfo - 3, // 3: proto.ParticipantMetaData.groupMemberInfo:type_name -> proto.GroupMemberFullInfo - 5, // 4: proto.ParticipantMetaData.userInfo:type_name -> proto.PublicUserInfo - 4, // 5: proto.GetJoinTokenReq.metaData:type_name -> proto.ParticipantMetaData - 0, // 6: proto.GetJoinTokenResp.CommonResp:type_name -> proto.CommonResp - 12, // 7: proto.SignalReq.invite:type_name -> proto.SignalInviteReq - 14, // 8: proto.SignalReq.inviteInGroup:type_name -> proto.SignalInviteInGroupReq - 16, // 9: proto.SignalReq.cancel:type_name -> proto.SignalCancelReq - 18, // 10: proto.SignalReq.accept:type_name -> proto.SignalAcceptReq - 20, // 11: proto.SignalReq.hungUp:type_name -> proto.SignalHungUpReq - 22, // 12: proto.SignalReq.reject:type_name -> proto.SignalRejectReq - 13, // 13: proto.SignalResp.invite:type_name -> proto.SignalInviteReply - 15, // 14: proto.SignalResp.inviteInGroup:type_name -> proto.SignalInviteInGroupReply - 17, // 15: proto.SignalResp.cancel:type_name -> proto.SignalCancelReply - 19, // 16: proto.SignalResp.accept:type_name -> proto.SignalAcceptReply - 21, // 17: proto.SignalResp.hungUp:type_name -> proto.SignalHungUpReply - 23, // 18: proto.SignalResp.reject:type_name -> proto.SignalRejectReply - 11, // 19: proto.SignalInviteReq.invitation:type_name -> proto.InvitationInfo - 8, // 20: proto.SignalInviteReq.offlinePushInfo:type_name -> proto.OfflinePushInfo - 4, // 21: proto.SignalInviteReq.participant:type_name -> proto.ParticipantMetaData - 11, // 22: proto.SignalInviteInGroupReq.invitation:type_name -> proto.InvitationInfo - 8, // 23: proto.SignalInviteInGroupReq.offlinePushInfo:type_name -> proto.OfflinePushInfo - 4, // 24: proto.SignalInviteInGroupReq.participant:type_name -> proto.ParticipantMetaData - 11, // 25: proto.SignalCancelReq.invitation:type_name -> proto.InvitationInfo - 8, // 26: proto.SignalCancelReq.offlinePushInfo:type_name -> proto.OfflinePushInfo - 4, // 27: proto.SignalCancelReq.participant:type_name -> proto.ParticipantMetaData - 11, // 28: proto.SignalAcceptReq.invitation:type_name -> proto.InvitationInfo - 8, // 29: proto.SignalAcceptReq.offlinePushInfo:type_name -> proto.OfflinePushInfo - 4, // 30: proto.SignalAcceptReq.participant:type_name -> proto.ParticipantMetaData - 11, // 31: proto.SignalHungUpReq.invitation:type_name -> proto.InvitationInfo - 8, // 32: proto.SignalHungUpReq.offlinePushInfo:type_name -> proto.OfflinePushInfo - 11, // 33: proto.SignalRejectReq.invitation:type_name -> proto.InvitationInfo - 8, // 34: proto.SignalRejectReq.offlinePushInfo:type_name -> proto.OfflinePushInfo - 4, // 35: proto.SignalRejectReq.participant:type_name -> proto.ParticipantMetaData - 9, // 36: proto.SignalMessageAssembleReq.signalReq:type_name -> proto.SignalReq - 0, // 37: proto.SignalMessageAssembleResp.commonResp:type_name -> proto.CommonResp - 10, // 38: proto.SignalMessageAssembleResp.signalResp:type_name -> proto.SignalResp - 1, // 39: proto.SignalMessageAssembleResp.msgData:type_name -> proto.MsgData - 24, // 40: proto.RtcService.SignalMessageAssemble:input_type -> proto.SignalMessageAssembleReq - 25, // 41: proto.RtcService.SignalMessageAssemble:output_type -> proto.SignalMessageAssembleResp - 41, // [41:42] is the sub-list for method output_type - 40, // [40:41] is the sub-list for method input_type - 40, // [40:40] is the sub-list for extension type_name - 40, // [40:40] is the sub-list for extension extendee - 0, // [0:40] is the sub-list for field type_name -} - -func init() { file_proto_rtc_proto_init() } -func file_proto_rtc_proto_init() { - if File_proto_rtc_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proto_rtc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommonResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GroupInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GroupMemberFullInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParticipantMetaData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PublicUserInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetJoinTokenReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetJoinTokenResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OfflinePushInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvitationInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalInviteReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalInviteReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalInviteInGroupReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalInviteInGroupReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalCancelReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalCancelReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalAcceptReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalAcceptReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalHungUpReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalHungUpReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalRejectReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalRejectReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalMessageAssembleReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_rtc_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalMessageAssembleResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_proto_rtc_proto_msgTypes[9].OneofWrappers = []interface{}{ - (*SignalReq_Invite)(nil), - (*SignalReq_InviteInGroup)(nil), - (*SignalReq_Cancel)(nil), - (*SignalReq_Accept)(nil), - (*SignalReq_HungUp)(nil), - (*SignalReq_Reject)(nil), - } - file_proto_rtc_proto_msgTypes[10].OneofWrappers = []interface{}{ +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SignalResp) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SignalResp_OneofMarshaler, _SignalResp_OneofUnmarshaler, _SignalResp_OneofSizer, []interface{}{ (*SignalResp_Invite)(nil), (*SignalResp_InviteInGroup)(nil), (*SignalResp_Cancel)(nil), @@ -2889,71 +1183,1063 @@ func file_proto_rtc_proto_init() { (*SignalResp_HungUp)(nil), (*SignalResp_Reject)(nil), } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proto_rtc_proto_rawDesc, - NumEnums: 0, - NumMessages: 27, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_proto_rtc_proto_goTypes, - DependencyIndexes: file_proto_rtc_proto_depIdxs, - MessageInfos: file_proto_rtc_proto_msgTypes, - }.Build() - File_proto_rtc_proto = out.File - file_proto_rtc_proto_rawDesc = nil - file_proto_rtc_proto_goTypes = nil - file_proto_rtc_proto_depIdxs = nil +} + +func _SignalResp_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SignalResp) + // payload + switch x := m.Payload.(type) { + case *SignalResp_Invite: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Invite); err != nil { + return err + } + case *SignalResp_InviteInGroup: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.InviteInGroup); err != nil { + return err + } + case *SignalResp_Cancel: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Cancel); err != nil { + return err + } + case *SignalResp_Accept: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Accept); err != nil { + return err + } + case *SignalResp_HungUp: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.HungUp); err != nil { + return err + } + case *SignalResp_Reject: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Reject); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("SignalResp.Payload has unexpected type %T", x) + } + return nil +} + +func _SignalResp_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SignalResp) + switch tag { + case 1: // payload.invite + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalInviteReply) + err := b.DecodeMessage(msg) + m.Payload = &SignalResp_Invite{msg} + return true, err + case 2: // payload.inviteInGroup + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalInviteInGroupReply) + err := b.DecodeMessage(msg) + m.Payload = &SignalResp_InviteInGroup{msg} + return true, err + case 3: // payload.cancel + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalCancelReply) + err := b.DecodeMessage(msg) + m.Payload = &SignalResp_Cancel{msg} + return true, err + case 4: // payload.accept + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalAcceptReply) + err := b.DecodeMessage(msg) + m.Payload = &SignalResp_Accept{msg} + return true, err + case 5: // payload.hungUp + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalHungUpReply) + err := b.DecodeMessage(msg) + m.Payload = &SignalResp_HungUp{msg} + return true, err + case 6: // payload.reject + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalRejectReply) + err := b.DecodeMessage(msg) + m.Payload = &SignalResp_Reject{msg} + return true, err + default: + return false, nil + } +} + +func _SignalResp_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SignalResp) + // payload + switch x := m.Payload.(type) { + case *SignalResp_Invite: + s := proto.Size(x.Invite) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalResp_InviteInGroup: + s := proto.Size(x.InviteInGroup) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalResp_Cancel: + s := proto.Size(x.Cancel) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalResp_Accept: + s := proto.Size(x.Accept) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalResp_HungUp: + s := proto.Size(x.HungUp) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalResp_Reject: + s := proto.Size(x.Reject) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type InvitationInfo struct { + InviterUserID string `protobuf:"bytes,1,opt,name=inviterUserID" json:"inviterUserID,omitempty"` + InviteeUserIDList []string `protobuf:"bytes,2,rep,name=inviteeUserIDList" json:"inviteeUserIDList,omitempty"` + CustomData string `protobuf:"bytes,3,opt,name=customData" json:"customData,omitempty"` + GroupID string `protobuf:"bytes,4,opt,name=groupID" json:"groupID,omitempty"` + RoomID string `protobuf:"bytes,5,opt,name=roomID" json:"roomID,omitempty"` + Timeout int32 `protobuf:"varint,6,opt,name=timeout" json:"timeout,omitempty"` + MediaType string `protobuf:"bytes,7,opt,name=mediaType" json:"mediaType,omitempty"` + PlatformID int32 `protobuf:"varint,8,opt,name=platformID" json:"platformID,omitempty"` + SessionType int32 `protobuf:"varint,9,opt,name=sessionType" json:"sessionType,omitempty"` + InitiateTime int32 `protobuf:"varint,10,opt,name=initiateTime" json:"initiateTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InvitationInfo) Reset() { *m = InvitationInfo{} } +func (m *InvitationInfo) String() string { return proto.CompactTextString(m) } +func (*InvitationInfo) ProtoMessage() {} +func (*InvitationInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_2059f33abbeeea7e, []int{11} +} +func (m *InvitationInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_InvitationInfo.Unmarshal(m, b) +} +func (m *InvitationInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_InvitationInfo.Marshal(b, m, deterministic) +} +func (dst *InvitationInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_InvitationInfo.Merge(dst, src) +} +func (m *InvitationInfo) XXX_Size() int { + return xxx_messageInfo_InvitationInfo.Size(m) +} +func (m *InvitationInfo) XXX_DiscardUnknown() { + xxx_messageInfo_InvitationInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_InvitationInfo proto.InternalMessageInfo + +func (m *InvitationInfo) GetInviterUserID() string { + if m != nil { + return m.InviterUserID + } + return "" +} + +func (m *InvitationInfo) GetInviteeUserIDList() []string { + if m != nil { + return m.InviteeUserIDList + } + return nil +} + +func (m *InvitationInfo) GetCustomData() string { + if m != nil { + return m.CustomData + } + return "" +} + +func (m *InvitationInfo) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *InvitationInfo) GetRoomID() string { + if m != nil { + return m.RoomID + } + return "" +} + +func (m *InvitationInfo) GetTimeout() int32 { + if m != nil { + return m.Timeout + } + return 0 +} + +func (m *InvitationInfo) GetMediaType() string { + if m != nil { + return m.MediaType + } + return "" +} + +func (m *InvitationInfo) GetPlatformID() int32 { + if m != nil { + return m.PlatformID + } + return 0 +} + +func (m *InvitationInfo) GetSessionType() int32 { + if m != nil { + return m.SessionType + } + return 0 +} + +func (m *InvitationInfo) GetInitiateTime() int32 { + if m != nil { + return m.InitiateTime + } + return 0 +} + +type SignalInviteReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"` + Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant" json:"participant,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalInviteReq) Reset() { *m = SignalInviteReq{} } +func (m *SignalInviteReq) String() string { return proto.CompactTextString(m) } +func (*SignalInviteReq) ProtoMessage() {} +func (*SignalInviteReq) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_2059f33abbeeea7e, []int{12} +} +func (m *SignalInviteReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalInviteReq.Unmarshal(m, b) +} +func (m *SignalInviteReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalInviteReq.Marshal(b, m, deterministic) +} +func (dst *SignalInviteReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalInviteReq.Merge(dst, src) +} +func (m *SignalInviteReq) XXX_Size() int { + return xxx_messageInfo_SignalInviteReq.Size(m) +} +func (m *SignalInviteReq) XXX_DiscardUnknown() { + xxx_messageInfo_SignalInviteReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalInviteReq proto.InternalMessageInfo + +func (m *SignalInviteReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *SignalInviteReq) GetInvitation() *InvitationInfo { + if m != nil { + return m.Invitation + } + return nil +} + +func (m *SignalInviteReq) GetOfflinePushInfo() *OfflinePushInfo { + if m != nil { + return m.OfflinePushInfo + } + return nil +} + +func (m *SignalInviteReq) GetParticipant() *ParticipantMetaData { + if m != nil { + return m.Participant + } + return nil +} + +type SignalInviteReply struct { + Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` + RoomID string `protobuf:"bytes,2,opt,name=roomID" json:"roomID,omitempty"` + LiveURL string `protobuf:"bytes,3,opt,name=liveURL" json:"liveURL,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalInviteReply) Reset() { *m = SignalInviteReply{} } +func (m *SignalInviteReply) String() string { return proto.CompactTextString(m) } +func (*SignalInviteReply) ProtoMessage() {} +func (*SignalInviteReply) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_2059f33abbeeea7e, []int{13} +} +func (m *SignalInviteReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalInviteReply.Unmarshal(m, b) +} +func (m *SignalInviteReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalInviteReply.Marshal(b, m, deterministic) +} +func (dst *SignalInviteReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalInviteReply.Merge(dst, src) +} +func (m *SignalInviteReply) XXX_Size() int { + return xxx_messageInfo_SignalInviteReply.Size(m) +} +func (m *SignalInviteReply) XXX_DiscardUnknown() { + xxx_messageInfo_SignalInviteReply.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalInviteReply proto.InternalMessageInfo + +func (m *SignalInviteReply) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *SignalInviteReply) GetRoomID() string { + if m != nil { + return m.RoomID + } + return "" +} + +func (m *SignalInviteReply) GetLiveURL() string { + if m != nil { + return m.LiveURL + } + return "" +} + +type SignalInviteInGroupReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"` + Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant" json:"participant,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalInviteInGroupReq) Reset() { *m = SignalInviteInGroupReq{} } +func (m *SignalInviteInGroupReq) String() string { return proto.CompactTextString(m) } +func (*SignalInviteInGroupReq) ProtoMessage() {} +func (*SignalInviteInGroupReq) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_2059f33abbeeea7e, []int{14} +} +func (m *SignalInviteInGroupReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalInviteInGroupReq.Unmarshal(m, b) +} +func (m *SignalInviteInGroupReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalInviteInGroupReq.Marshal(b, m, deterministic) +} +func (dst *SignalInviteInGroupReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalInviteInGroupReq.Merge(dst, src) +} +func (m *SignalInviteInGroupReq) XXX_Size() int { + return xxx_messageInfo_SignalInviteInGroupReq.Size(m) +} +func (m *SignalInviteInGroupReq) XXX_DiscardUnknown() { + xxx_messageInfo_SignalInviteInGroupReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalInviteInGroupReq proto.InternalMessageInfo + +func (m *SignalInviteInGroupReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *SignalInviteInGroupReq) GetInvitation() *InvitationInfo { + if m != nil { + return m.Invitation + } + return nil +} + +func (m *SignalInviteInGroupReq) GetOfflinePushInfo() *OfflinePushInfo { + if m != nil { + return m.OfflinePushInfo + } + return nil +} + +func (m *SignalInviteInGroupReq) GetParticipant() *ParticipantMetaData { + if m != nil { + return m.Participant + } + return nil +} + +type SignalInviteInGroupReply struct { + Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` + RoomID string `protobuf:"bytes,2,opt,name=roomID" json:"roomID,omitempty"` + LiveURL string `protobuf:"bytes,3,opt,name=liveURL" json:"liveURL,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalInviteInGroupReply) Reset() { *m = SignalInviteInGroupReply{} } +func (m *SignalInviteInGroupReply) String() string { return proto.CompactTextString(m) } +func (*SignalInviteInGroupReply) ProtoMessage() {} +func (*SignalInviteInGroupReply) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_2059f33abbeeea7e, []int{15} +} +func (m *SignalInviteInGroupReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalInviteInGroupReply.Unmarshal(m, b) +} +func (m *SignalInviteInGroupReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalInviteInGroupReply.Marshal(b, m, deterministic) +} +func (dst *SignalInviteInGroupReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalInviteInGroupReply.Merge(dst, src) +} +func (m *SignalInviteInGroupReply) XXX_Size() int { + return xxx_messageInfo_SignalInviteInGroupReply.Size(m) +} +func (m *SignalInviteInGroupReply) XXX_DiscardUnknown() { + xxx_messageInfo_SignalInviteInGroupReply.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalInviteInGroupReply proto.InternalMessageInfo + +func (m *SignalInviteInGroupReply) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *SignalInviteInGroupReply) GetRoomID() string { + if m != nil { + return m.RoomID + } + return "" +} + +func (m *SignalInviteInGroupReply) GetLiveURL() string { + if m != nil { + return m.LiveURL + } + return "" +} + +type SignalCancelReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"` + Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant" json:"participant,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalCancelReq) Reset() { *m = SignalCancelReq{} } +func (m *SignalCancelReq) String() string { return proto.CompactTextString(m) } +func (*SignalCancelReq) ProtoMessage() {} +func (*SignalCancelReq) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_2059f33abbeeea7e, []int{16} +} +func (m *SignalCancelReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalCancelReq.Unmarshal(m, b) +} +func (m *SignalCancelReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalCancelReq.Marshal(b, m, deterministic) +} +func (dst *SignalCancelReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalCancelReq.Merge(dst, src) +} +func (m *SignalCancelReq) XXX_Size() int { + return xxx_messageInfo_SignalCancelReq.Size(m) +} +func (m *SignalCancelReq) XXX_DiscardUnknown() { + xxx_messageInfo_SignalCancelReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalCancelReq proto.InternalMessageInfo + +func (m *SignalCancelReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *SignalCancelReq) GetInvitation() *InvitationInfo { + if m != nil { + return m.Invitation + } + return nil +} + +func (m *SignalCancelReq) GetOfflinePushInfo() *OfflinePushInfo { + if m != nil { + return m.OfflinePushInfo + } + return nil +} + +func (m *SignalCancelReq) GetParticipant() *ParticipantMetaData { + if m != nil { + return m.Participant + } + return nil +} + +type SignalCancelReply struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalCancelReply) Reset() { *m = SignalCancelReply{} } +func (m *SignalCancelReply) String() string { return proto.CompactTextString(m) } +func (*SignalCancelReply) ProtoMessage() {} +func (*SignalCancelReply) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_2059f33abbeeea7e, []int{17} +} +func (m *SignalCancelReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalCancelReply.Unmarshal(m, b) +} +func (m *SignalCancelReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalCancelReply.Marshal(b, m, deterministic) +} +func (dst *SignalCancelReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalCancelReply.Merge(dst, src) +} +func (m *SignalCancelReply) XXX_Size() int { + return xxx_messageInfo_SignalCancelReply.Size(m) +} +func (m *SignalCancelReply) XXX_DiscardUnknown() { + xxx_messageInfo_SignalCancelReply.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalCancelReply proto.InternalMessageInfo + +type SignalAcceptReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"` + Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant" json:"participant,omitempty"` + OpUserPlatformID int32 `protobuf:"varint,5,opt,name=opUserPlatformID" json:"opUserPlatformID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalAcceptReq) Reset() { *m = SignalAcceptReq{} } +func (m *SignalAcceptReq) String() string { return proto.CompactTextString(m) } +func (*SignalAcceptReq) ProtoMessage() {} +func (*SignalAcceptReq) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_2059f33abbeeea7e, []int{18} +} +func (m *SignalAcceptReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalAcceptReq.Unmarshal(m, b) +} +func (m *SignalAcceptReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalAcceptReq.Marshal(b, m, deterministic) +} +func (dst *SignalAcceptReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalAcceptReq.Merge(dst, src) +} +func (m *SignalAcceptReq) XXX_Size() int { + return xxx_messageInfo_SignalAcceptReq.Size(m) +} +func (m *SignalAcceptReq) XXX_DiscardUnknown() { + xxx_messageInfo_SignalAcceptReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalAcceptReq proto.InternalMessageInfo + +func (m *SignalAcceptReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *SignalAcceptReq) GetInvitation() *InvitationInfo { + if m != nil { + return m.Invitation + } + return nil +} + +func (m *SignalAcceptReq) GetOfflinePushInfo() *OfflinePushInfo { + if m != nil { + return m.OfflinePushInfo + } + return nil +} + +func (m *SignalAcceptReq) GetParticipant() *ParticipantMetaData { + if m != nil { + return m.Participant + } + return nil +} + +func (m *SignalAcceptReq) GetOpUserPlatformID() int32 { + if m != nil { + return m.OpUserPlatformID + } + return 0 +} + +type SignalAcceptReply struct { + Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` + RoomID string `protobuf:"bytes,2,opt,name=roomID" json:"roomID,omitempty"` + LiveURL string `protobuf:"bytes,3,opt,name=liveURL" json:"liveURL,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalAcceptReply) Reset() { *m = SignalAcceptReply{} } +func (m *SignalAcceptReply) String() string { return proto.CompactTextString(m) } +func (*SignalAcceptReply) ProtoMessage() {} +func (*SignalAcceptReply) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_2059f33abbeeea7e, []int{19} +} +func (m *SignalAcceptReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalAcceptReply.Unmarshal(m, b) +} +func (m *SignalAcceptReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalAcceptReply.Marshal(b, m, deterministic) +} +func (dst *SignalAcceptReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalAcceptReply.Merge(dst, src) +} +func (m *SignalAcceptReply) XXX_Size() int { + return xxx_messageInfo_SignalAcceptReply.Size(m) +} +func (m *SignalAcceptReply) XXX_DiscardUnknown() { + xxx_messageInfo_SignalAcceptReply.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalAcceptReply proto.InternalMessageInfo + +func (m *SignalAcceptReply) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *SignalAcceptReply) GetRoomID() string { + if m != nil { + return m.RoomID + } + return "" +} + +func (m *SignalAcceptReply) GetLiveURL() string { + if m != nil { + return m.LiveURL + } + return "" +} + +type SignalHungUpReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalHungUpReq) Reset() { *m = SignalHungUpReq{} } +func (m *SignalHungUpReq) String() string { return proto.CompactTextString(m) } +func (*SignalHungUpReq) ProtoMessage() {} +func (*SignalHungUpReq) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_2059f33abbeeea7e, []int{20} +} +func (m *SignalHungUpReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalHungUpReq.Unmarshal(m, b) +} +func (m *SignalHungUpReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalHungUpReq.Marshal(b, m, deterministic) +} +func (dst *SignalHungUpReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalHungUpReq.Merge(dst, src) +} +func (m *SignalHungUpReq) XXX_Size() int { + return xxx_messageInfo_SignalHungUpReq.Size(m) +} +func (m *SignalHungUpReq) XXX_DiscardUnknown() { + xxx_messageInfo_SignalHungUpReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalHungUpReq proto.InternalMessageInfo + +func (m *SignalHungUpReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *SignalHungUpReq) GetInvitation() *InvitationInfo { + if m != nil { + return m.Invitation + } + return nil +} + +func (m *SignalHungUpReq) GetOfflinePushInfo() *OfflinePushInfo { + if m != nil { + return m.OfflinePushInfo + } + return nil +} + +type SignalHungUpReply struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalHungUpReply) Reset() { *m = SignalHungUpReply{} } +func (m *SignalHungUpReply) String() string { return proto.CompactTextString(m) } +func (*SignalHungUpReply) ProtoMessage() {} +func (*SignalHungUpReply) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_2059f33abbeeea7e, []int{21} +} +func (m *SignalHungUpReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalHungUpReply.Unmarshal(m, b) +} +func (m *SignalHungUpReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalHungUpReply.Marshal(b, m, deterministic) +} +func (dst *SignalHungUpReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalHungUpReply.Merge(dst, src) +} +func (m *SignalHungUpReply) XXX_Size() int { + return xxx_messageInfo_SignalHungUpReply.Size(m) +} +func (m *SignalHungUpReply) XXX_DiscardUnknown() { + xxx_messageInfo_SignalHungUpReply.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalHungUpReply proto.InternalMessageInfo + +type SignalRejectReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"` + Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant" json:"participant,omitempty"` + OpUserPlatformID int32 `protobuf:"varint,5,opt,name=opUserPlatformID" json:"opUserPlatformID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalRejectReq) Reset() { *m = SignalRejectReq{} } +func (m *SignalRejectReq) String() string { return proto.CompactTextString(m) } +func (*SignalRejectReq) ProtoMessage() {} +func (*SignalRejectReq) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_2059f33abbeeea7e, []int{22} +} +func (m *SignalRejectReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalRejectReq.Unmarshal(m, b) +} +func (m *SignalRejectReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalRejectReq.Marshal(b, m, deterministic) +} +func (dst *SignalRejectReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalRejectReq.Merge(dst, src) +} +func (m *SignalRejectReq) XXX_Size() int { + return xxx_messageInfo_SignalRejectReq.Size(m) +} +func (m *SignalRejectReq) XXX_DiscardUnknown() { + xxx_messageInfo_SignalRejectReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalRejectReq proto.InternalMessageInfo + +func (m *SignalRejectReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *SignalRejectReq) GetInvitation() *InvitationInfo { + if m != nil { + return m.Invitation + } + return nil +} + +func (m *SignalRejectReq) GetOfflinePushInfo() *OfflinePushInfo { + if m != nil { + return m.OfflinePushInfo + } + return nil +} + +func (m *SignalRejectReq) GetParticipant() *ParticipantMetaData { + if m != nil { + return m.Participant + } + return nil +} + +func (m *SignalRejectReq) GetOpUserPlatformID() int32 { + if m != nil { + return m.OpUserPlatformID + } + return 0 +} + +type SignalRejectReply struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalRejectReply) Reset() { *m = SignalRejectReply{} } +func (m *SignalRejectReply) String() string { return proto.CompactTextString(m) } +func (*SignalRejectReply) ProtoMessage() {} +func (*SignalRejectReply) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_2059f33abbeeea7e, []int{23} +} +func (m *SignalRejectReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalRejectReply.Unmarshal(m, b) +} +func (m *SignalRejectReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalRejectReply.Marshal(b, m, deterministic) +} +func (dst *SignalRejectReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalRejectReply.Merge(dst, src) +} +func (m *SignalRejectReply) XXX_Size() int { + return xxx_messageInfo_SignalRejectReply.Size(m) +} +func (m *SignalRejectReply) XXX_DiscardUnknown() { + xxx_messageInfo_SignalRejectReply.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalRejectReply proto.InternalMessageInfo + +type SignalMessageAssembleReq struct { + SignalReq *SignalReq `protobuf:"bytes,1,opt,name=signalReq" json:"signalReq,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalMessageAssembleReq) Reset() { *m = SignalMessageAssembleReq{} } +func (m *SignalMessageAssembleReq) String() string { return proto.CompactTextString(m) } +func (*SignalMessageAssembleReq) ProtoMessage() {} +func (*SignalMessageAssembleReq) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_2059f33abbeeea7e, []int{24} +} +func (m *SignalMessageAssembleReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalMessageAssembleReq.Unmarshal(m, b) +} +func (m *SignalMessageAssembleReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalMessageAssembleReq.Marshal(b, m, deterministic) +} +func (dst *SignalMessageAssembleReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalMessageAssembleReq.Merge(dst, src) +} +func (m *SignalMessageAssembleReq) XXX_Size() int { + return xxx_messageInfo_SignalMessageAssembleReq.Size(m) +} +func (m *SignalMessageAssembleReq) XXX_DiscardUnknown() { + xxx_messageInfo_SignalMessageAssembleReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalMessageAssembleReq proto.InternalMessageInfo + +func (m *SignalMessageAssembleReq) GetSignalReq() *SignalReq { + if m != nil { + return m.SignalReq + } + return nil +} + +func (m *SignalMessageAssembleReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type SignalMessageAssembleResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + IsPass bool `protobuf:"varint,2,opt,name=isPass" json:"isPass,omitempty"` + SignalResp *SignalResp `protobuf:"bytes,3,opt,name=signalResp" json:"signalResp,omitempty"` + MsgData *MsgData `protobuf:"bytes,4,opt,name=msgData" json:"msgData,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalMessageAssembleResp) Reset() { *m = SignalMessageAssembleResp{} } +func (m *SignalMessageAssembleResp) String() string { return proto.CompactTextString(m) } +func (*SignalMessageAssembleResp) ProtoMessage() {} +func (*SignalMessageAssembleResp) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_2059f33abbeeea7e, []int{25} +} +func (m *SignalMessageAssembleResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalMessageAssembleResp.Unmarshal(m, b) +} +func (m *SignalMessageAssembleResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalMessageAssembleResp.Marshal(b, m, deterministic) +} +func (dst *SignalMessageAssembleResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalMessageAssembleResp.Merge(dst, src) +} +func (m *SignalMessageAssembleResp) XXX_Size() int { + return xxx_messageInfo_SignalMessageAssembleResp.Size(m) +} +func (m *SignalMessageAssembleResp) XXX_DiscardUnknown() { + xxx_messageInfo_SignalMessageAssembleResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalMessageAssembleResp proto.InternalMessageInfo + +func (m *SignalMessageAssembleResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *SignalMessageAssembleResp) GetIsPass() bool { + if m != nil { + return m.IsPass + } + return false +} + +func (m *SignalMessageAssembleResp) GetSignalResp() *SignalResp { + if m != nil { + return m.SignalResp + } + return nil +} + +func (m *SignalMessageAssembleResp) GetMsgData() *MsgData { + if m != nil { + return m.MsgData + } + return nil +} + +func init() { + proto.RegisterType((*CommonResp)(nil), "proto.CommonResp") + proto.RegisterType((*MsgData)(nil), "proto.MsgData") + proto.RegisterMapType((map[string]bool)(nil), "proto.MsgData.OptionsEntry") + proto.RegisterType((*GroupInfo)(nil), "proto.GroupInfo") + proto.RegisterType((*GroupMemberFullInfo)(nil), "proto.GroupMemberFullInfo") + proto.RegisterType((*ParticipantMetaData)(nil), "proto.ParticipantMetaData") + proto.RegisterType((*PublicUserInfo)(nil), "proto.PublicUserInfo") + proto.RegisterType((*GetJoinTokenReq)(nil), "proto.GetJoinTokenReq") + proto.RegisterType((*GetJoinTokenResp)(nil), "proto.GetJoinTokenResp") + proto.RegisterType((*OfflinePushInfo)(nil), "proto.OfflinePushInfo") + proto.RegisterType((*SignalReq)(nil), "proto.SignalReq") + proto.RegisterType((*SignalResp)(nil), "proto.SignalResp") + proto.RegisterType((*InvitationInfo)(nil), "proto.InvitationInfo") + proto.RegisterType((*SignalInviteReq)(nil), "proto.SignalInviteReq") + proto.RegisterType((*SignalInviteReply)(nil), "proto.SignalInviteReply") + proto.RegisterType((*SignalInviteInGroupReq)(nil), "proto.SignalInviteInGroupReq") + proto.RegisterType((*SignalInviteInGroupReply)(nil), "proto.SignalInviteInGroupReply") + proto.RegisterType((*SignalCancelReq)(nil), "proto.SignalCancelReq") + proto.RegisterType((*SignalCancelReply)(nil), "proto.SignalCancelReply") + proto.RegisterType((*SignalAcceptReq)(nil), "proto.SignalAcceptReq") + proto.RegisterType((*SignalAcceptReply)(nil), "proto.SignalAcceptReply") + proto.RegisterType((*SignalHungUpReq)(nil), "proto.SignalHungUpReq") + proto.RegisterType((*SignalHungUpReply)(nil), "proto.SignalHungUpReply") + proto.RegisterType((*SignalRejectReq)(nil), "proto.SignalRejectReq") + proto.RegisterType((*SignalRejectReply)(nil), "proto.SignalRejectReply") + proto.RegisterType((*SignalMessageAssembleReq)(nil), "proto.SignalMessageAssembleReq") + proto.RegisterType((*SignalMessageAssembleResp)(nil), "proto.SignalMessageAssembleResp") } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConnInterface +var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 +const _ = grpc.SupportPackageIsVersion4 + +// Client API for RtcService service -// RtcServiceClient is the client API for RtcService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type RtcServiceClient interface { SignalMessageAssemble(ctx context.Context, in *SignalMessageAssembleReq, opts ...grpc.CallOption) (*SignalMessageAssembleResp, error) } type rtcServiceClient struct { - cc grpc.ClientConnInterface + cc *grpc.ClientConn } -func NewRtcServiceClient(cc grpc.ClientConnInterface) RtcServiceClient { +func NewRtcServiceClient(cc *grpc.ClientConn) RtcServiceClient { return &rtcServiceClient{cc} } func (c *rtcServiceClient) SignalMessageAssemble(ctx context.Context, in *SignalMessageAssembleReq, opts ...grpc.CallOption) (*SignalMessageAssembleResp, error) { out := new(SignalMessageAssembleResp) - err := c.cc.Invoke(ctx, "/proto.RtcService/SignalMessageAssemble", in, out, opts...) + err := grpc.Invoke(ctx, "/proto.RtcService/SignalMessageAssemble", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -// RtcServiceServer is the server API for RtcService service. +// Server API for RtcService service + type RtcServiceServer interface { SignalMessageAssemble(context.Context, *SignalMessageAssembleReq) (*SignalMessageAssembleResp, error) } -// UnimplementedRtcServiceServer can be embedded to have forward compatible implementations. -type UnimplementedRtcServiceServer struct { -} - -func (*UnimplementedRtcServiceServer) SignalMessageAssemble(context.Context, *SignalMessageAssembleReq) (*SignalMessageAssembleResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method SignalMessageAssemble not implemented") -} - func RegisterRtcServiceServer(s *grpc.Server, srv RtcServiceServer) { s.RegisterService(&_RtcService_serviceDesc, srv) } @@ -2986,5 +2272,110 @@ var _RtcService_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "proto/rtc.proto", + Metadata: "rtc/rtc.proto", +} + +func init() { proto.RegisterFile("rtc/rtc.proto", fileDescriptor_rtc_2059f33abbeeea7e) } + +var fileDescriptor_rtc_2059f33abbeeea7e = []byte{ + // 1579 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0xcd, 0x6e, 0xdb, 0xc6, + 0x16, 0xbe, 0x94, 0x2c, 0xdb, 0x3a, 0xf2, 0xef, 0xf8, 0xc6, 0xe0, 0xf5, 0xfd, 0x13, 0x84, 0x20, + 0x10, 0x82, 0x0b, 0xe7, 0x46, 0x45, 0x8a, 0x22, 0x2d, 0x8a, 0x26, 0x76, 0x7e, 0x54, 0xc4, 0xb1, + 0x31, 0x8e, 0x37, 0xe9, 0x8a, 0xa6, 0xc6, 0xca, 0x24, 0x24, 0x87, 0x1e, 0x0e, 0x9d, 0xf8, 0x05, + 0xba, 0xee, 0xa6, 0xab, 0x6e, 0x8b, 0xbe, 0x42, 0x77, 0xdd, 0xf4, 0x15, 0x0a, 0xf4, 0x05, 0xb2, + 0xeb, 0xba, 0xfb, 0x62, 0xce, 0x0c, 0xc9, 0x21, 0x2d, 0xa7, 0x29, 0x90, 0x45, 0x91, 0xae, 0xc4, + 0xf3, 0x37, 0x33, 0xfc, 0xce, 0x37, 0xe7, 0x1c, 0x11, 0x96, 0xa5, 0x0a, 0x6f, 0x48, 0x15, 0x6e, + 0xa7, 0x52, 0x28, 0x41, 0x3a, 0xf8, 0x33, 0xf8, 0x14, 0x60, 0x47, 0xc4, 0xb1, 0x48, 0x28, 0xcb, + 0x52, 0xe2, 0xc3, 0x02, 0x93, 0x72, 0x47, 0x4c, 0x98, 0xef, 0xf5, 0xbd, 0x61, 0x87, 0x16, 0x22, + 0xd9, 0x84, 0x79, 0x26, 0xe5, 0x5e, 0x36, 0xf5, 0x5b, 0x7d, 0x6f, 0xd8, 0xa5, 0x56, 0x1a, 0x7c, + 0xdb, 0x81, 0x85, 0xbd, 0x6c, 0xba, 0x1b, 0xa8, 0x40, 0xfb, 0x64, 0x2c, 0x99, 0x8c, 0x77, 0x31, + 0xb8, 0x4b, 0xad, 0xa4, 0xf5, 0x92, 0x85, 0x67, 0xe3, 0xdd, 0x22, 0xd6, 0x48, 0x7a, 0xb7, 0xa9, + 0x14, 0x79, 0x3a, 0xde, 0xf5, 0xdb, 0x68, 0x28, 0x44, 0xd2, 0x87, 0x5e, 0x18, 0x71, 0x96, 0xa8, + 0xbd, 0x6c, 0x3a, 0xde, 0xf5, 0xe7, 0xd0, 0xea, 0xaa, 0xb4, 0x47, 0xc6, 0xe4, 0x19, 0x93, 0xc6, + 0xa3, 0x63, 0x3c, 0x1c, 0x15, 0xb9, 0x0e, 0x6b, 0x7a, 0x7f, 0x26, 0x0f, 0xa2, 0x40, 0x9d, 0x08, + 0x19, 0x8f, 0x77, 0xfd, 0x79, 0x7c, 0xa9, 0x0b, 0x7a, 0x72, 0x0d, 0x56, 0x8c, 0xee, 0x31, 0x0f, + 0x5f, 0x24, 0x41, 0xcc, 0xfc, 0x05, 0x5c, 0xb0, 0xa1, 0x25, 0x57, 0x61, 0xd9, 0x68, 0xee, 0x07, + 0x21, 0x3b, 0xa2, 0x8f, 0xfc, 0x45, 0x74, 0xab, 0x2b, 0xcd, 0xd9, 0xb2, 0x8c, 0x8b, 0xe4, 0xc9, + 0x79, 0xca, 0xfc, 0x2e, 0x6e, 0xea, 0xaa, 0xf4, 0x9b, 0xc7, 0xd9, 0xf4, 0xbe, 0x14, 0xb1, 0x0f, + 0x06, 0x67, 0x2b, 0xe2, 0x9b, 0x8b, 0x44, 0xb1, 0x44, 0x61, 0x6c, 0xcf, 0xc4, 0x3a, 0x2a, 0x1d, + 0x6b, 0x45, 0x7f, 0xa9, 0xef, 0x0d, 0x97, 0x68, 0x21, 0x92, 0x35, 0x68, 0x67, 0xec, 0xd4, 0x5f, + 0xe9, 0x7b, 0xc3, 0x65, 0xaa, 0x1f, 0xc9, 0x16, 0x2c, 0xea, 0xa3, 0x3d, 0xe1, 0x31, 0xf3, 0x57, + 0xfb, 0xde, 0xb0, 0x4d, 0x4b, 0x99, 0xfc, 0x07, 0x20, 0x94, 0x2c, 0x50, 0x0c, 0xad, 0x6b, 0x68, + 0x75, 0x34, 0x98, 0x4d, 0x15, 0xa8, 0x3c, 0xf3, 0xd7, 0xf1, 0x10, 0x56, 0x22, 0xb7, 0x60, 0x41, + 0xa4, 0x8a, 0x8b, 0x24, 0xf3, 0x49, 0xbf, 0x3d, 0xec, 0x8d, 0xfe, 0x69, 0x18, 0xb5, 0x6d, 0x69, + 0xb0, 0xbd, 0x6f, 0xac, 0xf7, 0x12, 0x25, 0xcf, 0x69, 0xe1, 0x4b, 0x3e, 0x83, 0x55, 0x71, 0x72, + 0x12, 0xf1, 0x84, 0x1d, 0xe4, 0xd9, 0xb3, 0x71, 0x72, 0x22, 0xfc, 0x8d, 0xbe, 0x37, 0xec, 0x8d, + 0x36, 0x6d, 0xf8, 0x7e, 0xdd, 0x4a, 0x9b, 0xee, 0x5b, 0xb7, 0x61, 0xc9, 0x5d, 0x5a, 0xbf, 0xee, + 0x0b, 0x76, 0x6e, 0xb9, 0xa6, 0x1f, 0xc9, 0xdf, 0xa1, 0x73, 0x16, 0x44, 0x39, 0x43, 0x9e, 0x2d, + 0x52, 0x23, 0xdc, 0x6e, 0x7d, 0xe4, 0x0d, 0x7e, 0x6d, 0x41, 0xf7, 0x01, 0x92, 0x2b, 0x39, 0x11, + 0x2e, 0xf1, 0xbc, 0x3a, 0xf1, 0xfe, 0x05, 0x5d, 0x7c, 0x7c, 0xac, 0x39, 0x60, 0xd8, 0x5a, 0x29, + 0xc8, 0x00, 0x96, 0x12, 0xa1, 0xf8, 0x09, 0x0f, 0x03, 0x7d, 0x0e, 0xcb, 0xda, 0x9a, 0x4e, 0xfb, + 0xf0, 0x44, 0x49, 0x31, 0xc9, 0x43, 0xf4, 0x31, 0xdc, 0xad, 0xe9, 0xf4, 0xfe, 0x27, 0x96, 0x40, + 0x86, 0xb8, 0x85, 0xa8, 0xd3, 0x2f, 0x5e, 0x26, 0x4c, 0x1e, 0x65, 0x4c, 0x5a, 0xbe, 0x76, 0xa9, + 0xab, 0x6a, 0xa4, 0x6d, 0x01, 0x73, 0xed, 0xa6, 0xad, 0x0f, 0xbd, 0x98, 0xc5, 0xc7, 0x4c, 0xee, + 0x88, 0x3c, 0x51, 0x48, 0xd0, 0x65, 0xea, 0xaa, 0xc8, 0x0a, 0xb4, 0xd8, 0x2b, 0x64, 0x65, 0x97, + 0xb6, 0xd8, 0x2b, 0x27, 0xd1, 0x50, 0x4b, 0xf4, 0x55, 0x58, 0xc6, 0x75, 0x45, 0x71, 0x9a, 0x9e, + 0x21, 0x7b, 0x4d, 0x59, 0x22, 0x86, 0x74, 0x5d, 0xc2, 0x05, 0x2a, 0xc5, 0xe0, 0xfb, 0x16, 0x6c, + 0x20, 0xee, 0x7b, 0x78, 0x80, 0xfb, 0x79, 0x14, 0xfd, 0x4e, 0x06, 0x36, 0x61, 0x3e, 0x37, 0xdb, + 0xd9, 0x62, 0x91, 0x97, 0xfb, 0x48, 0x11, 0xb1, 0x47, 0xec, 0x8c, 0x45, 0x08, 0x7c, 0x87, 0x56, + 0x0a, 0x4d, 0xf4, 0xe7, 0x82, 0x27, 0x88, 0xc9, 0x1c, 0x1a, 0x4b, 0x59, 0xdb, 0x92, 0xe2, 0x5a, + 0x1b, 0xb8, 0x4b, 0xd9, 0xcd, 0xc4, 0x7c, 0x3d, 0x13, 0xd7, 0x60, 0x25, 0x48, 0xd3, 0xbd, 0x20, + 0x99, 0x32, 0x69, 0x36, 0x5d, 0xc0, 0x75, 0x1b, 0x5a, 0x9d, 0x0f, 0xbd, 0xd3, 0xa1, 0xc8, 0x65, + 0xc8, 0x10, 0xee, 0x0e, 0x75, 0x34, 0x7a, 0x1d, 0x91, 0x32, 0xe9, 0xc0, 0x68, 0x90, 0x6f, 0x68, + 0x6d, 0x56, 0xa0, 0xc8, 0xca, 0xe0, 0x07, 0x0f, 0x36, 0x0e, 0x02, 0xa9, 0x78, 0xc8, 0xd3, 0x20, + 0x51, 0x7b, 0x4c, 0x05, 0x58, 0x64, 0xb7, 0x2d, 0xde, 0x78, 0x83, 0x3c, 0xbc, 0x41, 0x6b, 0xf6, + 0x06, 0x95, 0x04, 0xa7, 0x95, 0x0b, 0xd9, 0x85, 0xd5, 0x69, 0x95, 0x00, 0x8c, 0x6a, 0x61, 0xd4, + 0x96, 0x1b, 0x55, 0x4f, 0x0f, 0x6d, 0x86, 0x90, 0x9b, 0xb0, 0x88, 0x79, 0xd0, 0xe1, 0x6d, 0x0c, + 0xbf, 0x62, 0xc3, 0x0f, 0xf2, 0xe3, 0x88, 0x87, 0x47, 0xd6, 0x48, 0x4b, 0xb7, 0xc1, 0x97, 0x1e, + 0xac, 0xd4, 0x8d, 0x4e, 0x6e, 0xbd, 0x5a, 0x6e, 0xdd, 0x0c, 0xb5, 0x2e, 0xcf, 0x50, 0xbb, 0x9e, + 0xa1, 0x4d, 0x98, 0x9f, 0x62, 0xdd, 0xb5, 0x19, 0xb7, 0x92, 0x45, 0xb2, 0x53, 0x22, 0xf9, 0x8d, + 0x07, 0xab, 0x0f, 0x98, 0xfa, 0x5c, 0xf3, 0x41, 0xbc, 0x60, 0x09, 0x65, 0xa7, 0x84, 0xc0, 0x9c, + 0x14, 0x22, 0xb6, 0xe7, 0xc0, 0x67, 0x7d, 0x0a, 0x3e, 0x61, 0x89, 0xe2, 0xea, 0xbc, 0x38, 0x45, + 0x21, 0x93, 0x0f, 0x61, 0x31, 0xb6, 0x19, 0xb0, 0xef, 0x5f, 0xc0, 0x37, 0x23, 0x47, 0xb4, 0xf4, + 0xc5, 0xfb, 0x8c, 0x79, 0xe6, 0x22, 0xa9, 0x1a, 0x99, 0xa3, 0x1a, 0x9c, 0xc2, 0x5a, 0xfd, 0x70, + 0x59, 0x4a, 0x6e, 0xba, 0x4d, 0xd9, 0x26, 0x79, 0xdd, 0xee, 0x57, 0x19, 0xa8, 0xdb, 0xb9, 0xd7, + 0xa0, 0xfd, 0xfc, 0xa5, 0xb2, 0xe7, 0xd6, 0x8f, 0x1a, 0xb8, 0x88, 0x9f, 0xb9, 0xc0, 0x59, 0x71, + 0xf0, 0xb5, 0x07, 0xab, 0x8d, 0x6a, 0xab, 0x4b, 0xa7, 0xe2, 0x2a, 0x62, 0x16, 0x11, 0x23, 0x68, + 0x98, 0x26, 0x2c, 0x0b, 0xed, 0xb2, 0xf8, 0x6c, 0xe1, 0x6d, 0x97, 0xe5, 0x43, 0x17, 0xbc, 0xfd, + 0x43, 0xbd, 0xd0, 0xa1, 0xc8, 0x93, 0x49, 0x59, 0xf0, 0x1c, 0x9d, 0x2e, 0x25, 0x7c, 0xff, 0xf0, + 0x6e, 0x30, 0x99, 0x32, 0x53, 0x96, 0x3a, 0x58, 0xa0, 0xeb, 0xca, 0xc1, 0xcf, 0x2d, 0xe8, 0x1e, + 0xf2, 0x69, 0x12, 0x44, 0x3a, 0x45, 0xff, 0x87, 0x79, 0x9e, 0x9c, 0x71, 0xc5, 0x2c, 0x00, 0x45, + 0x9f, 0x30, 0x1e, 0x63, 0x34, 0x51, 0x76, 0xfa, 0xf0, 0x6f, 0xd4, 0xfa, 0x91, 0x7b, 0xb0, 0x6c, + 0x9e, 0xc6, 0x09, 0x92, 0xda, 0x12, 0xfd, 0xdf, 0x33, 0x02, 0xad, 0x87, 0x89, 0xaf, 0x47, 0xe9, + 0x8d, 0xc3, 0x20, 0x09, 0x6d, 0x99, 0x69, 0x6e, 0xbc, 0x83, 0x26, 0xbb, 0xb1, 0xf1, 0xd3, 0x11, + 0x41, 0x18, 0xb2, 0x54, 0xe1, 0xcb, 0x37, 0x23, 0xee, 0xa0, 0xc9, 0x46, 0x18, 0x3f, 0x1d, 0xf1, + 0x2c, 0x4f, 0xa6, 0x47, 0x29, 0x22, 0xd1, 0x8c, 0x78, 0x88, 0x26, 0x1b, 0x61, 0xfc, 0x74, 0x84, + 0x64, 0xcf, 0x59, 0xa8, 0xb0, 0x50, 0x35, 0x23, 0x28, 0x9a, 0x6c, 0x84, 0xf1, 0xbb, 0xdb, 0x85, + 0x85, 0x34, 0x38, 0x8f, 0x44, 0x30, 0x19, 0xbc, 0x6e, 0x01, 0x14, 0x8e, 0x59, 0x4a, 0x46, 0x0d, + 0x68, 0xfd, 0x99, 0xd0, 0xa6, 0xd1, 0xb9, 0x03, 0xee, 0x83, 0xd9, 0xe0, 0xfe, 0xf7, 0x4d, 0xe0, + 0x9a, 0x15, 0x1a, 0xf0, 0x8e, 0x1a, 0xf0, 0xfa, 0x33, 0xe1, 0xb5, 0x9b, 0x5b, 0x80, 0x47, 0x0d, + 0x80, 0xfd, 0x99, 0x00, 0xdb, 0x18, 0x0b, 0xf1, 0xa8, 0x01, 0xb1, 0x3f, 0x13, 0x62, 0x1b, 0x63, + 0x41, 0x1e, 0x35, 0x40, 0xf6, 0x67, 0x82, 0x6c, 0x63, 0x2e, 0xc2, 0xfc, 0x53, 0x0b, 0x56, 0x10, + 0x02, 0x73, 0xb9, 0xf5, 0xbd, 0xba, 0x5a, 0xc0, 0x56, 0x54, 0x7f, 0x73, 0xbf, 0xea, 0x4a, 0xf2, + 0x3f, 0x58, 0x37, 0x0a, 0x66, 0x14, 0x8f, 0x78, 0xa6, 0xef, 0x72, 0x7b, 0xd8, 0xa5, 0x17, 0x0d, + 0x38, 0x02, 0xe4, 0x99, 0x12, 0x71, 0x59, 0x8e, 0xba, 0xd4, 0xd1, 0xb8, 0xcd, 0x75, 0xee, 0x42, + 0x73, 0xd5, 0xa5, 0xae, 0x1c, 0x98, 0xad, 0xa4, 0x23, 0x14, 0x8f, 0x99, 0xc8, 0x95, 0x1d, 0x91, + 0x0b, 0x51, 0xb7, 0xdd, 0x98, 0x4d, 0x78, 0x80, 0xed, 0xdd, 0x0c, 0xc5, 0x95, 0x42, 0x9f, 0x24, + 0xad, 0xa6, 0x6b, 0xdb, 0xfc, 0x2a, 0xcd, 0x5b, 0x4c, 0xc2, 0x38, 0x2e, 0x71, 0xc5, 0x8b, 0x81, + 0xc6, 0x8c, 0x20, 0x35, 0xdd, 0xe0, 0xb5, 0x07, 0xab, 0x8d, 0x5b, 0xaf, 0x8b, 0xb5, 0x48, 0x6b, + 0x90, 0x96, 0x32, 0xb9, 0x05, 0xc0, 0xcb, 0x2c, 0x58, 0x9e, 0x16, 0xed, 0xaa, 0x9e, 0x1e, 0xea, + 0x38, 0xce, 0x9a, 0x50, 0xdb, 0x7f, 0x68, 0x42, 0x25, 0x9f, 0x40, 0x2f, 0xad, 0xda, 0x81, 0xe5, + 0xea, 0x9b, 0x1a, 0x85, 0xeb, 0x3e, 0xf8, 0x02, 0xd6, 0x2f, 0x5c, 0x40, 0xac, 0xcb, 0xba, 0x2f, + 0x94, 0x75, 0x59, 0x0b, 0x4e, 0x1e, 0x5b, 0xcd, 0x3c, 0x5e, 0x52, 0xf3, 0x7f, 0xf1, 0x60, 0x73, + 0x76, 0x01, 0x7c, 0x1f, 0xa1, 0x3c, 0x06, 0xff, 0xb2, 0x82, 0xf4, 0xce, 0x10, 0xad, 0x58, 0x59, + 0xb6, 0x84, 0xf7, 0x11, 0xca, 0x8d, 0x82, 0x95, 0x4e, 0x65, 0x1e, 0x7c, 0xd5, 0x2a, 0xde, 0xbd, + 0x6c, 0x6e, 0xef, 0xe1, 0xbb, 0x93, 0xeb, 0xb0, 0x66, 0x5e, 0xc1, 0xf9, 0x84, 0xd0, 0x31, 0x9f, + 0x10, 0x9a, 0xfa, 0xea, 0xf6, 0x3a, 0xdd, 0xe8, 0x9d, 0x71, 0xed, 0xbb, 0x92, 0x6b, 0xe5, 0x68, + 0xf0, 0xa7, 0xc4, 0xbb, 0x62, 0x8b, 0xd3, 0x5f, 0x1d, 0xb6, 0x94, 0x63, 0xca, 0x5f, 0x9d, 0x2d, + 0x25, 0x4e, 0xce, 0x4c, 0x31, 0x88, 0x8a, 0xaa, 0xb5, 0xc7, 0xb2, 0x2c, 0x98, 0xb2, 0x3b, 0x59, + 0xc6, 0xe2, 0xe3, 0x08, 0xfb, 0xdd, 0x36, 0x74, 0xb3, 0x62, 0x34, 0x6e, 0xfc, 0xed, 0x2b, 0x47, + 0x66, 0x5a, 0xb9, 0x34, 0xff, 0x78, 0xb4, 0x2e, 0xfe, 0xf1, 0xf8, 0xd1, 0x83, 0x7f, 0x5c, 0xb2, + 0x9d, 0xf9, 0x0b, 0x12, 0xbe, 0xcd, 0x5f, 0x90, 0xca, 0x49, 0xd3, 0x9a, 0x67, 0x07, 0x41, 0x96, + 0xd9, 0xcf, 0x2f, 0x56, 0xd2, 0x4b, 0x65, 0xe5, 0xec, 0x69, 0x53, 0xb2, 0xde, 0x38, 0xbb, 0x5e, + 0xaa, 0x72, 0x22, 0x43, 0xfc, 0x3e, 0x86, 0xe3, 0x8d, 0x49, 0xc2, 0x4a, 0xfd, 0x1b, 0x13, 0x2d, + 0xcc, 0xa3, 0x67, 0x00, 0x54, 0x85, 0x87, 0x4c, 0x9e, 0xf1, 0x90, 0x91, 0xa7, 0x70, 0x65, 0xe6, + 0x2b, 0x91, 0xfa, 0x98, 0x7a, 0x11, 0xdf, 0xad, 0xfe, 0x9b, 0x1d, 0xb2, 0xf4, 0x6e, 0xef, 0x69, + 0x77, 0xfb, 0x86, 0x54, 0xe1, 0xc7, 0x52, 0x85, 0xc7, 0xf3, 0xe8, 0xfd, 0xc1, 0x6f, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xcb, 0x87, 0xc7, 0x8b, 0x55, 0x15, 0x00, 0x00, } diff --git a/pkg/proto/rtc/rtc.proto b/pkg/proto/rtc/rtc.proto index ce9ca472b..cb99f9b84 100644 --- a/pkg/proto/rtc/rtc.proto +++ b/pkg/proto/rtc/rtc.proto @@ -122,8 +122,9 @@ message InvitationInfo { string roomID = 5; int32 timeout = 6; string mediaType = 7; - int32 platformID = 8; - int32 sessionType = 9; + int32 platformID = 8; + int32 sessionType = 9; + int32 initiateTime = 10; } diff --git a/pkg/proto/sdk_ws/wrappers.proto b/pkg/proto/sdk_ws/wrappers.proto new file mode 100644 index 000000000..c571f0968 --- /dev/null +++ b/pkg/proto/sdk_ws/wrappers.proto @@ -0,0 +1,123 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Wrappers for primitive (non-message) types. These types are useful +// for embedding primitives in the `google.protobuf.Any` type and for places +// where we need to distinguish between the absence of a primitive +// typed field and its default value. +// +// These wrappers have no meaningful use within repeated fields as they lack +// the ability to detect presence on individual elements. +// These wrappers have no meaningful use within a map or a oneof since +// individual entries of a map or fields of a oneof can already detect presence. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/wrapperspb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "WrappersProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// Wrapper message for `double`. +// +// The JSON representation for `DoubleValue` is JSON number. +message DoubleValue { + // The double value. + double value = 1; +} + +// Wrapper message for `float`. +// +// The JSON representation for `FloatValue` is JSON number. +message FloatValue { + // The float value. + float value = 1; +} + +// Wrapper message for `int64`. +// +// The JSON representation for `Int64Value` is JSON string. +message Int64Value { + // The int64 value. + int64 value = 1; +} + +// Wrapper message for `uint64`. +// +// The JSON representation for `UInt64Value` is JSON string. +message UInt64Value { + // The uint64 value. + uint64 value = 1; +} + +// Wrapper message for `int32`. +// +// The JSON representation for `Int32Value` is JSON number. +message Int32Value { + // The int32 value. + int32 value = 1; +} + +// Wrapper message for `uint32`. +// +// The JSON representation for `UInt32Value` is JSON number. +message UInt32Value { + // The uint32 value. + uint32 value = 1; +} + +// Wrapper message for `bool`. +// +// The JSON representation for `BoolValue` is JSON `true` and `false`. +message BoolValue { + // The bool value. + bool value = 1; +} + +// Wrapper message for `string`. +// +// The JSON representation for `StringValue` is JSON string. +message StringValue { + // The string value. + string value = 1; +} + +// Wrapper message for `bytes`. +// +// The JSON representation for `BytesValue` is JSON string. +message BytesValue { + // The bytes value. + bytes value = 1; +} \ No newline at end of file diff --git a/pkg/proto/sdk_ws/ws.pb.go b/pkg/proto/sdk_ws/ws.pb.go index 2f5ca5e67..2ae3dc2a5 100644 --- a/pkg/proto/sdk_ws/ws.pb.go +++ b/pkg/proto/sdk_ws/ws.pb.go @@ -6,6 +6,7 @@ package server_api_params // import "Open_IM/pkg/proto/sdk_ws" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -31,6 +32,7 @@ type GroupInfo struct { Status int32 `protobuf:"varint,10,opt,name=status" json:"status,omitempty"` CreatorUserID string `protobuf:"bytes,11,opt,name=creatorUserID" json:"creatorUserID,omitempty"` GroupType int32 `protobuf:"varint,12,opt,name=groupType" json:"groupType,omitempty"` + NeedVerification int32 `protobuf:"varint,13,opt,name=needVerification" json:"needVerification,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -40,7 +42,7 @@ func (m *GroupInfo) Reset() { *m = GroupInfo{} } func (m *GroupInfo) String() string { return proto.CompactTextString(m) } func (*GroupInfo) ProtoMessage() {} func (*GroupInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{0} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{0} } func (m *GroupInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupInfo.Unmarshal(m, b) @@ -144,6 +146,99 @@ func (m *GroupInfo) GetGroupType() int32 { return 0 } +func (m *GroupInfo) GetNeedVerification() int32 { + if m != nil { + return m.NeedVerification + } + return 0 +} + +type GroupInfoForSet struct { + GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` + GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"` + Notification string `protobuf:"bytes,3,opt,name=notification" json:"notification,omitempty"` + Introduction string `protobuf:"bytes,4,opt,name=introduction" json:"introduction,omitempty"` + FaceURL string `protobuf:"bytes,5,opt,name=faceURL" json:"faceURL,omitempty"` + Ex string `protobuf:"bytes,6,opt,name=ex" json:"ex,omitempty"` + NeedVerification *wrapperspb.Int32Value `protobuf:"bytes,7,opt,name=needVerification" json:"needVerification,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupInfoForSet) Reset() { *m = GroupInfoForSet{} } +func (m *GroupInfoForSet) String() string { return proto.CompactTextString(m) } +func (*GroupInfoForSet) ProtoMessage() {} +func (*GroupInfoForSet) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{1} +} +func (m *GroupInfoForSet) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupInfoForSet.Unmarshal(m, b) +} +func (m *GroupInfoForSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupInfoForSet.Marshal(b, m, deterministic) +} +func (dst *GroupInfoForSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupInfoForSet.Merge(dst, src) +} +func (m *GroupInfoForSet) XXX_Size() int { + return xxx_messageInfo_GroupInfoForSet.Size(m) +} +func (m *GroupInfoForSet) XXX_DiscardUnknown() { + xxx_messageInfo_GroupInfoForSet.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupInfoForSet proto.InternalMessageInfo + +func (m *GroupInfoForSet) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *GroupInfoForSet) GetGroupName() string { + if m != nil { + return m.GroupName + } + return "" +} + +func (m *GroupInfoForSet) GetNotification() string { + if m != nil { + return m.Notification + } + return "" +} + +func (m *GroupInfoForSet) GetIntroduction() string { + if m != nil { + return m.Introduction + } + return "" +} + +func (m *GroupInfoForSet) GetFaceURL() string { + if m != nil { + return m.FaceURL + } + return "" +} + +func (m *GroupInfoForSet) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +func (m *GroupInfoForSet) GetNeedVerification() *wrapperspb.Int32Value { + if m != nil { + return m.NeedVerification + } + return nil +} + type GroupMemberFullInfo struct { GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` @@ -165,7 +260,7 @@ func (m *GroupMemberFullInfo) Reset() { *m = GroupMemberFullInfo{} } func (m *GroupMemberFullInfo) String() string { return proto.CompactTextString(m) } func (*GroupMemberFullInfo) ProtoMessage() {} func (*GroupMemberFullInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{1} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{2} } func (m *GroupMemberFullInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMemberFullInfo.Unmarshal(m, b) @@ -277,7 +372,7 @@ func (m *PublicUserInfo) Reset() { *m = PublicUserInfo{} } func (m *PublicUserInfo) String() string { return proto.CompactTextString(m) } func (*PublicUserInfo) ProtoMessage() {} func (*PublicUserInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{2} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{3} } func (m *PublicUserInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PublicUserInfo.Unmarshal(m, b) @@ -343,6 +438,7 @@ type UserInfo struct { Ex string `protobuf:"bytes,8,opt,name=ex" json:"ex,omitempty"` CreateTime uint32 `protobuf:"varint,9,opt,name=createTime" json:"createTime,omitempty"` AppMangerLevel int32 `protobuf:"varint,10,opt,name=appMangerLevel" json:"appMangerLevel,omitempty"` + GlobalRecvMsgOpt int32 `protobuf:"varint,11,opt,name=globalRecvMsgOpt" json:"globalRecvMsgOpt,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -352,7 +448,7 @@ func (m *UserInfo) Reset() { *m = UserInfo{} } func (m *UserInfo) String() string { return proto.CompactTextString(m) } func (*UserInfo) ProtoMessage() {} func (*UserInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{3} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{4} } func (m *UserInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserInfo.Unmarshal(m, b) @@ -442,6 +538,13 @@ func (m *UserInfo) GetAppMangerLevel() int32 { return 0 } +func (m *UserInfo) GetGlobalRecvMsgOpt() int32 { + if m != nil { + return m.GlobalRecvMsgOpt + } + return 0 +} + type FriendInfo struct { OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID" json:"ownerUserID,omitempty"` Remark string `protobuf:"bytes,2,opt,name=remark" json:"remark,omitempty"` @@ -459,7 +562,7 @@ func (m *FriendInfo) Reset() { *m = FriendInfo{} } func (m *FriendInfo) String() string { return proto.CompactTextString(m) } func (*FriendInfo) ProtoMessage() {} func (*FriendInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{4} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{5} } func (m *FriendInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendInfo.Unmarshal(m, b) @@ -544,7 +647,7 @@ func (m *BlackInfo) Reset() { *m = BlackInfo{} } func (m *BlackInfo) String() string { return proto.CompactTextString(m) } func (*BlackInfo) ProtoMessage() {} func (*BlackInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{5} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{6} } func (m *BlackInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlackInfo.Unmarshal(m, b) @@ -625,7 +728,7 @@ func (m *GroupRequest) Reset() { *m = GroupRequest{} } func (m *GroupRequest) String() string { return proto.CompactTextString(m) } func (*GroupRequest) ProtoMessage() {} func (*GroupRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{6} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{7} } func (m *GroupRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupRequest.Unmarshal(m, b) @@ -733,7 +836,7 @@ func (m *FriendRequest) Reset() { *m = FriendRequest{} } func (m *FriendRequest) String() string { return proto.CompactTextString(m) } func (*FriendRequest) ProtoMessage() {} func (*FriendRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{7} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{8} } func (m *FriendRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendRequest.Unmarshal(m, b) @@ -878,7 +981,7 @@ func (m *Department) Reset() { *m = Department{} } func (m *Department) String() string { return proto.CompactTextString(m) } func (*Department) ProtoMessage() {} func (*Department) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{8} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{9} } func (m *Department) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Department.Unmarshal(m, b) @@ -989,7 +1092,7 @@ func (m *OrganizationUser) Reset() { *m = OrganizationUser{} } func (m *OrganizationUser) String() string { return proto.CompactTextString(m) } func (*OrganizationUser) ProtoMessage() {} func (*OrganizationUser) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{9} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{10} } func (m *OrganizationUser) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrganizationUser.Unmarshal(m, b) @@ -1103,7 +1206,7 @@ func (m *DepartmentMember) Reset() { *m = DepartmentMember{} } func (m *DepartmentMember) String() string { return proto.CompactTextString(m) } func (*DepartmentMember) ProtoMessage() {} func (*DepartmentMember) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{10} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{11} } func (m *DepartmentMember) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DepartmentMember.Unmarshal(m, b) @@ -1184,7 +1287,7 @@ func (m *UserDepartmentMember) Reset() { *m = UserDepartmentMember{} } func (m *UserDepartmentMember) String() string { return proto.CompactTextString(m) } func (*UserDepartmentMember) ProtoMessage() {} func (*UserDepartmentMember) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{11} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{12} } func (m *UserDepartmentMember) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserDepartmentMember.Unmarshal(m, b) @@ -1230,7 +1333,7 @@ func (m *UserInDepartment) Reset() { *m = UserInDepartment{} } func (m *UserInDepartment) String() string { return proto.CompactTextString(m) } func (*UserInDepartment) ProtoMessage() {} func (*UserInDepartment) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{12} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{13} } func (m *UserInDepartment) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserInDepartment.Unmarshal(m, b) @@ -1264,74 +1367,22 @@ func (m *UserInDepartment) GetDepartmentMemberList() []*DepartmentMember { return nil } -type PullMessageBySeqListResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` - List []*MsgData `protobuf:"bytes,3,rep,name=list" json:"list,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PullMessageBySeqListResp) Reset() { *m = PullMessageBySeqListResp{} } -func (m *PullMessageBySeqListResp) String() string { return proto.CompactTextString(m) } -func (*PullMessageBySeqListResp) ProtoMessage() {} -func (*PullMessageBySeqListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{13} -} -func (m *PullMessageBySeqListResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PullMessageBySeqListResp.Unmarshal(m, b) -} -func (m *PullMessageBySeqListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PullMessageBySeqListResp.Marshal(b, m, deterministic) -} -func (dst *PullMessageBySeqListResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_PullMessageBySeqListResp.Merge(dst, src) -} -func (m *PullMessageBySeqListResp) XXX_Size() int { - return xxx_messageInfo_PullMessageBySeqListResp.Size(m) -} -func (m *PullMessageBySeqListResp) XXX_DiscardUnknown() { - xxx_messageInfo_PullMessageBySeqListResp.DiscardUnknown(m) -} - -var xxx_messageInfo_PullMessageBySeqListResp proto.InternalMessageInfo - -func (m *PullMessageBySeqListResp) GetErrCode() int32 { - if m != nil { - return m.ErrCode - } - return 0 -} - -func (m *PullMessageBySeqListResp) GetErrMsg() string { - if m != nil { - return m.ErrMsg - } - return "" -} - -func (m *PullMessageBySeqListResp) GetList() []*MsgData { - if m != nil { - return m.List - } - return nil -} - +// /////////////////////////////////base end///////////////////////////////////// type PullMessageBySeqListReq struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` - SeqList []uint32 `protobuf:"varint,3,rep,packed,name=seqList" json:"seqList,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + SeqList []uint32 `protobuf:"varint,3,rep,packed,name=seqList" json:"seqList,omitempty"` + GroupSeqList map[string]*SeqList `protobuf:"bytes,4,rep,name=groupSeqList" json:"groupSeqList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *PullMessageBySeqListReq) Reset() { *m = PullMessageBySeqListReq{} } func (m *PullMessageBySeqListReq) String() string { return proto.CompactTextString(m) } func (*PullMessageBySeqListReq) ProtoMessage() {} func (*PullMessageBySeqListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{14} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{14} } func (m *PullMessageBySeqListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageBySeqListReq.Unmarshal(m, b) @@ -1372,7 +1423,155 @@ func (m *PullMessageBySeqListReq) GetSeqList() []uint32 { return nil } +func (m *PullMessageBySeqListReq) GetGroupSeqList() map[string]*SeqList { + if m != nil { + return m.GroupSeqList + } + return nil +} + +type SeqList struct { + SeqList []uint32 `protobuf:"varint,1,rep,packed,name=seqList" json:"seqList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SeqList) Reset() { *m = SeqList{} } +func (m *SeqList) String() string { return proto.CompactTextString(m) } +func (*SeqList) ProtoMessage() {} +func (*SeqList) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{15} +} +func (m *SeqList) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SeqList.Unmarshal(m, b) +} +func (m *SeqList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SeqList.Marshal(b, m, deterministic) +} +func (dst *SeqList) XXX_Merge(src proto.Message) { + xxx_messageInfo_SeqList.Merge(dst, src) +} +func (m *SeqList) XXX_Size() int { + return xxx_messageInfo_SeqList.Size(m) +} +func (m *SeqList) XXX_DiscardUnknown() { + xxx_messageInfo_SeqList.DiscardUnknown(m) +} + +var xxx_messageInfo_SeqList proto.InternalMessageInfo + +func (m *SeqList) GetSeqList() []uint32 { + if m != nil { + return m.SeqList + } + return nil +} + +type MsgDataList struct { + MsgDataList []*MsgData `protobuf:"bytes,1,rep,name=msgDataList" json:"msgDataList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgDataList) Reset() { *m = MsgDataList{} } +func (m *MsgDataList) String() string { return proto.CompactTextString(m) } +func (*MsgDataList) ProtoMessage() {} +func (*MsgDataList) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{16} +} +func (m *MsgDataList) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MsgDataList.Unmarshal(m, b) +} +func (m *MsgDataList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MsgDataList.Marshal(b, m, deterministic) +} +func (dst *MsgDataList) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDataList.Merge(dst, src) +} +func (m *MsgDataList) XXX_Size() int { + return xxx_messageInfo_MsgDataList.Size(m) +} +func (m *MsgDataList) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDataList.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDataList proto.InternalMessageInfo + +func (m *MsgDataList) GetMsgDataList() []*MsgData { + if m != nil { + return m.MsgDataList + } + return nil +} + +type PullMessageBySeqListResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + List []*MsgData `protobuf:"bytes,3,rep,name=list" json:"list,omitempty"` + GroupMsgDataList map[string]*MsgDataList `protobuf:"bytes,4,rep,name=groupMsgDataList" json:"groupMsgDataList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PullMessageBySeqListResp) Reset() { *m = PullMessageBySeqListResp{} } +func (m *PullMessageBySeqListResp) String() string { return proto.CompactTextString(m) } +func (*PullMessageBySeqListResp) ProtoMessage() {} +func (*PullMessageBySeqListResp) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{17} +} +func (m *PullMessageBySeqListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PullMessageBySeqListResp.Unmarshal(m, b) +} +func (m *PullMessageBySeqListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PullMessageBySeqListResp.Marshal(b, m, deterministic) +} +func (dst *PullMessageBySeqListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_PullMessageBySeqListResp.Merge(dst, src) +} +func (m *PullMessageBySeqListResp) XXX_Size() int { + return xxx_messageInfo_PullMessageBySeqListResp.Size(m) +} +func (m *PullMessageBySeqListResp) XXX_DiscardUnknown() { + xxx_messageInfo_PullMessageBySeqListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_PullMessageBySeqListResp proto.InternalMessageInfo + +func (m *PullMessageBySeqListResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *PullMessageBySeqListResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *PullMessageBySeqListResp) GetList() []*MsgData { + if m != nil { + return m.List + } + return nil +} + +func (m *PullMessageBySeqListResp) GetGroupMsgDataList() map[string]*MsgDataList { + if m != nil { + return m.GroupMsgDataList + } + return nil +} + type GetMaxAndMinSeqReq struct { + GroupIDList []string `protobuf:"bytes,1,rep,name=groupIDList" json:"groupIDList,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1382,7 +1581,7 @@ func (m *GetMaxAndMinSeqReq) Reset() { *m = GetMaxAndMinSeqReq{} } func (m *GetMaxAndMinSeqReq) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqReq) ProtoMessage() {} func (*GetMaxAndMinSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{15} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{18} } func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) @@ -1402,7 +1601,28 @@ func (m *GetMaxAndMinSeqReq) XXX_DiscardUnknown() { var xxx_messageInfo_GetMaxAndMinSeqReq proto.InternalMessageInfo -type GetMaxAndMinSeqResp struct { +func (m *GetMaxAndMinSeqReq) GetGroupIDList() []string { + if m != nil { + return m.GroupIDList + } + return nil +} + +func (m *GetMaxAndMinSeqReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetMaxAndMinSeqReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type MaxAndMinSeq struct { MaxSeq uint32 `protobuf:"varint,1,opt,name=maxSeq" json:"maxSeq,omitempty"` MinSeq uint32 `protobuf:"varint,2,opt,name=minSeq" json:"minSeq,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -1410,11 +1630,60 @@ type GetMaxAndMinSeqResp struct { XXX_sizecache int32 `json:"-"` } +func (m *MaxAndMinSeq) Reset() { *m = MaxAndMinSeq{} } +func (m *MaxAndMinSeq) String() string { return proto.CompactTextString(m) } +func (*MaxAndMinSeq) ProtoMessage() {} +func (*MaxAndMinSeq) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{19} +} +func (m *MaxAndMinSeq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MaxAndMinSeq.Unmarshal(m, b) +} +func (m *MaxAndMinSeq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MaxAndMinSeq.Marshal(b, m, deterministic) +} +func (dst *MaxAndMinSeq) XXX_Merge(src proto.Message) { + xxx_messageInfo_MaxAndMinSeq.Merge(dst, src) +} +func (m *MaxAndMinSeq) XXX_Size() int { + return xxx_messageInfo_MaxAndMinSeq.Size(m) +} +func (m *MaxAndMinSeq) XXX_DiscardUnknown() { + xxx_messageInfo_MaxAndMinSeq.DiscardUnknown(m) +} + +var xxx_messageInfo_MaxAndMinSeq proto.InternalMessageInfo + +func (m *MaxAndMinSeq) GetMaxSeq() uint32 { + if m != nil { + return m.MaxSeq + } + return 0 +} + +func (m *MaxAndMinSeq) GetMinSeq() uint32 { + if m != nil { + return m.MinSeq + } + return 0 +} + +type GetMaxAndMinSeqResp struct { + MaxSeq uint32 `protobuf:"varint,1,opt,name=maxSeq" json:"maxSeq,omitempty"` + MinSeq uint32 `protobuf:"varint,2,opt,name=minSeq" json:"minSeq,omitempty"` + ErrCode int32 `protobuf:"varint,3,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,4,opt,name=errMsg" json:"errMsg,omitempty"` + GroupMaxAndMinSeq map[string]*MaxAndMinSeq `protobuf:"bytes,5,rep,name=groupMaxAndMinSeq" json:"groupMaxAndMinSeq,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + func (m *GetMaxAndMinSeqResp) Reset() { *m = GetMaxAndMinSeqResp{} } func (m *GetMaxAndMinSeqResp) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqResp) ProtoMessage() {} func (*GetMaxAndMinSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{16} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{20} } func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) @@ -1448,6 +1717,27 @@ func (m *GetMaxAndMinSeqResp) GetMinSeq() uint32 { return 0 } +func (m *GetMaxAndMinSeqResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetMaxAndMinSeqResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetMaxAndMinSeqResp) GetGroupMaxAndMinSeq() map[string]*MaxAndMinSeq { + if m != nil { + return m.GroupMaxAndMinSeq + } + return nil +} + type UserSendMsgResp struct { ServerMsgID string `protobuf:"bytes,1,opt,name=serverMsgID" json:"serverMsgID,omitempty"` ClientMsgID string `protobuf:"bytes,2,opt,name=clientMsgID" json:"clientMsgID,omitempty"` @@ -1461,7 +1751,7 @@ func (m *UserSendMsgResp) Reset() { *m = UserSendMsgResp{} } func (m *UserSendMsgResp) String() string { return proto.CompactTextString(m) } func (*UserSendMsgResp) ProtoMessage() {} func (*UserSendMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{17} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{21} } func (m *UserSendMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserSendMsgResp.Unmarshal(m, b) @@ -1522,6 +1812,7 @@ type MsgData struct { Options map[string]bool `protobuf:"bytes,18,rep,name=options" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,19,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"` AtUserIDList []string `protobuf:"bytes,20,rep,name=atUserIDList" json:"atUserIDList,omitempty"` + MsgDataList []byte `protobuf:"bytes,21,opt,name=msgDataList,proto3" json:"msgDataList,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1531,7 +1822,7 @@ func (m *MsgData) Reset() { *m = MsgData{} } func (m *MsgData) String() string { return proto.CompactTextString(m) } func (*MsgData) ProtoMessage() {} func (*MsgData) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{18} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{22} } func (m *MsgData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgData.Unmarshal(m, b) @@ -1684,6 +1975,13 @@ func (m *MsgData) GetAtUserIDList() []string { return nil } +func (m *MsgData) GetMsgDataList() []byte { + if m != nil { + return m.MsgDataList + } + return nil +} + type OfflinePushInfo struct { Title string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"` Desc string `protobuf:"bytes,2,opt,name=desc" json:"desc,omitempty"` @@ -1699,7 +1997,7 @@ func (m *OfflinePushInfo) Reset() { *m = OfflinePushInfo{} } func (m *OfflinePushInfo) String() string { return proto.CompactTextString(m) } func (*OfflinePushInfo) ProtoMessage() {} func (*OfflinePushInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{19} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{23} } func (m *OfflinePushInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OfflinePushInfo.Unmarshal(m, b) @@ -1767,7 +2065,7 @@ func (m *TipsComm) Reset() { *m = TipsComm{} } func (m *TipsComm) String() string { return proto.CompactTextString(m) } func (*TipsComm) ProtoMessage() {} func (*TipsComm) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{20} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{24} } func (m *TipsComm) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TipsComm.Unmarshal(m, b) @@ -1824,7 +2122,7 @@ func (m *GroupCreatedTips) Reset() { *m = GroupCreatedTips{} } func (m *GroupCreatedTips) String() string { return proto.CompactTextString(m) } func (*GroupCreatedTips) ProtoMessage() {} func (*GroupCreatedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{21} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{25} } func (m *GroupCreatedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupCreatedTips.Unmarshal(m, b) @@ -1893,7 +2191,7 @@ func (m *GroupInfoSetTips) Reset() { *m = GroupInfoSetTips{} } func (m *GroupInfoSetTips) String() string { return proto.CompactTextString(m) } func (*GroupInfoSetTips) ProtoMessage() {} func (*GroupInfoSetTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{22} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{26} } func (m *GroupInfoSetTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupInfoSetTips.Unmarshal(m, b) @@ -1948,7 +2246,7 @@ func (m *JoinGroupApplicationTips) Reset() { *m = JoinGroupApplicationTi func (m *JoinGroupApplicationTips) String() string { return proto.CompactTextString(m) } func (*JoinGroupApplicationTips) ProtoMessage() {} func (*JoinGroupApplicationTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{23} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{27} } func (m *JoinGroupApplicationTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_JoinGroupApplicationTips.Unmarshal(m, b) @@ -2004,7 +2302,7 @@ func (m *MemberQuitTips) Reset() { *m = MemberQuitTips{} } func (m *MemberQuitTips) String() string { return proto.CompactTextString(m) } func (*MemberQuitTips) ProtoMessage() {} func (*MemberQuitTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{24} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{28} } func (m *MemberQuitTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MemberQuitTips.Unmarshal(m, b) @@ -2059,7 +2357,7 @@ func (m *GroupApplicationAcceptedTips) Reset() { *m = GroupApplicationAc func (m *GroupApplicationAcceptedTips) String() string { return proto.CompactTextString(m) } func (*GroupApplicationAcceptedTips) ProtoMessage() {} func (*GroupApplicationAcceptedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{25} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{29} } func (m *GroupApplicationAcceptedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupApplicationAcceptedTips.Unmarshal(m, b) @@ -2114,7 +2412,7 @@ func (m *GroupApplicationRejectedTips) Reset() { *m = GroupApplicationRe func (m *GroupApplicationRejectedTips) String() string { return proto.CompactTextString(m) } func (*GroupApplicationRejectedTips) ProtoMessage() {} func (*GroupApplicationRejectedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{26} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{30} } func (m *GroupApplicationRejectedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupApplicationRejectedTips.Unmarshal(m, b) @@ -2170,7 +2468,7 @@ func (m *GroupOwnerTransferredTips) Reset() { *m = GroupOwnerTransferred func (m *GroupOwnerTransferredTips) String() string { return proto.CompactTextString(m) } func (*GroupOwnerTransferredTips) ProtoMessage() {} func (*GroupOwnerTransferredTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{27} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{31} } func (m *GroupOwnerTransferredTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupOwnerTransferredTips.Unmarshal(m, b) @@ -2233,7 +2531,7 @@ func (m *MemberKickedTips) Reset() { *m = MemberKickedTips{} } func (m *MemberKickedTips) String() string { return proto.CompactTextString(m) } func (*MemberKickedTips) ProtoMessage() {} func (*MemberKickedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{28} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{32} } func (m *MemberKickedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MemberKickedTips.Unmarshal(m, b) @@ -2296,7 +2594,7 @@ func (m *MemberInvitedTips) Reset() { *m = MemberInvitedTips{} } func (m *MemberInvitedTips) String() string { return proto.CompactTextString(m) } func (*MemberInvitedTips) ProtoMessage() {} func (*MemberInvitedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{29} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{33} } func (m *MemberInvitedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MemberInvitedTips.Unmarshal(m, b) @@ -2358,7 +2656,7 @@ func (m *MemberEnterTips) Reset() { *m = MemberEnterTips{} } func (m *MemberEnterTips) String() string { return proto.CompactTextString(m) } func (*MemberEnterTips) ProtoMessage() {} func (*MemberEnterTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{30} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{34} } func (m *MemberEnterTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MemberEnterTips.Unmarshal(m, b) @@ -2412,7 +2710,7 @@ func (m *GroupDismissedTips) Reset() { *m = GroupDismissedTips{} } func (m *GroupDismissedTips) String() string { return proto.CompactTextString(m) } func (*GroupDismissedTips) ProtoMessage() {} func (*GroupDismissedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{31} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{35} } func (m *GroupDismissedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupDismissedTips.Unmarshal(m, b) @@ -2468,7 +2766,7 @@ func (m *GroupMemberMutedTips) Reset() { *m = GroupMemberMutedTips{} } func (m *GroupMemberMutedTips) String() string { return proto.CompactTextString(m) } func (*GroupMemberMutedTips) ProtoMessage() {} func (*GroupMemberMutedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{32} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{36} } func (m *GroupMemberMutedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMemberMutedTips.Unmarshal(m, b) @@ -2537,7 +2835,7 @@ func (m *GroupMemberCancelMutedTips) Reset() { *m = GroupMemberCancelMut func (m *GroupMemberCancelMutedTips) String() string { return proto.CompactTextString(m) } func (*GroupMemberCancelMutedTips) ProtoMessage() {} func (*GroupMemberCancelMutedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{33} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{37} } func (m *GroupMemberCancelMutedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMemberCancelMutedTips.Unmarshal(m, b) @@ -2598,7 +2896,7 @@ func (m *GroupMutedTips) Reset() { *m = GroupMutedTips{} } func (m *GroupMutedTips) String() string { return proto.CompactTextString(m) } func (*GroupMutedTips) ProtoMessage() {} func (*GroupMutedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{34} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{38} } func (m *GroupMutedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMutedTips.Unmarshal(m, b) @@ -2652,7 +2950,7 @@ func (m *GroupCancelMutedTips) Reset() { *m = GroupCancelMutedTips{} } func (m *GroupCancelMutedTips) String() string { return proto.CompactTextString(m) } func (*GroupCancelMutedTips) ProtoMessage() {} func (*GroupCancelMutedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{35} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{39} } func (m *GroupCancelMutedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupCancelMutedTips.Unmarshal(m, b) @@ -2707,7 +3005,7 @@ func (m *GroupMemberInfoSetTips) Reset() { *m = GroupMemberInfoSetTips{} func (m *GroupMemberInfoSetTips) String() string { return proto.CompactTextString(m) } func (*GroupMemberInfoSetTips) ProtoMessage() {} func (*GroupMemberInfoSetTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{36} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{40} } func (m *GroupMemberInfoSetTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMemberInfoSetTips.Unmarshal(m, b) @@ -2767,7 +3065,7 @@ func (m *OrganizationChangedTips) Reset() { *m = OrganizationChangedTips func (m *OrganizationChangedTips) String() string { return proto.CompactTextString(m) } func (*OrganizationChangedTips) ProtoMessage() {} func (*OrganizationChangedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{37} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{41} } func (m *OrganizationChangedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrganizationChangedTips.Unmarshal(m, b) @@ -2814,7 +3112,7 @@ func (m *FriendApplication) Reset() { *m = FriendApplication{} } func (m *FriendApplication) String() string { return proto.CompactTextString(m) } func (*FriendApplication) ProtoMessage() {} func (*FriendApplication) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{38} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{42} } func (m *FriendApplication) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendApplication.Unmarshal(m, b) @@ -2867,7 +3165,7 @@ func (m *FromToUserID) Reset() { *m = FromToUserID{} } func (m *FromToUserID) String() string { return proto.CompactTextString(m) } func (*FromToUserID) ProtoMessage() {} func (*FromToUserID) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{39} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{43} } func (m *FromToUserID) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FromToUserID.Unmarshal(m, b) @@ -2913,7 +3211,7 @@ func (m *FriendApplicationTips) Reset() { *m = FriendApplicationTips{} } func (m *FriendApplicationTips) String() string { return proto.CompactTextString(m) } func (*FriendApplicationTips) ProtoMessage() {} func (*FriendApplicationTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{40} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{44} } func (m *FriendApplicationTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendApplicationTips.Unmarshal(m, b) @@ -2953,7 +3251,7 @@ func (m *FriendApplicationApprovedTips) Reset() { *m = FriendApplication func (m *FriendApplicationApprovedTips) String() string { return proto.CompactTextString(m) } func (*FriendApplicationApprovedTips) ProtoMessage() {} func (*FriendApplicationApprovedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{41} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{45} } func (m *FriendApplicationApprovedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendApplicationApprovedTips.Unmarshal(m, b) @@ -3000,7 +3298,7 @@ func (m *FriendApplicationRejectedTips) Reset() { *m = FriendApplication func (m *FriendApplicationRejectedTips) String() string { return proto.CompactTextString(m) } func (*FriendApplicationRejectedTips) ProtoMessage() {} func (*FriendApplicationRejectedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{42} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{46} } func (m *FriendApplicationRejectedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendApplicationRejectedTips.Unmarshal(m, b) @@ -3048,7 +3346,7 @@ func (m *FriendAddedTips) Reset() { *m = FriendAddedTips{} } func (m *FriendAddedTips) String() string { return proto.CompactTextString(m) } func (*FriendAddedTips) ProtoMessage() {} func (*FriendAddedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{43} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{47} } func (m *FriendAddedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendAddedTips.Unmarshal(m, b) @@ -3101,7 +3399,7 @@ func (m *FriendDeletedTips) Reset() { *m = FriendDeletedTips{} } func (m *FriendDeletedTips) String() string { return proto.CompactTextString(m) } func (*FriendDeletedTips) ProtoMessage() {} func (*FriendDeletedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{44} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{48} } func (m *FriendDeletedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendDeletedTips.Unmarshal(m, b) @@ -3139,7 +3437,7 @@ func (m *BlackAddedTips) Reset() { *m = BlackAddedTips{} } func (m *BlackAddedTips) String() string { return proto.CompactTextString(m) } func (*BlackAddedTips) ProtoMessage() {} func (*BlackAddedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{45} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{49} } func (m *BlackAddedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlackAddedTips.Unmarshal(m, b) @@ -3177,7 +3475,7 @@ func (m *BlackDeletedTips) Reset() { *m = BlackDeletedTips{} } func (m *BlackDeletedTips) String() string { return proto.CompactTextString(m) } func (*BlackDeletedTips) ProtoMessage() {} func (*BlackDeletedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{46} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{50} } func (m *BlackDeletedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlackDeletedTips.Unmarshal(m, b) @@ -3215,7 +3513,7 @@ func (m *FriendInfoChangedTips) Reset() { *m = FriendInfoChangedTips{} } func (m *FriendInfoChangedTips) String() string { return proto.CompactTextString(m) } func (*FriendInfoChangedTips) ProtoMessage() {} func (*FriendInfoChangedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{47} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{51} } func (m *FriendInfoChangedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendInfoChangedTips.Unmarshal(m, b) @@ -3254,7 +3552,7 @@ func (m *UserInfoUpdatedTips) Reset() { *m = UserInfoUpdatedTips{} } func (m *UserInfoUpdatedTips) String() string { return proto.CompactTextString(m) } func (*UserInfoUpdatedTips) ProtoMessage() {} func (*UserInfoUpdatedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{48} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{52} } func (m *UserInfoUpdatedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserInfoUpdatedTips.Unmarshal(m, b) @@ -3293,7 +3591,7 @@ func (m *ConversationUpdateTips) Reset() { *m = ConversationUpdateTips{} func (m *ConversationUpdateTips) String() string { return proto.CompactTextString(m) } func (*ConversationUpdateTips) ProtoMessage() {} func (*ConversationUpdateTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{49} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{53} } func (m *ConversationUpdateTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ConversationUpdateTips.Unmarshal(m, b) @@ -3333,7 +3631,7 @@ func (m *ConversationSetPrivateTips) Reset() { *m = ConversationSetPriva func (m *ConversationSetPrivateTips) String() string { return proto.CompactTextString(m) } func (*ConversationSetPrivateTips) ProtoMessage() {} func (*ConversationSetPrivateTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{50} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{54} } func (m *ConversationSetPrivateTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ConversationSetPrivateTips.Unmarshal(m, b) @@ -3374,6 +3672,61 @@ func (m *ConversationSetPrivateTips) GetIsPrivate() bool { return false } +// //////////////////message/////////////////////// +type DeleteMessageTips struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + SeqList []uint32 `protobuf:"varint,3,rep,packed,name=seqList" json:"seqList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteMessageTips) Reset() { *m = DeleteMessageTips{} } +func (m *DeleteMessageTips) String() string { return proto.CompactTextString(m) } +func (*DeleteMessageTips) ProtoMessage() {} +func (*DeleteMessageTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{55} +} +func (m *DeleteMessageTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteMessageTips.Unmarshal(m, b) +} +func (m *DeleteMessageTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteMessageTips.Marshal(b, m, deterministic) +} +func (dst *DeleteMessageTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteMessageTips.Merge(dst, src) +} +func (m *DeleteMessageTips) XXX_Size() int { + return xxx_messageInfo_DeleteMessageTips.Size(m) +} +func (m *DeleteMessageTips) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteMessageTips.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteMessageTips proto.InternalMessageInfo + +func (m *DeleteMessageTips) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *DeleteMessageTips) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *DeleteMessageTips) GetSeqList() []uint32 { + if m != nil { + return m.SeqList + } + return nil +} + // /cms type RequestPagination struct { PageNumber int32 `protobuf:"varint,1,opt,name=pageNumber" json:"pageNumber,omitempty"` @@ -3387,7 +3740,7 @@ func (m *RequestPagination) Reset() { *m = RequestPagination{} } func (m *RequestPagination) String() string { return proto.CompactTextString(m) } func (*RequestPagination) ProtoMessage() {} func (*RequestPagination) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{51} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{56} } func (m *RequestPagination) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RequestPagination.Unmarshal(m, b) @@ -3433,7 +3786,7 @@ func (m *ResponsePagination) Reset() { *m = ResponsePagination{} } func (m *ResponsePagination) String() string { return proto.CompactTextString(m) } func (*ResponsePagination) ProtoMessage() {} func (*ResponsePagination) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{52} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{57} } func (m *ResponsePagination) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ResponsePagination.Unmarshal(m, b) @@ -3486,7 +3839,7 @@ func (m *SignalReq) Reset() { *m = SignalReq{} } func (m *SignalReq) String() string { return proto.CompactTextString(m) } func (*SignalReq) ProtoMessage() {} func (*SignalReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{53} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{58} } func (m *SignalReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalReq.Unmarshal(m, b) @@ -3753,7 +4106,7 @@ func (m *SignalResp) Reset() { *m = SignalResp{} } func (m *SignalResp) String() string { return proto.CompactTextString(m) } func (*SignalResp) ProtoMessage() {} func (*SignalResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{54} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{59} } func (m *SignalResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalResp.Unmarshal(m, b) @@ -4012,6 +4365,7 @@ type InvitationInfo struct { MediaType string `protobuf:"bytes,7,opt,name=mediaType" json:"mediaType,omitempty"` PlatformID int32 `protobuf:"varint,8,opt,name=platformID" json:"platformID,omitempty"` SessionType int32 `protobuf:"varint,9,opt,name=sessionType" json:"sessionType,omitempty"` + InitiateTime int32 `protobuf:"varint,10,opt,name=initiateTime" json:"initiateTime,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -4021,7 +4375,7 @@ func (m *InvitationInfo) Reset() { *m = InvitationInfo{} } func (m *InvitationInfo) String() string { return proto.CompactTextString(m) } func (*InvitationInfo) ProtoMessage() {} func (*InvitationInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{55} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{60} } func (m *InvitationInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InvitationInfo.Unmarshal(m, b) @@ -4104,6 +4458,13 @@ func (m *InvitationInfo) GetSessionType() int32 { return 0 } +func (m *InvitationInfo) GetInitiateTime() int32 { + if m != nil { + return m.InitiateTime + } + return 0 +} + type ParticipantMetaData struct { GroupInfo *GroupInfo `protobuf:"bytes,1,opt,name=groupInfo" json:"groupInfo,omitempty"` GroupMemberInfo *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=groupMemberInfo" json:"groupMemberInfo,omitempty"` @@ -4117,7 +4478,7 @@ func (m *ParticipantMetaData) Reset() { *m = ParticipantMetaData{} } func (m *ParticipantMetaData) String() string { return proto.CompactTextString(m) } func (*ParticipantMetaData) ProtoMessage() {} func (*ParticipantMetaData) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{56} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{61} } func (m *ParticipantMetaData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ParticipantMetaData.Unmarshal(m, b) @@ -4172,7 +4533,7 @@ func (m *SignalInviteReq) Reset() { *m = SignalInviteReq{} } func (m *SignalInviteReq) String() string { return proto.CompactTextString(m) } func (*SignalInviteReq) ProtoMessage() {} func (*SignalInviteReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{57} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{62} } func (m *SignalInviteReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalInviteReq.Unmarshal(m, b) @@ -4233,7 +4594,7 @@ func (m *SignalInviteReply) Reset() { *m = SignalInviteReply{} } func (m *SignalInviteReply) String() string { return proto.CompactTextString(m) } func (*SignalInviteReply) ProtoMessage() {} func (*SignalInviteReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{58} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{63} } func (m *SignalInviteReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalInviteReply.Unmarshal(m, b) @@ -4288,7 +4649,7 @@ func (m *SignalInviteInGroupReq) Reset() { *m = SignalInviteInGroupReq{} func (m *SignalInviteInGroupReq) String() string { return proto.CompactTextString(m) } func (*SignalInviteInGroupReq) ProtoMessage() {} func (*SignalInviteInGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{59} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{64} } func (m *SignalInviteInGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalInviteInGroupReq.Unmarshal(m, b) @@ -4349,7 +4710,7 @@ func (m *SignalInviteInGroupReply) Reset() { *m = SignalInviteInGroupRep func (m *SignalInviteInGroupReply) String() string { return proto.CompactTextString(m) } func (*SignalInviteInGroupReply) ProtoMessage() {} func (*SignalInviteInGroupReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{60} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{65} } func (m *SignalInviteInGroupReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalInviteInGroupReply.Unmarshal(m, b) @@ -4404,7 +4765,7 @@ func (m *SignalCancelReq) Reset() { *m = SignalCancelReq{} } func (m *SignalCancelReq) String() string { return proto.CompactTextString(m) } func (*SignalCancelReq) ProtoMessage() {} func (*SignalCancelReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{61} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{66} } func (m *SignalCancelReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalCancelReq.Unmarshal(m, b) @@ -4462,7 +4823,7 @@ func (m *SignalCancelReply) Reset() { *m = SignalCancelReply{} } func (m *SignalCancelReply) String() string { return proto.CompactTextString(m) } func (*SignalCancelReply) ProtoMessage() {} func (*SignalCancelReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{62} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{67} } func (m *SignalCancelReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalCancelReply.Unmarshal(m, b) @@ -4497,7 +4858,7 @@ func (m *SignalAcceptReq) Reset() { *m = SignalAcceptReq{} } func (m *SignalAcceptReq) String() string { return proto.CompactTextString(m) } func (*SignalAcceptReq) ProtoMessage() {} func (*SignalAcceptReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{63} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{68} } func (m *SignalAcceptReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalAcceptReq.Unmarshal(m, b) @@ -4565,7 +4926,7 @@ func (m *SignalAcceptReply) Reset() { *m = SignalAcceptReply{} } func (m *SignalAcceptReply) String() string { return proto.CompactTextString(m) } func (*SignalAcceptReply) ProtoMessage() {} func (*SignalAcceptReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{64} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{69} } func (m *SignalAcceptReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalAcceptReply.Unmarshal(m, b) @@ -4619,7 +4980,7 @@ func (m *SignalHungUpReq) Reset() { *m = SignalHungUpReq{} } func (m *SignalHungUpReq) String() string { return proto.CompactTextString(m) } func (*SignalHungUpReq) ProtoMessage() {} func (*SignalHungUpReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{65} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{70} } func (m *SignalHungUpReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalHungUpReq.Unmarshal(m, b) @@ -4670,7 +5031,7 @@ func (m *SignalHungUpReply) Reset() { *m = SignalHungUpReply{} } func (m *SignalHungUpReply) String() string { return proto.CompactTextString(m) } func (*SignalHungUpReply) ProtoMessage() {} func (*SignalHungUpReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{66} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{71} } func (m *SignalHungUpReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalHungUpReply.Unmarshal(m, b) @@ -4705,7 +5066,7 @@ func (m *SignalRejectReq) Reset() { *m = SignalRejectReq{} } func (m *SignalRejectReq) String() string { return proto.CompactTextString(m) } func (*SignalRejectReq) ProtoMessage() {} func (*SignalRejectReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{67} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{72} } func (m *SignalRejectReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalRejectReq.Unmarshal(m, b) @@ -4770,7 +5131,7 @@ func (m *SignalRejectReply) Reset() { *m = SignalRejectReply{} } func (m *SignalRejectReply) String() string { return proto.CompactTextString(m) } func (*SignalRejectReply) ProtoMessage() {} func (*SignalRejectReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{68} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{73} } func (m *SignalRejectReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalRejectReply.Unmarshal(m, b) @@ -4804,7 +5165,7 @@ func (m *DelMsgListReq) Reset() { *m = DelMsgListReq{} } func (m *DelMsgListReq) String() string { return proto.CompactTextString(m) } func (*DelMsgListReq) ProtoMessage() {} func (*DelMsgListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{69} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{74} } func (m *DelMsgListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DelMsgListReq.Unmarshal(m, b) @@ -4864,7 +5225,7 @@ func (m *DelMsgListResp) Reset() { *m = DelMsgListResp{} } func (m *DelMsgListResp) String() string { return proto.CompactTextString(m) } func (*DelMsgListResp) ProtoMessage() {} func (*DelMsgListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_8b0ea2633e539530, []int{70} + return fileDescriptor_ws_a65b1a9a9ba03d6e, []int{75} } func (m *DelMsgListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DelMsgListResp.Unmarshal(m, b) @@ -4900,6 +5261,7 @@ func (m *DelMsgListResp) GetErrMsg() string { func init() { proto.RegisterType((*GroupInfo)(nil), "server_api_params.GroupInfo") + proto.RegisterType((*GroupInfoForSet)(nil), "server_api_params.GroupInfoForSet") proto.RegisterType((*GroupMemberFullInfo)(nil), "server_api_params.GroupMemberFullInfo") proto.RegisterType((*PublicUserInfo)(nil), "server_api_params.PublicUserInfo") proto.RegisterType((*UserInfo)(nil), "server_api_params.UserInfo") @@ -4912,10 +5274,16 @@ func init() { proto.RegisterType((*DepartmentMember)(nil), "server_api_params.DepartmentMember") proto.RegisterType((*UserDepartmentMember)(nil), "server_api_params.UserDepartmentMember") proto.RegisterType((*UserInDepartment)(nil), "server_api_params.UserInDepartment") - proto.RegisterType((*PullMessageBySeqListResp)(nil), "server_api_params.PullMessageBySeqListResp") proto.RegisterType((*PullMessageBySeqListReq)(nil), "server_api_params.PullMessageBySeqListReq") + proto.RegisterMapType((map[string]*SeqList)(nil), "server_api_params.PullMessageBySeqListReq.GroupSeqListEntry") + proto.RegisterType((*SeqList)(nil), "server_api_params.seqList") + proto.RegisterType((*MsgDataList)(nil), "server_api_params.MsgDataList") + proto.RegisterType((*PullMessageBySeqListResp)(nil), "server_api_params.PullMessageBySeqListResp") + proto.RegisterMapType((map[string]*MsgDataList)(nil), "server_api_params.PullMessageBySeqListResp.GroupMsgDataListEntry") proto.RegisterType((*GetMaxAndMinSeqReq)(nil), "server_api_params.GetMaxAndMinSeqReq") + proto.RegisterType((*MaxAndMinSeq)(nil), "server_api_params.MaxAndMinSeq") proto.RegisterType((*GetMaxAndMinSeqResp)(nil), "server_api_params.GetMaxAndMinSeqResp") + proto.RegisterMapType((map[string]*MaxAndMinSeq)(nil), "server_api_params.GetMaxAndMinSeqResp.GroupMaxAndMinSeqEntry") proto.RegisterType((*UserSendMsgResp)(nil), "server_api_params.UserSendMsgResp") proto.RegisterType((*MsgData)(nil), "server_api_params.MsgData") proto.RegisterMapType((map[string]bool)(nil), "server_api_params.MsgData.OptionsEntry") @@ -4951,6 +5319,7 @@ func init() { proto.RegisterType((*UserInfoUpdatedTips)(nil), "server_api_params.UserInfoUpdatedTips") proto.RegisterType((*ConversationUpdateTips)(nil), "server_api_params.ConversationUpdateTips") proto.RegisterType((*ConversationSetPrivateTips)(nil), "server_api_params.ConversationSetPrivateTips") + proto.RegisterType((*DeleteMessageTips)(nil), "server_api_params.DeleteMessageTips") proto.RegisterType((*RequestPagination)(nil), "server_api_params.RequestPagination") proto.RegisterType((*ResponsePagination)(nil), "server_api_params.ResponsePagination") proto.RegisterType((*SignalReq)(nil), "server_api_params.SignalReq") @@ -4973,199 +5342,220 @@ func init() { proto.RegisterType((*DelMsgListResp)(nil), "server_api_params.DelMsgListResp") } -func init() { proto.RegisterFile("sdk_ws/ws.proto", fileDescriptor_ws_8b0ea2633e539530) } +func init() { proto.RegisterFile("sdk_ws/ws.proto", fileDescriptor_ws_a65b1a9a9ba03d6e) } -var fileDescriptor_ws_8b0ea2633e539530 = []byte{ - // 3049 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5b, 0xcb, 0x6f, 0x24, 0x49, - 0xd1, 0xff, 0xaa, 0xda, 0xdd, 0x76, 0x47, 0xbb, 0xfd, 0xa8, 0x99, 0xcf, 0xdb, 0x98, 0xd9, 0xc1, - 0x14, 0xd6, 0xb2, 0x2c, 0x30, 0x8b, 0x76, 0x85, 0x04, 0xbb, 0x30, 0x68, 0x6c, 0xcf, 0x6b, 0x19, - 0x7b, 0xbc, 0xd5, 0x33, 0x2c, 0x02, 0xa4, 0x55, 0xb9, 0x2b, 0xdd, 0xae, 0x75, 0x55, 0x66, 0x75, - 0x3d, 0x3c, 0x33, 0x08, 0x09, 0x09, 0x24, 0xc4, 0x8d, 0x13, 0x1c, 0xb8, 0x20, 0x71, 0x41, 0xa0, - 0xd5, 0x6a, 0x85, 0x40, 0xe2, 0x80, 0x10, 0x07, 0xfe, 0x01, 0x8e, 0x88, 0x0b, 0xe2, 0xcc, 0x95, - 0x03, 0x12, 0x12, 0x28, 0x33, 0xb2, 0xaa, 0x32, 0xab, 0xba, 0xed, 0x9e, 0x96, 0xb5, 0x33, 0xab, - 0xe1, 0xd6, 0x11, 0x95, 0x11, 0x19, 0xf9, 0x8b, 0xc8, 0x8c, 0xc8, 0x47, 0xc3, 0x72, 0xe2, 0x1d, - 0xbf, 0xfd, 0x20, 0x79, 0xf9, 0x41, 0x72, 0x25, 0x8a, 0x59, 0xca, 0xac, 0xd5, 0x84, 0xc4, 0x27, - 0x24, 0x7e, 0xdb, 0x8d, 0xfc, 0xb7, 0x23, 0x37, 0x76, 0xc3, 0xc4, 0xfe, 0xa7, 0x09, 0xed, 0x9b, - 0x31, 0xcb, 0xa2, 0xdb, 0xf4, 0x90, 0x59, 0x3d, 0x98, 0x1f, 0x0a, 0x62, 0xa7, 0x67, 0x6c, 0x18, - 0x2f, 0xb6, 0x9d, 0x9c, 0xb4, 0x2e, 0x41, 0x5b, 0xfc, 0xdc, 0x73, 0x43, 0xd2, 0x33, 0xc5, 0xb7, - 0x92, 0x61, 0xd9, 0xb0, 0x48, 0x59, 0xea, 0x1f, 0xfa, 0x03, 0x37, 0xf5, 0x19, 0xed, 0x35, 0x44, - 0x03, 0x8d, 0xc7, 0xdb, 0xf8, 0x34, 0x8d, 0x99, 0x97, 0x0d, 0x44, 0x9b, 0x39, 0x6c, 0xa3, 0xf2, - 0x78, 0xff, 0x87, 0xee, 0x80, 0xdc, 0x77, 0xee, 0xf4, 0x9a, 0xd8, 0xbf, 0x24, 0xad, 0x0d, 0xe8, - 0xb0, 0x07, 0x94, 0xc4, 0xf7, 0x13, 0x12, 0xdf, 0xde, 0xe9, 0xb5, 0xc4, 0x57, 0x95, 0x65, 0x5d, - 0x06, 0x18, 0xc4, 0xc4, 0x4d, 0xc9, 0x3d, 0x3f, 0x24, 0xbd, 0xf9, 0x0d, 0xe3, 0xc5, 0xae, 0xa3, - 0x70, 0xb8, 0x86, 0x90, 0x84, 0x07, 0x24, 0xde, 0x66, 0x19, 0x4d, 0x7b, 0x0b, 0xa2, 0x81, 0xca, - 0xb2, 0x96, 0xc0, 0x24, 0x0f, 0x7b, 0x6d, 0xa1, 0xda, 0x24, 0x0f, 0xad, 0x35, 0x68, 0x25, 0xa9, - 0x9b, 0x66, 0x49, 0x0f, 0x36, 0x8c, 0x17, 0x9b, 0x8e, 0xa4, 0xac, 0x4d, 0xe8, 0x0a, 0xbd, 0x2c, - 0xb7, 0xa6, 0x23, 0x44, 0x74, 0x66, 0x81, 0xd8, 0xbd, 0x47, 0x11, 0xe9, 0x2d, 0x0a, 0x05, 0x25, - 0xc3, 0xfe, 0x8b, 0x09, 0x17, 0x04, 0xee, 0xbb, 0xc2, 0x80, 0x1b, 0x59, 0x10, 0x9c, 0xe1, 0x81, - 0x35, 0x68, 0x65, 0xd8, 0x1d, 0xc2, 0x2f, 0x29, 0xde, 0x4f, 0xcc, 0x02, 0x72, 0x87, 0x9c, 0x90, - 0x40, 0x00, 0xdf, 0x74, 0x4a, 0x86, 0xb5, 0x0e, 0x0b, 0xef, 0x30, 0x9f, 0x0a, 0x4c, 0xe6, 0xc4, - 0xc7, 0x82, 0xe6, 0xdf, 0xa8, 0x3f, 0x38, 0xa6, 0xdc, 0xa5, 0x08, 0x77, 0x41, 0xab, 0x9e, 0x68, - 0xe9, 0x9e, 0x78, 0x01, 0x96, 0xdc, 0x28, 0xda, 0x75, 0xe9, 0x90, 0xc4, 0xd8, 0xe9, 0xbc, 0xd0, - 0x5b, 0xe1, 0x72, 0x7f, 0xf0, 0x9e, 0xfa, 0x2c, 0x8b, 0x07, 0x44, 0xc0, 0xdd, 0x74, 0x14, 0x0e, - 0xd7, 0xc3, 0x22, 0x12, 0x2b, 0x30, 0x22, 0xf2, 0x15, 0xae, 0xf4, 0x0a, 0x14, 0x5e, 0xe1, 0x7e, - 0xcc, 0x52, 0x72, 0x9d, 0x7a, 0x62, 0x50, 0x1d, 0xe9, 0xc7, 0x92, 0x65, 0xff, 0xc0, 0x80, 0xa5, - 0xfd, 0xec, 0x20, 0xf0, 0x07, 0x42, 0x05, 0x87, 0xb5, 0x04, 0xcf, 0xd0, 0xc0, 0x53, 0x21, 0x30, - 0x27, 0x43, 0xd0, 0xd0, 0x21, 0x58, 0x83, 0xd6, 0x90, 0x50, 0x8f, 0xc4, 0x12, 0x52, 0x49, 0x49, - 0x53, 0x9b, 0xb9, 0xa9, 0xf6, 0x4f, 0x4c, 0x58, 0xf8, 0x80, 0x4d, 0xd8, 0x80, 0x4e, 0x74, 0xc4, - 0x28, 0xd9, 0xcb, 0x78, 0x58, 0x49, 0x5b, 0x54, 0x96, 0x75, 0x11, 0x9a, 0x07, 0x7e, 0x9c, 0x1e, - 0x09, 0xbf, 0x76, 0x1d, 0x24, 0x38, 0x97, 0x84, 0xae, 0x8f, 0xce, 0x6c, 0x3b, 0x48, 0xc8, 0x01, - 0x2d, 0x14, 0xd8, 0xeb, 0x73, 0xac, 0x5d, 0x9b, 0x63, 0xf5, 0xd8, 0x80, 0x71, 0xb1, 0x61, 0xff, - 0xcb, 0x00, 0xb8, 0x11, 0xfb, 0x84, 0x7a, 0x02, 0x9a, 0xca, 0xe4, 0x36, 0xea, 0x93, 0x7b, 0x0d, - 0x5a, 0x31, 0x09, 0xdd, 0xf8, 0x38, 0x0f, 0x7e, 0xa4, 0x2a, 0x06, 0x35, 0x6a, 0x06, 0xbd, 0x0e, - 0x70, 0x28, 0xfa, 0xe1, 0x7a, 0x04, 0x54, 0x9d, 0x57, 0x3e, 0x7a, 0xa5, 0xb6, 0x0c, 0x5e, 0xc9, - 0xbd, 0xe4, 0x28, 0xcd, 0xf9, 0xcc, 0x72, 0x3d, 0x4f, 0x06, 0x70, 0x13, 0x67, 0x56, 0xc1, 0x18, - 0x13, 0xbf, 0xad, 0x53, 0xe2, 0x77, 0xbe, 0x08, 0x8a, 0x7f, 0x18, 0xd0, 0xde, 0x0a, 0xdc, 0xc1, - 0xf1, 0x94, 0x43, 0xd7, 0x87, 0x68, 0xd6, 0x86, 0x78, 0x13, 0xba, 0x07, 0x5c, 0x5d, 0x3e, 0x04, - 0x81, 0x42, 0xe7, 0x95, 0x8f, 0x8f, 0x19, 0xa5, 0x3e, 0x29, 0x1c, 0x5d, 0x4e, 0x1f, 0xee, 0xdc, - 0xd9, 0xc3, 0x6d, 0x9e, 0x32, 0xdc, 0x56, 0x31, 0xdc, 0x3f, 0x9b, 0xb0, 0x28, 0x16, 0x3a, 0x87, - 0x8c, 0x32, 0x92, 0xa4, 0xd6, 0x97, 0x61, 0x21, 0xcb, 0x4d, 0x35, 0xa6, 0x35, 0xb5, 0x10, 0xb1, - 0x5e, 0x93, 0xcb, 0xaa, 0x90, 0x37, 0x85, 0xfc, 0xa5, 0x31, 0xf2, 0x45, 0x4e, 0x73, 0xca, 0xe6, - 0x3c, 0x05, 0x1d, 0xb9, 0xd4, 0x0b, 0x88, 0x43, 0x92, 0x2c, 0x48, 0xe5, 0x6a, 0xa9, 0xf1, 0x30, - 0xd2, 0x46, 0xbb, 0xc9, 0x50, 0x26, 0x28, 0x49, 0x71, 0x74, 0xb0, 0x1d, 0xff, 0x84, 0x43, 0x2f, - 0x19, 0x7c, 0xa2, 0xc6, 0x64, 0x24, 0x3c, 0x84, 0xd3, 0x2a, 0x27, 0xcb, 0x3e, 0x25, 0x6a, 0x18, - 0x08, 0x1a, 0x8f, 0xbb, 0x18, 0x69, 0xa1, 0x00, 0x33, 0x93, 0xc2, 0xa9, 0x26, 0x26, 0xfb, 0xaf, - 0x0d, 0xe8, 0xe2, 0xf4, 0xc9, 0x41, 0xbd, 0xcc, 0xe3, 0x9c, 0x85, 0x5a, 0x14, 0x29, 0x1c, 0x6e, - 0x05, 0xa7, 0xf6, 0xf4, 0x85, 0x46, 0xe3, 0xf1, 0x50, 0xe4, 0xf4, 0x0d, 0x6d, 0xc1, 0x51, 0x59, - 0x79, 0x2f, 0x37, 0xd5, 0x85, 0x47, 0xe1, 0xf0, 0xa5, 0x2c, 0x65, 0x5a, 0x74, 0x14, 0x34, 0x97, - 0x4d, 0x59, 0xd1, 0x3f, 0xc6, 0x87, 0xc2, 0xe1, 0xf8, 0xa6, 0x2c, 0xef, 0x1b, 0x41, 0x2a, 0x19, - 0xa8, 0x59, 0xf6, 0x8b, 0xa9, 0xa4, 0xa0, 0x6b, 0x5e, 0x6d, 0x9f, 0xea, 0x55, 0xd0, 0xbc, 0xaa, - 0x4f, 0xae, 0x4e, 0x6d, 0x72, 0x6d, 0x42, 0x17, 0xf5, 0xe4, 0x41, 0xbf, 0x88, 0xa9, 0x5e, 0x63, - 0xea, 0xb1, 0xd1, 0xad, 0xc6, 0x86, 0xee, 0xdd, 0xa5, 0x09, 0xde, 0x5d, 0x2e, 0xbc, 0xfb, 0x6b, - 0x13, 0x60, 0x87, 0x44, 0x6e, 0x9c, 0x86, 0x84, 0xa6, 0x7c, 0x78, 0x5e, 0x41, 0x15, 0xce, 0xd5, - 0x78, 0x6a, 0x9e, 0x30, 0xf5, 0x3c, 0x61, 0xc1, 0x9c, 0x00, 0x1c, 0xbd, 0x29, 0x7e, 0x73, 0x30, - 0x23, 0x37, 0x46, 0x6d, 0x18, 0xe4, 0x05, 0xcd, 0xf3, 0x00, 0x8b, 0x3d, 0x99, 0x39, 0x9a, 0x0e, - 0x12, 0x7c, 0xf2, 0x97, 0xfd, 0x89, 0x82, 0xa6, 0x85, 0xeb, 0xba, 0xce, 0x3d, 0xb3, 0x06, 0x7b, - 0x09, 0x56, 0x92, 0xec, 0xa0, 0x1c, 0xdc, 0x5e, 0x16, 0xca, 0x70, 0xaf, 0xf1, 0x39, 0xa8, 0x58, - 0x9c, 0xf1, 0x46, 0x98, 0x6a, 0x4a, 0x46, 0xb5, 0x2a, 0xb0, 0xdf, 0x35, 0x61, 0xe5, 0x6e, 0x3c, - 0x74, 0xa9, 0xff, 0x6d, 0x51, 0x6e, 0x8a, 0x05, 0x7c, 0x96, 0x94, 0xbb, 0x01, 0x1d, 0x42, 0x87, - 0x81, 0x9f, 0x1c, 0xed, 0x95, 0xb8, 0xa9, 0x2c, 0x15, 0xec, 0xb9, 0x49, 0x49, 0xb9, 0xa9, 0x25, - 0xe5, 0x35, 0x68, 0x85, 0xec, 0xc0, 0x0f, 0xf2, 0xb8, 0x97, 0x94, 0x88, 0x79, 0x12, 0x10, 0x91, - 0x9d, 0x8b, 0x98, 0xcf, 0x19, 0x65, 0xa2, 0x5e, 0x18, 0x9b, 0xa8, 0xdb, 0x6a, 0xa2, 0xd6, 0x81, - 0x87, 0x1a, 0xf0, 0x08, 0x57, 0xa7, 0x80, 0xeb, 0x8f, 0x06, 0xac, 0x94, 0x70, 0x63, 0x0d, 0x3a, - 0x11, 0xae, 0x6a, 0x04, 0x9a, 0x63, 0x22, 0xb0, 0x88, 0x9b, 0x86, 0x1a, 0x37, 0x3c, 0xd2, 0x58, - 0xe2, 0x2b, 0xf5, 0x7e, 0x41, 0xf3, 0xde, 0x02, 0xe2, 0x2a, 0x60, 0x21, 0xa5, 0x54, 0xdd, 0x2d, - 0xad, 0xea, 0xae, 0xe6, 0xd1, 0xdf, 0x19, 0x70, 0x91, 0x7b, 0xb9, 0x36, 0x8c, 0xbb, 0xb0, 0xc2, - 0x2a, 0x91, 0x20, 0x13, 0xcd, 0x27, 0xc6, 0x24, 0x8a, 0x6a, 0xd0, 0x38, 0x35, 0x61, 0xae, 0xd0, - 0xab, 0x74, 0x22, 0x33, 0xcf, 0x38, 0x85, 0x55, 0x7b, 0x9c, 0x9a, 0xb0, 0xfd, 0x7b, 0x03, 0x56, - 0x30, 0xb5, 0x29, 0xf3, 0xfc, 0xdc, 0xcd, 0x7e, 0x0b, 0x2e, 0x56, 0x7b, 0xbe, 0xe3, 0x27, 0x69, - 0xcf, 0xdc, 0x68, 0x4c, 0x6b, 0xfa, 0x58, 0x05, 0xf6, 0x77, 0xa0, 0xb7, 0x9f, 0x05, 0xc1, 0x2e, - 0x49, 0x12, 0x77, 0x48, 0xb6, 0x1e, 0xf5, 0xc9, 0x88, 0xf3, 0x1d, 0x92, 0x44, 0x7c, 0x72, 0x90, - 0x38, 0xde, 0x66, 0x1e, 0x11, 0xc6, 0x37, 0x9d, 0x9c, 0xe4, 0x7e, 0x25, 0x71, 0xcc, 0x57, 0x48, - 0x59, 0xc2, 0x21, 0x65, 0x5d, 0x81, 0xb9, 0x80, 0x9b, 0xd5, 0x10, 0x66, 0xad, 0x8f, 0x31, 0x6b, - 0x37, 0x19, 0xee, 0xb8, 0xa9, 0xeb, 0x88, 0x76, 0x76, 0x08, 0xcf, 0x8d, 0xef, 0x7d, 0x34, 0x31, - 0x80, 0x79, 0x91, 0x25, 0xaa, 0x14, 0x9f, 0xd1, 0x22, 0x7e, 0x55, 0x16, 0x37, 0x3b, 0x41, 0x3d, - 0xc2, 0x8e, 0xae, 0x93, 0x93, 0xf6, 0x45, 0xb0, 0x6e, 0x92, 0x74, 0xd7, 0x7d, 0x78, 0x8d, 0x7a, - 0xbb, 0x3e, 0xed, 0x93, 0x91, 0x43, 0x46, 0xf6, 0x75, 0xb8, 0x50, 0xe3, 0x26, 0x91, 0x98, 0xe8, - 0xee, 0xc3, 0x3e, 0x19, 0x09, 0x03, 0xba, 0x8e, 0xa4, 0x04, 0x5f, 0xb4, 0x92, 0xf5, 0x9b, 0xa4, - 0xec, 0x11, 0x2c, 0x73, 0x57, 0xf5, 0x09, 0xf5, 0x76, 0x93, 0xa1, 0x50, 0xb1, 0x01, 0x1d, 0x44, - 0x60, 0x37, 0x19, 0x96, 0x05, 0xa1, 0xc2, 0xe2, 0x2d, 0x06, 0x81, 0xcf, 0x5d, 0x22, 0x5a, 0xc8, - 0xd1, 0x28, 0x2c, 0x3e, 0xed, 0x12, 0x22, 0xf7, 0x47, 0x7c, 0x3e, 0x36, 0x9c, 0x82, 0xb6, 0xff, - 0xd6, 0x84, 0x79, 0x09, 0xa8, 0x98, 0x6a, 0xbc, 0x06, 0x2f, 0xf0, 0x42, 0x0a, 0xb3, 0xe5, 0xe0, - 0xa4, 0xdc, 0x6a, 0x22, 0xa5, 0x6e, 0x4e, 0x1b, 0xfa, 0xe6, 0xb4, 0x62, 0xd3, 0x5c, 0xdd, 0xa6, - 0xca, 0xb8, 0x9a, 0xf5, 0x71, 0xf1, 0xe4, 0x20, 0xd6, 0xcb, 0xfd, 0xc0, 0x4d, 0x0f, 0x59, 0x1c, - 0xca, 0x92, 0xba, 0xe9, 0xd4, 0xf8, 0x3c, 0x21, 0x21, 0xaf, 0xa8, 0x28, 0x70, 0x61, 0xa8, 0x70, - 0x79, 0xfe, 0x46, 0x4e, 0x5e, 0x59, 0xe0, 0x5e, 0x46, 0x67, 0xa2, 0x6d, 0x49, 0xe2, 0x33, 0x2a, - 0x72, 0x1b, 0x16, 0x10, 0x2a, 0x8b, 0x8f, 0x3c, 0x4c, 0x86, 0x37, 0x62, 0x16, 0xca, 0x1d, 0x4d, - 0x4e, 0x8a, 0x91, 0x33, 0x9a, 0xe6, 0x79, 0xb1, 0x83, 0xb2, 0x0a, 0x8b, 0xcb, 0x4a, 0x52, 0x54, - 0x0f, 0x8b, 0x4e, 0x4e, 0x5a, 0x2b, 0xd0, 0x48, 0xc8, 0x48, 0x96, 0x04, 0xfc, 0xa7, 0xe6, 0xb9, - 0x65, 0xdd, 0x73, 0x95, 0x35, 0x7e, 0x45, 0x7c, 0x55, 0xd7, 0xf8, 0x72, 0xe1, 0x5c, 0xd5, 0x16, - 0xce, 0x6b, 0x30, 0xcf, 0x22, 0x1e, 0xe7, 0x49, 0xcf, 0x12, 0x73, 0xec, 0x93, 0x93, 0xe7, 0xd8, - 0x95, 0xbb, 0xd8, 0xf2, 0x3a, 0x4d, 0xe3, 0x47, 0x4e, 0x2e, 0x67, 0xdd, 0x81, 0x65, 0x76, 0x78, - 0x18, 0xf8, 0x94, 0xec, 0x67, 0xc9, 0x91, 0x28, 0xbd, 0x2f, 0x88, 0xa5, 0xc9, 0x1e, 0xb7, 0x34, - 0xe9, 0x2d, 0x9d, 0xaa, 0x28, 0xcf, 0x27, 0x6e, 0x8a, 0xa5, 0x93, 0x98, 0x71, 0x17, 0x37, 0x1a, - 0x3c, 0x9f, 0xa8, 0xbc, 0xf5, 0xd7, 0x60, 0x51, 0x35, 0x85, 0x43, 0x75, 0x4c, 0x1e, 0xc9, 0x38, - 0xe5, 0x3f, 0x79, 0xc6, 0x39, 0x71, 0x83, 0x0c, 0x33, 0xf8, 0x82, 0x83, 0xc4, 0x6b, 0xe6, 0x17, - 0x0c, 0xfb, 0xc7, 0x06, 0x2c, 0x57, 0x8c, 0xe0, 0xad, 0x53, 0x3f, 0x0d, 0x88, 0xd4, 0x80, 0x04, - 0xaf, 0x8e, 0x3c, 0x92, 0x0c, 0x64, 0x98, 0x8b, 0xdf, 0x32, 0xcf, 0x34, 0x8a, 0x3d, 0xaf, 0x0d, - 0x8b, 0xfe, 0xdd, 0x3e, 0x57, 0xd4, 0x67, 0x19, 0xf5, 0x8a, 0x73, 0x2b, 0x85, 0xc7, 0xc3, 0xcc, - 0xbf, 0xdb, 0xdf, 0x72, 0xbd, 0x21, 0xc1, 0xd3, 0xa5, 0xa6, 0xb0, 0x49, 0x67, 0xda, 0x1e, 0x2c, - 0xdc, 0xf3, 0xa3, 0x64, 0x9b, 0x85, 0x21, 0x77, 0x96, 0x47, 0x52, 0x9e, 0xc7, 0x0d, 0x11, 0x13, - 0x92, 0xe2, 0xe1, 0xe4, 0x91, 0x43, 0x37, 0x0b, 0x52, 0xde, 0x34, 0x9f, 0xdc, 0x0a, 0x4b, 0x9c, - 0xab, 0x24, 0x8c, 0xee, 0xa0, 0x34, 0xda, 0xa9, 0x70, 0xec, 0x3f, 0x99, 0xb0, 0x22, 0x76, 0x3f, - 0xdb, 0x22, 0x34, 0x3c, 0x21, 0xf4, 0x0a, 0x34, 0xc5, 0x54, 0x95, 0x19, 0xe5, 0xf4, 0x1d, 0x13, - 0x36, 0xb5, 0xae, 0x42, 0x8b, 0x45, 0x22, 0x0d, 0x61, 0xb2, 0x7b, 0x61, 0x92, 0x90, 0x7e, 0x84, - 0xe5, 0x48, 0x29, 0xeb, 0x06, 0x40, 0x58, 0x66, 0x1d, 0x5c, 0xde, 0xa7, 0xd5, 0xa1, 0x48, 0x72, - 0x70, 0x8b, 0xa5, 0xba, 0x38, 0xc7, 0x6a, 0x38, 0x3a, 0xd3, 0xda, 0x83, 0x25, 0x61, 0xf6, 0xdd, - 0x7c, 0xeb, 0x2c, 0x7c, 0x30, 0x7d, 0x8f, 0x15, 0x69, 0xfb, 0xe7, 0x86, 0x84, 0x91, 0x7f, 0xed, - 0x13, 0xc4, 0xbe, 0x84, 0xc4, 0x98, 0x09, 0x92, 0x75, 0x58, 0x08, 0x33, 0x65, 0x27, 0xdf, 0x70, - 0x0a, 0xba, 0x74, 0x51, 0x63, 0x6a, 0x17, 0xd9, 0xbf, 0x30, 0xa0, 0xf7, 0x06, 0xf3, 0xa9, 0xf8, - 0x70, 0x2d, 0x8a, 0x02, 0x79, 0xd8, 0x3a, 0xb3, 0xcf, 0xbf, 0x02, 0x6d, 0x17, 0xd5, 0xd0, 0x54, - 0xba, 0x7d, 0x8a, 0xdd, 0x79, 0x29, 0xa3, 0x6c, 0xb4, 0x1a, 0xea, 0x46, 0xcb, 0x7e, 0xcf, 0x80, - 0x25, 0x04, 0xe5, 0xcd, 0xcc, 0x4f, 0x67, 0xb6, 0x6f, 0x0b, 0x16, 0x46, 0x99, 0x9f, 0xce, 0x10, - 0x95, 0x85, 0x5c, 0x3d, 0x9e, 0x1a, 0x63, 0xe2, 0xc9, 0x7e, 0xdf, 0x80, 0x4b, 0x55, 0x58, 0xaf, - 0x0d, 0x06, 0x24, 0x7a, 0x92, 0x53, 0x4a, 0xdb, 0x68, 0xce, 0x55, 0x36, 0x9a, 0x63, 0x4d, 0x76, - 0xc8, 0x3b, 0x64, 0xf0, 0xf4, 0x9a, 0xfc, 0x7d, 0x13, 0x3e, 0x72, 0xb3, 0x98, 0x78, 0xf7, 0x62, - 0x97, 0x26, 0x87, 0x24, 0x8e, 0x9f, 0xa0, 0xbd, 0x77, 0xa0, 0x4b, 0xc9, 0x83, 0xd2, 0x26, 0x39, - 0x1d, 0xa7, 0x55, 0xa3, 0x0b, 0x4f, 0xb7, 0x76, 0xd9, 0xff, 0x36, 0x60, 0x05, 0xf5, 0x7c, 0xd5, - 0x1f, 0x1c, 0x3f, 0xc1, 0xc1, 0xef, 0xc1, 0xd2, 0xb1, 0xb0, 0x80, 0x53, 0x33, 0x2c, 0xdb, 0x15, - 0xe9, 0x29, 0x87, 0xff, 0x1f, 0x03, 0x56, 0x51, 0xd1, 0x6d, 0x7a, 0xe2, 0x3f, 0xc9, 0x60, 0xdd, - 0x87, 0x65, 0x1f, 0x4d, 0x98, 0x11, 0x80, 0xaa, 0xf8, 0x94, 0x08, 0xfc, 0xd6, 0x80, 0x65, 0xd4, - 0x74, 0x9d, 0xa6, 0x24, 0x9e, 0x79, 0xfc, 0xb7, 0xa0, 0x43, 0x68, 0x1a, 0xbb, 0x74, 0x96, 0x15, - 0x52, 0x15, 0x9d, 0x72, 0x91, 0x7c, 0xcf, 0x00, 0x4b, 0xa8, 0xda, 0xf1, 0x93, 0xd0, 0x4f, 0x92, - 0x27, 0xe8, 0xba, 0xe9, 0x0c, 0xfe, 0xa9, 0x09, 0x17, 0x15, 0x2d, 0xbb, 0x59, 0xfa, 0xb4, 0x9b, - 0x6c, 0xed, 0x40, 0x9b, 0xd7, 0x08, 0xea, 0x0d, 0xc6, 0xb4, 0x1d, 0x95, 0x82, 0xbc, 0x8a, 0x15, - 0x44, 0x9f, 0x0c, 0x18, 0xf5, 0x12, 0x51, 0x1c, 0x75, 0x1d, 0x8d, 0xc7, 0x97, 0xa1, 0x75, 0x45, - 0xcd, 0xb6, 0x4b, 0x07, 0x24, 0x78, 0x66, 0x20, 0xb2, 0x7f, 0x65, 0xc0, 0x12, 0x36, 0x79, 0xfa, - 0x87, 0xcc, 0x73, 0x3d, 0x06, 0xf2, 0x87, 0xc6, 0x4b, 0x3c, 0xbc, 0xd6, 0x14, 0x2d, 0x6a, 0x5d, - 0xfd, 0xf4, 0x86, 0xd6, 0x2d, 0xe8, 0x0c, 0x8e, 0x5c, 0x3a, 0x9c, 0x29, 0xb8, 0x54, 0x51, 0x3b, - 0x85, 0xe7, 0xd4, 0x43, 0xbb, 0x6d, 0xfc, 0x24, 0x86, 0xff, 0x6a, 0x65, 0x28, 0xa7, 0xde, 0x50, - 0x3e, 0x1e, 0xe8, 0xc7, 0xb0, 0x8a, 0x37, 0x45, 0x4a, 0x4d, 0x68, 0xf5, 0x60, 0xde, 0xf5, 0xf0, - 0x90, 0xc1, 0x10, 0x42, 0x39, 0xa9, 0xdf, 0x01, 0xca, 0x67, 0x1e, 0xe5, 0x1d, 0xe0, 0x65, 0x00, - 0xd7, 0xf3, 0xde, 0x62, 0xb1, 0xe7, 0xd3, 0xbc, 0xc0, 0x57, 0x38, 0xf6, 0x1b, 0xb0, 0x78, 0x23, - 0x66, 0xe1, 0x3d, 0xe5, 0xce, 0xe7, 0xd4, 0x5b, 0x29, 0xf5, 0xbe, 0xc8, 0xd4, 0xef, 0x8b, 0xec, - 0x6f, 0xc1, 0xff, 0xd7, 0x0c, 0x17, 0x60, 0x6d, 0xe3, 0x55, 0x56, 0xde, 0x89, 0x0c, 0x99, 0x8f, - 0x8d, 0x81, 0x4c, 0xb5, 0xc5, 0xd1, 0x84, 0xec, 0xef, 0x19, 0xf0, 0x7c, 0x4d, 0xfd, 0xb5, 0x28, - 0x8a, 0xd9, 0x89, 0xf4, 0xc9, 0x79, 0x74, 0xa3, 0x17, 0xbf, 0x66, 0xb5, 0xf8, 0x1d, 0x6b, 0x84, - 0x56, 0xb0, 0x7f, 0x00, 0x46, 0xfc, 0xd2, 0x80, 0x65, 0x69, 0x84, 0xe7, 0xc9, 0x6e, 0x3f, 0x0f, - 0x2d, 0xbc, 0x06, 0x97, 0x1d, 0x3e, 0x3f, 0xb6, 0xc3, 0xfc, 0xfa, 0xde, 0x91, 0x8d, 0xeb, 0x11, - 0x69, 0x8e, 0x9b, 0x51, 0x5f, 0x2c, 0x82, 0x7d, 0xea, 0x8b, 0x6a, 0x29, 0x60, 0x7f, 0x3d, 0x0f, - 0xe6, 0x1d, 0x12, 0x90, 0xf3, 0xc4, 0xc8, 0xbe, 0x0f, 0x4b, 0xe2, 0x4e, 0xbe, 0xc4, 0xe0, 0x5c, - 0xd4, 0xbe, 0x05, 0x2b, 0x42, 0xed, 0xb9, 0xdb, 0x5b, 0xcc, 0x0e, 0x8e, 0x8f, 0xba, 0x94, 0x9c, - 0x8b, 0xf6, 0xcf, 0xc2, 0x85, 0x1c, 0xfb, 0xfb, 0x91, 0x57, 0x1c, 0x22, 0x4d, 0x38, 0x5e, 0xb7, - 0x3f, 0x07, 0x6b, 0xdb, 0x8c, 0x9e, 0x90, 0x38, 0xc1, 0xcb, 0x07, 0x21, 0x92, 0x4b, 0x68, 0x93, - 0x5f, 0x52, 0xf6, 0x3b, 0xb0, 0xae, 0x4a, 0xf4, 0x49, 0xba, 0x1f, 0xfb, 0x27, 0x8a, 0x94, 0x3c, - 0x7e, 0x36, 0xb4, 0xe3, 0xe7, 0xf2, 0xb8, 0xda, 0xd4, 0x8e, 0xab, 0x2f, 0x41, 0xdb, 0x4f, 0xa4, - 0x02, 0x11, 0x54, 0x0b, 0x4e, 0xc9, 0xb0, 0xfb, 0xb0, 0x2a, 0x6f, 0xc9, 0xf7, 0xdd, 0xa1, 0x4f, - 0x71, 0x05, 0xbc, 0x0c, 0x10, 0xb9, 0xc3, 0xfc, 0x95, 0x0c, 0xde, 0x54, 0x28, 0x1c, 0xfe, 0x3d, - 0x39, 0x62, 0x0f, 0xe4, 0x77, 0x13, 0xbf, 0x97, 0x1c, 0xfb, 0x6b, 0x60, 0x39, 0x24, 0x89, 0x18, - 0x4d, 0x88, 0xa2, 0x75, 0x03, 0x3a, 0xdb, 0x59, 0x1c, 0x13, 0xca, 0xbb, 0xca, 0x9f, 0x8c, 0xa8, - 0x2c, 0xae, 0xb7, 0x5f, 0xea, 0xc5, 0xd3, 0x6d, 0x85, 0x63, 0xff, 0xac, 0x01, 0xed, 0xbe, 0x3f, - 0xa4, 0x6e, 0xe0, 0x90, 0x91, 0xf5, 0x25, 0x68, 0xe1, 0x7e, 0x42, 0xba, 0x71, 0xdc, 0x69, 0x2b, - 0xb6, 0xc6, 0x8d, 0x93, 0x43, 0x46, 0xb7, 0xfe, 0xcf, 0x91, 0x32, 0xd6, 0x9b, 0xd0, 0xc5, 0x5f, - 0xb7, 0xf1, 0x7c, 0x48, 0x26, 0x97, 0x4f, 0x9d, 0xa1, 0x44, 0xb6, 0x46, 0x5d, 0xba, 0x06, 0x6e, - 0xd0, 0x40, 0xd4, 0x1b, 0x72, 0xee, 0x4e, 0x36, 0x08, 0xcb, 0x12, 0x69, 0x10, 0xca, 0x70, 0x69, - 0x57, 0x9c, 0xa0, 0xc8, 0x34, 0x3a, 0x59, 0x1a, 0x0f, 0x5a, 0xa4, 0x34, 0xca, 0x70, 0xe9, 0xa3, - 0x8c, 0x0e, 0xef, 0x47, 0xf2, 0x60, 0x6f, 0xb2, 0xf4, 0x2d, 0xd1, 0x4c, 0x4a, 0xa3, 0x0c, 0x97, - 0x8e, 0xc5, 0xca, 0x2a, 0x40, 0x3f, 0x4d, 0x1a, 0x17, 0x60, 0x29, 0x8d, 0x32, 0x5b, 0x6d, 0x98, - 0x8f, 0xdc, 0x47, 0x01, 0x73, 0x3d, 0xfb, 0xdd, 0x06, 0x40, 0xde, 0x30, 0x11, 0x55, 0x88, 0xe6, - 0xa2, 0xcd, 0x33, 0x5d, 0x14, 0x05, 0x8f, 0x14, 0x27, 0xf5, 0xc7, 0x3b, 0xe9, 0xd3, 0xd3, 0x3a, - 0x09, 0xb5, 0x55, 0xdc, 0x74, 0xb5, 0xe2, 0xa6, 0xcd, 0x33, 0xdd, 0x24, 0x8d, 0x92, 0x8e, 0xba, - 0x5a, 0x71, 0xd4, 0xe6, 0x99, 0x8e, 0x92, 0xf2, 0xd2, 0x55, 0x57, 0x2b, 0xae, 0xda, 0x3c, 0xd3, - 0x55, 0x52, 0x5e, 0x3a, 0xeb, 0x6a, 0xc5, 0x59, 0x9b, 0x67, 0x3a, 0x4b, 0xca, 0xd7, 0xdd, 0xf5, - 0xbe, 0x09, 0x4b, 0x02, 0x32, 0xbc, 0xe9, 0xa3, 0x87, 0x4c, 0x1c, 0xd6, 0x0b, 0xb8, 0xf4, 0x47, - 0x57, 0x3a, 0xd3, 0xfa, 0x0c, 0xac, 0x22, 0x83, 0x28, 0x37, 0x15, 0xa6, 0xb8, 0xa9, 0xa8, 0x7f, - 0x10, 0x77, 0x33, 0x59, 0x92, 0xb2, 0x70, 0xc7, 0x4d, 0xdd, 0xbc, 0x32, 0x2a, 0x39, 0xea, 0xcd, - 0xd9, 0x5c, 0xed, 0x59, 0x67, 0xcc, 0x58, 0x58, 0x5c, 0x89, 0x49, 0x8a, 0x4b, 0xa4, 0x7e, 0x48, - 0x58, 0x96, 0xca, 0x65, 0x22, 0x27, 0xf1, 0x61, 0x84, 0xe7, 0xbb, 0xe2, 0xbe, 0x49, 0xbe, 0x1a, - 0x28, 0x18, 0x62, 0x65, 0x2b, 0xef, 0xcf, 0xe4, 0xb3, 0xcb, 0x92, 0x73, 0xf6, 0x5d, 0x97, 0xfd, - 0x77, 0x03, 0x2e, 0xec, 0xbb, 0x71, 0xea, 0x0f, 0xfc, 0xc8, 0xa5, 0xe9, 0x2e, 0x49, 0x5d, 0x31, - 0x06, 0xed, 0xe5, 0x95, 0xf1, 0x78, 0x2f, 0xaf, 0xf6, 0x61, 0x79, 0xa8, 0x97, 0xfe, 0x8f, 0x59, - 0xb5, 0x57, 0xc5, 0xb5, 0x67, 0x64, 0x8d, 0xc7, 0x7e, 0x46, 0x66, 0xff, 0xd0, 0x84, 0xe5, 0xca, - 0xd2, 0xc9, 0xcb, 0x51, 0x2c, 0x34, 0x8a, 0x98, 0x28, 0x68, 0xeb, 0x1a, 0x80, 0x5f, 0x84, 0xd1, - 0x29, 0x27, 0xe3, 0x7a, 0xac, 0x39, 0x8a, 0xd0, 0xb8, 0x4b, 0xb4, 0xc6, 0xec, 0x97, 0x68, 0xb7, - 0xa0, 0x13, 0x95, 0x4e, 0x3a, 0x65, 0x63, 0x32, 0xc6, 0x95, 0x8e, 0x2a, 0x6a, 0x7f, 0x13, 0x56, - 0x6b, 0x2b, 0x94, 0xb8, 0x2f, 0x63, 0xc7, 0x84, 0x16, 0xf7, 0x65, 0x9c, 0x50, 0x82, 0xd5, 0xac, - 0x06, 0x6b, 0xe0, 0x9f, 0xa8, 0xef, 0x54, 0x25, 0x69, 0xff, 0xc8, 0x84, 0xb5, 0xf1, 0xd9, 0xe5, - 0x59, 0x85, 0xfb, 0x00, 0x7a, 0x93, 0x56, 0xf2, 0x73, 0x43, 0xbd, 0x8c, 0xee, 0x22, 0x0f, 0x3f, - 0xab, 0x70, 0x5f, 0xc8, 0xa3, 0x5b, 0x49, 0x75, 0xf6, 0x6f, 0x0a, 0x7c, 0x8a, 0x4a, 0xe3, 0x19, - 0xc5, 0xc7, 0x7a, 0x09, 0x56, 0x70, 0x98, 0xca, 0xab, 0x0b, 0x2c, 0x5c, 0x6b, 0xfc, 0x72, 0xa5, - 0x50, 0xd2, 0xfe, 0xb9, 0xc5, 0xec, 0x1f, 0x8c, 0xdc, 0x27, 0x45, 0xfd, 0xf6, 0xa1, 0xf2, 0x49, - 0x19, 0x69, 0x4a, 0x51, 0xa3, 0x44, 0x5a, 0x51, 0x57, 0xfe, 0x2f, 0xd2, 0xce, 0x8e, 0xb4, 0x02, - 0x4b, 0xa5, 0xc0, 0xb3, 0xbf, 0x0b, 0xdd, 0x1d, 0x12, 0xec, 0x26, 0xc3, 0xfc, 0xbd, 0xd7, 0x69, - 0x40, 0x4e, 0xfa, 0xbb, 0xcc, 0xc4, 0x97, 0x5e, 0xd5, 0x57, 0x62, 0x73, 0xb5, 0x57, 0x62, 0xf6, - 0x16, 0x2c, 0xa9, 0x06, 0xcc, 0xf2, 0xdc, 0x6d, 0xeb, 0xd2, 0x37, 0xd6, 0xaf, 0xbc, 0x8c, 0x7f, - 0xcc, 0x7a, 0xbd, 0x06, 0xe2, 0x41, 0x4b, 0xfc, 0x51, 0xeb, 0xd5, 0xff, 0x06, 0x00, 0x00, 0xff, - 0xff, 0xf8, 0x91, 0x1b, 0x32, 0xbb, 0x35, 0x00, 0x00, +var fileDescriptor_ws_a65b1a9a9ba03d6e = []byte{ + // 3387 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5b, 0xcf, 0x6f, 0x24, 0x47, + 0xf5, 0xff, 0x76, 0x8f, 0x67, 0xec, 0x79, 0xe3, 0xb1, 0xc7, 0xbd, 0x1b, 0x67, 0xbe, 0x66, 0xb3, + 0x98, 0xce, 0x2a, 0x09, 0x0b, 0x78, 0xa3, 0x0d, 0x91, 0x20, 0x3f, 0x16, 0xf9, 0x47, 0xbc, 0xbb, + 0xc9, 0x8e, 0xed, 0xf4, 0xec, 0x26, 0x88, 0x20, 0x2d, 0xed, 0xe9, 0xf2, 0xb8, 0xe3, 0x9e, 0xae, + 0x76, 0xff, 0xf0, 0xee, 0x72, 0x41, 0x0a, 0x08, 0x71, 0xe3, 0xc4, 0x85, 0x0b, 0x82, 0x0b, 0x02, + 0x45, 0x11, 0x42, 0x20, 0x71, 0x40, 0x08, 0x21, 0x6e, 0x5c, 0x40, 0xe2, 0x82, 0xb8, 0x71, 0xe6, + 0x1f, 0x40, 0x42, 0x02, 0xd5, 0xab, 0xea, 0xee, 0xaa, 0xee, 0x1e, 0x7b, 0xd6, 0xb2, 0xb2, 0x1b, + 0x2d, 0xb7, 0x79, 0xaf, 0xeb, 0xbd, 0x7a, 0xf5, 0xde, 0xa7, 0xea, 0xbd, 0xfa, 0x31, 0x30, 0x1f, + 0x39, 0x07, 0x77, 0xef, 0x45, 0x57, 0xee, 0x45, 0x2b, 0x41, 0x48, 0x63, 0x6a, 0x2c, 0x44, 0x24, + 0x3c, 0x22, 0xe1, 0x5d, 0x3b, 0x70, 0xef, 0x06, 0x76, 0x68, 0x8f, 0xa2, 0xa5, 0xe7, 0xb7, 0x03, + 0xe2, 0xdf, 0xbd, 0xd9, 0xbb, 0x12, 0x1c, 0x0c, 0xaf, 0x60, 0xab, 0x2b, 0xa9, 0x54, 0x68, 0x07, + 0x01, 0x09, 0x85, 0xac, 0xf9, 0xe3, 0x1a, 0x34, 0xaf, 0x87, 0x34, 0x09, 0x6e, 0xfa, 0x7b, 0xd4, + 0xe8, 0xc2, 0xf4, 0x10, 0x89, 0x8d, 0xae, 0xb6, 0xac, 0xbd, 0xd0, 0xb4, 0x52, 0xd2, 0xb8, 0x00, + 0x4d, 0xfc, 0xb9, 0x65, 0x8f, 0x48, 0x57, 0xc7, 0x6f, 0x39, 0xc3, 0x30, 0x61, 0xd6, 0xa7, 0xb1, + 0xbb, 0xe7, 0x0e, 0xec, 0xd8, 0xa5, 0x7e, 0xb7, 0x86, 0x0d, 0x14, 0x1e, 0x6b, 0xe3, 0xfa, 0x71, + 0x48, 0x9d, 0x64, 0x80, 0x6d, 0xa6, 0x78, 0x1b, 0x99, 0xc7, 0xfa, 0xdf, 0xb3, 0x07, 0xe4, 0x8e, + 0x75, 0xab, 0x5b, 0xe7, 0xfd, 0x0b, 0xd2, 0x58, 0x86, 0x16, 0xbd, 0xe7, 0x93, 0xf0, 0x4e, 0x44, + 0xc2, 0x9b, 0x1b, 0xdd, 0x06, 0x7e, 0x95, 0x59, 0xc6, 0x45, 0x80, 0x41, 0x48, 0xec, 0x98, 0xdc, + 0x76, 0x47, 0xa4, 0x3b, 0xbd, 0xac, 0xbd, 0xd0, 0xb6, 0x24, 0x0e, 0xd3, 0x30, 0x22, 0xa3, 0x5d, + 0x12, 0xae, 0xd3, 0xc4, 0x8f, 0xbb, 0x33, 0xd8, 0x40, 0x66, 0x19, 0x73, 0xa0, 0x93, 0xfb, 0xdd, + 0x26, 0xaa, 0xd6, 0xc9, 0x7d, 0x63, 0x11, 0x1a, 0x51, 0x6c, 0xc7, 0x49, 0xd4, 0x85, 0x65, 0xed, + 0x85, 0xba, 0x25, 0x28, 0xe3, 0x12, 0xb4, 0x51, 0x2f, 0x4d, 0xad, 0x69, 0xa1, 0x88, 0xca, 0xcc, + 0x3c, 0x76, 0xfb, 0x41, 0x40, 0xba, 0xb3, 0xa8, 0x20, 0x67, 0x18, 0x97, 0xa1, 0xe3, 0x13, 0xe2, + 0xbc, 0x43, 0xc2, 0xdc, 0x6b, 0x6d, 0x6c, 0x54, 0xe2, 0x9b, 0xdf, 0xd1, 0x61, 0x3e, 0x8b, 0xd1, + 0x26, 0x0d, 0xfb, 0x24, 0x7e, 0x8c, 0x23, 0xc5, 0xbd, 0xd8, 0xc8, 0xbc, 0x78, 0xbd, 0x62, 0xa4, + 0x2c, 0x3a, 0xad, 0xab, 0x9f, 0x5a, 0x19, 0x52, 0x3a, 0xf4, 0x08, 0x87, 0xe2, 0x6e, 0xb2, 0xb7, + 0x72, 0xd3, 0x8f, 0x5f, 0xba, 0xfa, 0x8e, 0xed, 0x25, 0xa4, 0xc2, 0x0d, 0x7f, 0xd3, 0xe1, 0x1c, + 0xba, 0xa1, 0x87, 0x31, 0xdb, 0x4c, 0x3c, 0xef, 0x04, 0xd0, 0x2e, 0x42, 0x23, 0xe1, 0x11, 0xe2, + 0x7e, 0x10, 0x14, 0x73, 0x51, 0x48, 0x3d, 0x72, 0x8b, 0x1c, 0x11, 0x0f, 0x3d, 0x50, 0xb7, 0x72, + 0x86, 0xb1, 0x04, 0x33, 0xef, 0x53, 0xd7, 0x47, 0x18, 0x4d, 0xe1, 0xc7, 0x8c, 0x66, 0xdf, 0x7c, + 0x77, 0x70, 0xe0, 0x33, 0xdf, 0xf2, 0x71, 0x67, 0xb4, 0xec, 0x92, 0x86, 0xea, 0x92, 0xe7, 0x60, + 0xce, 0x0e, 0x82, 0x9e, 0xed, 0x0f, 0x49, 0xc8, 0x3b, 0x9d, 0x46, 0xbd, 0x05, 0x2e, 0x83, 0x30, + 0xeb, 0xa9, 0x4f, 0x93, 0x70, 0x40, 0x10, 0xa1, 0x75, 0x4b, 0xe2, 0x30, 0x3d, 0x34, 0x20, 0xa1, + 0x84, 0x3c, 0x0e, 0xd6, 0x02, 0x57, 0x84, 0x00, 0xb2, 0x10, 0x30, 0xe8, 0x27, 0x31, 0x79, 0xc3, + 0x77, 0x70, 0x50, 0x2d, 0x01, 0xfd, 0x9c, 0x65, 0x7e, 0x57, 0x83, 0xb9, 0x9d, 0x64, 0xd7, 0x73, + 0x07, 0xa8, 0x82, 0xb9, 0x35, 0x77, 0x9e, 0xa6, 0x38, 0x4f, 0x76, 0x81, 0x3e, 0xde, 0x05, 0x35, + 0xd5, 0x05, 0x8b, 0xd0, 0x18, 0x12, 0xdf, 0x21, 0xa1, 0x70, 0xa9, 0xa0, 0x84, 0xa9, 0xf5, 0xd4, + 0x54, 0xf3, 0x0f, 0x3a, 0xcc, 0x7c, 0xcc, 0x26, 0x2c, 0x43, 0x2b, 0xd8, 0xa7, 0x3e, 0xd9, 0x4a, + 0x18, 0xac, 0x84, 0x2d, 0x32, 0xcb, 0x38, 0x0f, 0xf5, 0x5d, 0x37, 0x8c, 0xf7, 0x31, 0xae, 0x6d, + 0x8b, 0x13, 0x8c, 0x4b, 0x46, 0xb6, 0xcb, 0x83, 0xd9, 0xb4, 0x38, 0x21, 0x06, 0x34, 0x93, 0xf9, + 0x5e, 0x5d, 0x96, 0x9a, 0xa5, 0x65, 0xa9, 0x8c, 0x0d, 0xa8, 0xc4, 0xc6, 0x65, 0xe8, 0x0c, 0x3d, + 0xba, 0x6b, 0x7b, 0x16, 0x19, 0x1c, 0xf5, 0xa2, 0xe1, 0x76, 0x10, 0x63, 0x20, 0xeb, 0x56, 0x89, + 0x6f, 0xfe, 0x4b, 0x03, 0xd8, 0x0c, 0x5d, 0xe2, 0x3b, 0xe8, 0xc6, 0xc2, 0xda, 0xa9, 0x95, 0xd7, + 0xce, 0x45, 0x68, 0x84, 0x64, 0x64, 0x87, 0x07, 0xe9, 0x44, 0xe1, 0x54, 0xc1, 0xf8, 0x5a, 0xc9, + 0xf8, 0x57, 0x01, 0xf6, 0xb0, 0x1f, 0xa6, 0x07, 0xdd, 0xca, 0x66, 0x75, 0x29, 0x1d, 0xad, 0xa4, + 0x11, 0xb5, 0xa4, 0xe6, 0x6c, 0x16, 0xda, 0x8e, 0x23, 0xc0, 0x5e, 0xe7, 0xb3, 0x30, 0x63, 0x54, + 0x60, 0xbd, 0x71, 0x0c, 0xd6, 0xa7, 0x33, 0x00, 0xfd, 0x53, 0x83, 0xe6, 0x9a, 0x67, 0x0f, 0x0e, + 0x26, 0x1c, 0xba, 0x3a, 0x44, 0xbd, 0x34, 0xc4, 0xeb, 0xd0, 0xde, 0x65, 0xea, 0xd2, 0x21, 0xa0, + 0x17, 0x5a, 0x57, 0x3f, 0x53, 0x31, 0x4a, 0x75, 0x02, 0x59, 0xaa, 0x9c, 0x3a, 0xdc, 0xa9, 0x93, + 0x87, 0x5b, 0x3f, 0x66, 0xb8, 0xd9, 0xea, 0x6a, 0xfe, 0x45, 0x87, 0x59, 0x5c, 0x14, 0x2d, 0x72, + 0x98, 0x90, 0x28, 0x36, 0x5e, 0x87, 0x99, 0x24, 0x35, 0x55, 0x9b, 0xd4, 0xd4, 0x4c, 0xc4, 0x78, + 0x45, 0x64, 0x0f, 0x94, 0xd7, 0x51, 0xfe, 0x42, 0x85, 0x7c, 0x96, 0x8e, 0xac, 0xbc, 0x39, 0xcb, + 0x1b, 0xfb, 0xb6, 0xef, 0x78, 0xc4, 0x22, 0x51, 0xe2, 0xc5, 0x62, 0x65, 0x55, 0x78, 0x1c, 0x69, + 0x87, 0xbd, 0x68, 0x28, 0xb2, 0x8a, 0xa0, 0x98, 0x77, 0x78, 0x3b, 0xf6, 0x89, 0x0f, 0x3d, 0x67, + 0xb0, 0x49, 0x1d, 0x92, 0x43, 0x8c, 0x10, 0x9f, 0x82, 0x29, 0x99, 0xf7, 0x29, 0xbc, 0xc6, 0x81, + 0xa0, 0xf0, 0x58, 0x88, 0x39, 0x8d, 0x0a, 0x78, 0xe2, 0x97, 0x38, 0xc5, 0xbc, 0x6f, 0xfe, 0xbd, + 0x06, 0x6d, 0x3e, 0x7d, 0x52, 0xa7, 0x5e, 0x64, 0x38, 0xa7, 0x23, 0x05, 0x45, 0x12, 0x87, 0x59, + 0xc1, 0xa8, 0x2d, 0x75, 0x51, 0x52, 0x78, 0x0c, 0x8a, 0x8c, 0xde, 0x54, 0x16, 0x27, 0x99, 0x95, + 0xf6, 0x72, 0x5d, 0x5e, 0xa4, 0x24, 0x0e, 0x5b, 0xf6, 0x62, 0xaa, 0xa0, 0x23, 0xa3, 0x99, 0x6c, + 0x4c, 0xb3, 0xfe, 0x39, 0x3e, 0x24, 0x0e, 0xf3, 0x6f, 0x4c, 0xd3, 0xbe, 0xb9, 0x93, 0x72, 0x06, + 0xd7, 0x2c, 0xfa, 0xe5, 0x69, 0x27, 0xa3, 0x4b, 0x51, 0x6d, 0x1e, 0x1b, 0x55, 0x50, 0xa2, 0xaa, + 0x4e, 0xae, 0x56, 0x69, 0x72, 0x5d, 0x82, 0x36, 0xd7, 0x93, 0x82, 0x7e, 0x96, 0x57, 0x52, 0x0a, + 0x53, 0xc5, 0x46, 0xbb, 0x88, 0x0d, 0x35, 0xba, 0x73, 0x63, 0xa2, 0x3b, 0x9f, 0x45, 0xf7, 0x97, + 0x3a, 0xc0, 0x06, 0x09, 0xec, 0x30, 0x1e, 0x11, 0x3f, 0x66, 0xc3, 0x73, 0x32, 0x2a, 0x0b, 0xae, + 0xc2, 0x93, 0x73, 0x8a, 0xae, 0xe6, 0x14, 0x03, 0xa6, 0xd0, 0xe1, 0x3c, 0x9a, 0xf8, 0x9b, 0x39, + 0x33, 0xb0, 0x43, 0xae, 0x8d, 0x83, 0x3c, 0xa3, 0x59, 0xce, 0xa0, 0xa1, 0x23, 0xb2, 0x4c, 0xdd, + 0xe2, 0x04, 0x9b, 0xfc, 0x79, 0x7f, 0x58, 0x2f, 0x36, 0x78, 0x0e, 0x50, 0xb9, 0x27, 0x96, 0xb8, + 0x97, 0xa1, 0x13, 0x25, 0xbb, 0xf9, 0xe0, 0xb6, 0x92, 0x91, 0x80, 0x7b, 0x89, 0xcf, 0x9c, 0xca, + 0x6b, 0x5f, 0xd6, 0x88, 0xa7, 0xa5, 0x9c, 0x51, 0xac, 0x20, 0xcc, 0x0f, 0x75, 0xe8, 0x6c, 0x87, + 0x43, 0xdb, 0x77, 0xbf, 0x89, 0xc5, 0x18, 0x2e, 0xe0, 0xa7, 0x49, 0xcf, 0xcb, 0xd0, 0x22, 0xfe, + 0xd0, 0x73, 0xa3, 0xfd, 0xad, 0xdc, 0x6f, 0x32, 0x4b, 0x76, 0xf6, 0xd4, 0xb8, 0x04, 0x5e, 0x57, + 0x12, 0xf8, 0x22, 0x34, 0x46, 0x74, 0xd7, 0xf5, 0x52, 0xdc, 0x0b, 0x0a, 0x31, 0x4f, 0x3c, 0x82, + 0x99, 0x3c, 0xc3, 0x7c, 0xca, 0xc8, 0x93, 0xfa, 0x4c, 0x65, 0x52, 0x6f, 0xca, 0x49, 0x5d, 0x75, + 0x3c, 0x94, 0x1c, 0xcf, 0xdd, 0xd5, 0xca, 0xdc, 0xf5, 0x7b, 0x0d, 0x3a, 0xb9, 0xbb, 0x79, 0xbd, + 0x3a, 0xd6, 0x5d, 0x45, 0x04, 0xea, 0x15, 0x08, 0xcc, 0x70, 0x53, 0x93, 0x71, 0xc3, 0x90, 0x46, + 0x23, 0x57, 0x2a, 0xd2, 0x33, 0x9a, 0xf5, 0xe6, 0x11, 0x5b, 0x72, 0x16, 0xa7, 0xa4, 0x4d, 0x4d, + 0x43, 0xd9, 0xd4, 0x14, 0xf3, 0xe8, 0x6f, 0x34, 0x38, 0xcf, 0xa2, 0x5c, 0x1a, 0xc6, 0x36, 0x74, + 0x68, 0x01, 0x09, 0x22, 0xd1, 0x3c, 0x5b, 0x91, 0x28, 0x8a, 0xa0, 0xb1, 0x4a, 0xc2, 0x4c, 0xa1, + 0x53, 0xe8, 0x44, 0x64, 0x9e, 0x2a, 0x85, 0x45, 0x7b, 0xac, 0x92, 0xb0, 0xf9, 0x5b, 0x0d, 0x3a, + 0x3c, 0xb5, 0x49, 0xf3, 0xfc, 0xcc, 0xcd, 0x7e, 0x17, 0xce, 0x17, 0x7b, 0xbe, 0xe5, 0x46, 0x71, + 0x57, 0x5f, 0xae, 0x4d, 0x6a, 0x7a, 0xa5, 0x02, 0x36, 0xd7, 0x9e, 0xde, 0x49, 0x3c, 0xaf, 0x47, + 0xa2, 0xc8, 0x1e, 0x92, 0xb5, 0x07, 0x7d, 0x72, 0xc8, 0x3e, 0x58, 0xe4, 0x70, 0x2c, 0x86, 0x58, + 0x9d, 0x83, 0x85, 0x82, 0x4b, 0xfd, 0x0c, 0x42, 0x32, 0x8b, 0x4d, 0xab, 0x88, 0xeb, 0xe9, 0xd6, + 0x96, 0x6b, 0x2c, 0x85, 0x0a, 0xd2, 0xf8, 0x06, 0xcc, 0x62, 0x0e, 0x17, 0xdd, 0x74, 0xa7, 0x70, + 0x00, 0xaf, 0x55, 0x56, 0x0d, 0x95, 0x56, 0xf1, 0x6a, 0x40, 0xd0, 0x6f, 0xf8, 0x71, 0xf8, 0xc0, + 0x52, 0x34, 0x2e, 0xbd, 0x07, 0x0b, 0xa5, 0x26, 0x46, 0x07, 0x6a, 0x07, 0xe4, 0x81, 0x18, 0x07, + 0xfb, 0x69, 0xbc, 0x08, 0xf5, 0x23, 0xb6, 0xf7, 0x13, 0xd1, 0x5f, 0xaa, 0xb0, 0x40, 0xd8, 0x6c, + 0xf1, 0x86, 0xaf, 0xe8, 0x5f, 0xd2, 0xcc, 0x67, 0xb3, 0x81, 0xc9, 0x63, 0xd4, 0x94, 0x31, 0x9a, + 0x6f, 0x41, 0xab, 0x17, 0x0d, 0x37, 0xec, 0xd8, 0xc6, 0x86, 0xaf, 0x41, 0x6b, 0x94, 0x93, 0xd8, + 0xb8, 0xba, 0x3f, 0x21, 0x64, 0xc9, 0xcd, 0xcd, 0x3f, 0xeb, 0xd0, 0xad, 0x76, 0x45, 0x14, 0x30, + 0x1b, 0x48, 0x18, 0xae, 0x53, 0x87, 0xe0, 0xd0, 0xea, 0x56, 0x4a, 0xb2, 0xd8, 0x91, 0x30, 0x64, + 0x39, 0x4c, 0x14, 0xd9, 0x9c, 0x32, 0x56, 0x60, 0xca, 0x4b, 0xc3, 0x72, 0xbc, 0x15, 0xd8, 0xce, + 0x18, 0x41, 0x07, 0xbd, 0x2b, 0x0d, 0x48, 0xc4, 0x6c, 0x75, 0xe2, 0x98, 0x45, 0x01, 0x0f, 0x9a, + 0xa4, 0x83, 0x07, 0xae, 0xa4, 0x7a, 0x69, 0x00, 0x4f, 0x55, 0x36, 0xad, 0x08, 0xe0, 0x17, 0xd5, + 0x00, 0x5e, 0x1c, 0x3f, 0x94, 0x62, 0x10, 0x03, 0x30, 0xae, 0x93, 0xb8, 0x67, 0xdf, 0x5f, 0xf5, + 0x9d, 0x9e, 0xeb, 0xf7, 0xc9, 0x21, 0x43, 0xfb, 0x32, 0xb4, 0xc4, 0x56, 0x3e, 0x0b, 0x53, 0xd3, + 0x92, 0x59, 0x63, 0x77, 0xf8, 0x85, 0xf9, 0x50, 0x2b, 0xcd, 0x07, 0xf3, 0x1a, 0xcc, 0xca, 0xdd, + 0x61, 0x12, 0xb1, 0xef, 0xf7, 0xc9, 0x21, 0x0e, 0xa8, 0x6d, 0x09, 0x0a, 0xf9, 0xd8, 0x42, 0xec, + 0x0d, 0x04, 0x65, 0xfe, 0x49, 0x87, 0x73, 0x25, 0x93, 0xa3, 0xe0, 0x61, 0xf5, 0xc8, 0x78, 0xa9, + 0x8d, 0xc3, 0xcb, 0x94, 0x82, 0x97, 0x03, 0x58, 0xe0, 0x41, 0x92, 0xba, 0xee, 0xd6, 0x11, 0x00, + 0xaf, 0x57, 0x95, 0xea, 0x65, 0x23, 0x45, 0xec, 0x25, 0x2e, 0x0f, 0x7e, 0x59, 0xef, 0x12, 0x81, + 0xc5, 0xea, 0xc6, 0x15, 0xe1, 0x7f, 0x59, 0x0d, 0xff, 0xa7, 0xab, 0xc2, 0x2f, 0x5b, 0x22, 0xc5, + 0xff, 0x10, 0xe6, 0xd9, 0xa2, 0xda, 0x27, 0xbe, 0xd3, 0x8b, 0x86, 0xe8, 0xc8, 0x65, 0x68, 0x71, + 0xf9, 0x5e, 0x34, 0xcc, 0xb7, 0x6e, 0x12, 0x8b, 0xb5, 0x18, 0x78, 0x2e, 0x5b, 0x3c, 0xb1, 0x85, + 0x58, 0xf4, 0x24, 0x16, 0x4b, 0x90, 0x11, 0x11, 0xa7, 0x1e, 0xcc, 0xbb, 0x35, 0x2b, 0xa3, 0xcd, + 0x0f, 0x1a, 0x30, 0x2d, 0xd0, 0x88, 0x49, 0x91, 0xed, 0x96, 0xb3, 0x65, 0x95, 0x53, 0xbc, 0xae, + 0x1d, 0x1c, 0xe5, 0xf0, 0xe2, 0x94, 0x7c, 0xe4, 0x54, 0x53, 0x8f, 0x9c, 0x0a, 0x36, 0x4d, 0x95, + 0x6d, 0x2a, 0x8c, 0xab, 0x5e, 0x1e, 0x17, 0x2b, 0xe3, 0xb0, 0xb2, 0xd9, 0xf1, 0xec, 0x78, 0x8f, + 0x86, 0x23, 0xb1, 0xf9, 0xad, 0x5b, 0x25, 0x3e, 0x2b, 0x1d, 0x39, 0x2f, 0xab, 0xfd, 0x79, 0x0a, + 0x2f, 0x70, 0x59, 0xa5, 0xcd, 0x39, 0xe9, 0x1e, 0x80, 0x9f, 0x50, 0xa8, 0x4c, 0x6e, 0x5b, 0x14, + 0xb9, 0xd4, 0xc7, 0x2a, 0x94, 0x97, 0xfa, 0x32, 0x8b, 0x8d, 0x7c, 0x14, 0x0d, 0x37, 0x43, 0x3a, + 0x12, 0xe7, 0x14, 0x29, 0x89, 0x23, 0xa7, 0x7e, 0x9c, 0x56, 0xb0, 0xfc, 0x6c, 0x42, 0x66, 0x31, + 0x59, 0x41, 0x62, 0x9d, 0x3f, 0x6b, 0xa5, 0x24, 0xc3, 0x52, 0x44, 0x0e, 0x45, 0xf1, 0xce, 0x7e, + 0x2a, 0x91, 0x9b, 0x57, 0x23, 0x57, 0xa8, 0xc6, 0x3a, 0xf8, 0x55, 0xae, 0xc6, 0xf2, 0x12, 0x67, + 0x41, 0x29, 0x71, 0x56, 0x61, 0x9a, 0x06, 0x6c, 0xfa, 0x47, 0x5d, 0x03, 0xa7, 0xcb, 0xf3, 0xe3, + 0x17, 0xa8, 0x95, 0x6d, 0xde, 0x92, 0x4f, 0x8c, 0x54, 0xce, 0xb8, 0x05, 0xf3, 0x74, 0x6f, 0xcf, + 0x73, 0x7d, 0xb2, 0x93, 0x44, 0xfb, 0xb8, 0x49, 0x3e, 0x87, 0x60, 0x37, 0xab, 0x8a, 0x08, 0xb5, + 0xa5, 0x55, 0x14, 0x65, 0x95, 0x9f, 0x1d, 0xf3, 0x4d, 0x0e, 0x2e, 0x70, 0xe7, 0x71, 0x81, 0x53, + 0x78, 0x78, 0x76, 0x27, 0x2d, 0xf4, 0x4f, 0xa1, 0xe3, 0x64, 0xd6, 0xd2, 0x2b, 0x30, 0x2b, 0x1b, + 0x5b, 0x31, 0x31, 0xcf, 0xcb, 0x13, 0x73, 0x46, 0x9e, 0x77, 0x3f, 0xd0, 0x60, 0xbe, 0x60, 0x26, + 0x6b, 0x1d, 0xbb, 0xb1, 0x47, 0x84, 0x06, 0x4e, 0xb0, 0x9d, 0x8e, 0x43, 0xa2, 0x81, 0x98, 0x08, + 0xf8, 0x5b, 0xd4, 0x8c, 0xb5, 0xec, 0xac, 0xcb, 0x84, 0x59, 0x77, 0xbb, 0xcf, 0x14, 0xf5, 0x69, + 0xe2, 0x3b, 0xd9, 0xc1, 0xb1, 0xc4, 0x63, 0x40, 0x74, 0xb7, 0xfb, 0x6b, 0xb6, 0x33, 0x24, 0xfc, + 0x20, 0xbe, 0x8e, 0x36, 0xa9, 0x4c, 0xd3, 0x81, 0x99, 0xdb, 0x6e, 0x10, 0xad, 0xd3, 0xd1, 0x88, + 0x85, 0xd3, 0x21, 0x31, 0xab, 0xc9, 0x35, 0x1c, 0xbc, 0xa0, 0x98, 0x67, 0x1c, 0xb2, 0x67, 0x27, + 0x5e, 0xcc, 0x9a, 0xa6, 0xd3, 0x5f, 0x62, 0xe1, 0x79, 0x6a, 0x44, 0xfd, 0x0d, 0x2e, 0xcd, 0xed, + 0x94, 0x38, 0xe6, 0x1f, 0x75, 0xe8, 0xe0, 0xea, 0xb6, 0x8e, 0xe0, 0x71, 0x50, 0xe8, 0x2a, 0xd4, + 0x71, 0x32, 0x8b, 0xea, 0xf0, 0xf8, 0xd3, 0x0f, 0xde, 0xd4, 0xb8, 0x06, 0x0d, 0x1a, 0x60, 0x49, + 0xc9, 0x97, 0xbe, 0xe7, 0xc6, 0x09, 0xa9, 0x47, 0xd7, 0x96, 0x90, 0x32, 0x36, 0x01, 0x46, 0x79, + 0x05, 0xc9, 0x0b, 0x81, 0x49, 0x75, 0x48, 0x92, 0xcc, 0xb9, 0x59, 0x8e, 0xcb, 0xce, 0xaf, 0x6b, + 0x96, 0xca, 0x34, 0xb6, 0x60, 0x0e, 0xcd, 0xde, 0x4e, 0x8f, 0xc1, 0x30, 0x06, 0x93, 0xf7, 0x58, + 0x90, 0x36, 0x7f, 0xa2, 0x09, 0x37, 0xb2, 0xaf, 0x7d, 0xc2, 0x7d, 0x9f, 0xbb, 0x44, 0x3b, 0x95, + 0x4b, 0x96, 0x60, 0x66, 0x94, 0x48, 0xa7, 0x72, 0x35, 0x2b, 0xa3, 0xf3, 0x10, 0xd5, 0x26, 0x0e, + 0x91, 0xf9, 0x53, 0x0d, 0xba, 0x6f, 0x52, 0xd7, 0xc7, 0x0f, 0xab, 0x41, 0xe0, 0x89, 0x6b, 0x85, + 0x53, 0xc7, 0xfc, 0x2b, 0xd0, 0xb4, 0xb9, 0x1a, 0x3f, 0x16, 0x61, 0x9f, 0xe0, 0xa4, 0x2d, 0x97, + 0x91, 0x0e, 0x4d, 0x6a, 0xf2, 0xa1, 0x89, 0xf9, 0x91, 0x06, 0x73, 0xdc, 0x29, 0x6f, 0x27, 0x6e, + 0x7c, 0x6a, 0xfb, 0xd6, 0x60, 0xe6, 0x30, 0x71, 0xe3, 0x53, 0xa0, 0x32, 0x93, 0x2b, 0xe3, 0xa9, + 0x56, 0x81, 0x27, 0xf3, 0x17, 0x1a, 0x5c, 0x28, 0xba, 0x75, 0x75, 0x30, 0x20, 0xc1, 0xa3, 0x9c, + 0x52, 0xca, 0xa1, 0xd1, 0x54, 0xe1, 0xd0, 0xa8, 0xd2, 0x64, 0x8b, 0xbc, 0x4f, 0x06, 0x8f, 0xaf, + 0xc9, 0xdf, 0xd6, 0xe1, 0xff, 0xaf, 0x67, 0x13, 0xef, 0x76, 0x68, 0xfb, 0xd1, 0x1e, 0x09, 0xc3, + 0x47, 0x68, 0xef, 0x2d, 0x68, 0xfb, 0xe4, 0x5e, 0x6e, 0x93, 0x98, 0x8e, 0x93, 0xaa, 0x51, 0x85, + 0x27, 0x5b, 0xbb, 0xcc, 0x7f, 0x6b, 0xd0, 0xe1, 0x7a, 0xde, 0x72, 0x07, 0x07, 0x8f, 0x70, 0xf0, + 0x5b, 0x30, 0x77, 0x80, 0x16, 0x30, 0xea, 0x14, 0xcb, 0x76, 0x41, 0x7a, 0xc2, 0xe1, 0xff, 0x47, + 0x83, 0x05, 0xae, 0xe8, 0xa6, 0x7f, 0xe4, 0x3e, 0x4a, 0xb0, 0xee, 0xc0, 0xbc, 0xcb, 0x4d, 0x38, + 0xa5, 0x03, 0x8a, 0xe2, 0x13, 0x7a, 0xe0, 0xd7, 0x1a, 0xcc, 0x73, 0x4d, 0x6f, 0xf8, 0x31, 0x09, + 0x4f, 0x3d, 0xfe, 0x1b, 0xd0, 0x22, 0x7e, 0x1c, 0xda, 0xfe, 0x69, 0x56, 0x48, 0x59, 0x74, 0xc2, + 0x45, 0xf2, 0x23, 0x0d, 0x0c, 0x54, 0xb5, 0xe1, 0x46, 0x23, 0x37, 0x8a, 0x1e, 0x61, 0xe8, 0x26, + 0x33, 0xf8, 0x87, 0x3a, 0x9c, 0x97, 0xb4, 0xf4, 0x92, 0xf8, 0x71, 0x37, 0xd9, 0xd8, 0x80, 0x26, + 0xab, 0x11, 0xe4, 0xdb, 0xc8, 0x49, 0x3b, 0xca, 0x05, 0x59, 0x15, 0x8b, 0x44, 0x9f, 0x0c, 0xa8, + 0xef, 0x44, 0x58, 0x1c, 0xb5, 0x2d, 0x85, 0xc7, 0x96, 0xa1, 0x25, 0x49, 0xcd, 0xba, 0xed, 0x0f, + 0x88, 0xf7, 0xc4, 0xb8, 0xc8, 0xfc, 0xb9, 0x06, 0x73, 0xbc, 0xc9, 0xe3, 0x3f, 0x64, 0x96, 0xeb, + 0x39, 0x90, 0x3f, 0x31, 0x51, 0x62, 0xf0, 0x5a, 0x94, 0xb4, 0xc8, 0x75, 0xf5, 0xe3, 0x0b, 0xad, + 0x1b, 0xd0, 0x1a, 0xec, 0xdb, 0xfe, 0xf0, 0x54, 0xe0, 0x92, 0x45, 0xcd, 0x18, 0x9e, 0x96, 0x0f, + 0xe0, 0xd7, 0xf9, 0x27, 0x1c, 0xfe, 0x4b, 0x85, 0xa1, 0x1c, 0xfb, 0xda, 0xe0, 0xe1, 0x9c, 0x7e, + 0x00, 0x0b, 0xfc, 0xd6, 0x57, 0xaa, 0x09, 0x8d, 0x2e, 0x4c, 0xdb, 0x0e, 0x3f, 0x86, 0xd0, 0x50, + 0x28, 0x25, 0xd5, 0xfb, 0x7c, 0xf1, 0xce, 0x2a, 0xbf, 0xcf, 0xbf, 0x08, 0x60, 0x3b, 0xce, 0xbb, + 0x34, 0x74, 0x5c, 0x3f, 0x2d, 0xf0, 0x25, 0x8e, 0xf9, 0x26, 0xcc, 0x6e, 0x86, 0x74, 0x74, 0x5b, + 0xba, 0xbf, 0x3d, 0xf6, 0x86, 0x59, 0xbe, 0xfb, 0xd5, 0xd5, 0xbb, 0x5f, 0xf3, 0xeb, 0xf0, 0x54, + 0xc9, 0x70, 0x74, 0xd6, 0x3a, 0xbf, 0x96, 0x4e, 0x3b, 0x11, 0x90, 0xa9, 0x3a, 0x97, 0x93, 0x6d, + 0xb1, 0x14, 0x21, 0xf3, 0x03, 0x0d, 0x9e, 0x29, 0xa9, 0x5f, 0x0d, 0x82, 0x90, 0x1e, 0x89, 0x98, + 0x9c, 0x45, 0x37, 0x6a, 0xf1, 0xab, 0x17, 0x8b, 0xdf, 0x4a, 0x23, 0x94, 0x82, 0xfd, 0x63, 0x30, + 0xe2, 0x67, 0x1a, 0xcc, 0x0b, 0x23, 0x1c, 0x47, 0x74, 0xfb, 0x32, 0x34, 0xf8, 0x93, 0x16, 0xd1, + 0xe1, 0x33, 0x95, 0x1d, 0xa6, 0x4f, 0x71, 0x2c, 0xd1, 0xb8, 0x8c, 0x48, 0xbd, 0x6a, 0x46, 0x7d, + 0x39, 0x03, 0xfb, 0xc4, 0x8f, 0x4e, 0x84, 0x80, 0xf9, 0xd5, 0x14, 0xcc, 0x1b, 0xc4, 0x23, 0x67, + 0xe9, 0x23, 0xf3, 0x0e, 0xcc, 0xe1, 0xfb, 0x9a, 0xdc, 0x07, 0x67, 0xa2, 0xf6, 0x5d, 0xe8, 0xa0, + 0xda, 0x33, 0xb7, 0x37, 0x9b, 0x1d, 0xcc, 0x3f, 0xf2, 0x52, 0x72, 0x26, 0xda, 0xbf, 0x00, 0xe7, + 0x52, 0xdf, 0xdf, 0x09, 0x9c, 0xec, 0x10, 0x69, 0xcc, 0x3d, 0x9d, 0xf9, 0x22, 0x2c, 0xae, 0x53, + 0xff, 0x88, 0x84, 0x11, 0xbf, 0x48, 0x44, 0x91, 0x54, 0x42, 0x99, 0xfc, 0x82, 0x32, 0xdf, 0x87, + 0x25, 0x59, 0xa2, 0x4f, 0xe2, 0x9d, 0xd0, 0x3d, 0x92, 0xa4, 0xc4, 0x01, 0xb5, 0xa6, 0x1c, 0x50, + 0xe7, 0x07, 0xda, 0xba, 0x72, 0xa0, 0x7d, 0x01, 0x9a, 0x6e, 0x24, 0x14, 0x20, 0xa8, 0x66, 0xac, + 0x9c, 0x61, 0xda, 0xb0, 0xc0, 0xdd, 0x2f, 0x2e, 0x8c, 0xb0, 0x8b, 0x25, 0x98, 0xe1, 0x98, 0xca, + 0x3a, 0xc9, 0xe8, 0xb1, 0xd7, 0x2f, 0x63, 0x2f, 0x1b, 0xcd, 0x3e, 0x2c, 0x88, 0x47, 0x35, 0x3b, + 0xf6, 0xd0, 0xf5, 0xf9, 0x22, 0x7b, 0x11, 0x20, 0xb0, 0x87, 0xe9, 0x03, 0x3c, 0x7e, 0x6d, 0x26, + 0x71, 0xd8, 0xf7, 0x68, 0x9f, 0xde, 0x13, 0xdf, 0x75, 0xfe, 0x3d, 0xe7, 0x98, 0xef, 0x80, 0x61, + 0x91, 0x28, 0xa0, 0x7e, 0x44, 0x24, 0xad, 0xcb, 0xd0, 0x5a, 0x4f, 0xc2, 0x90, 0xf8, 0xac, 0xab, + 0xf4, 0x85, 0x99, 0xcc, 0x62, 0x7a, 0xfb, 0xb9, 0x5e, 0x7e, 0xc4, 0x2e, 0x71, 0xcc, 0x1f, 0xd5, + 0xa0, 0xd9, 0x77, 0x87, 0xbe, 0xed, 0x59, 0xe4, 0xd0, 0x78, 0x0d, 0x1a, 0x7c, 0xcb, 0x22, 0x90, + 0x52, 0x75, 0xe4, 0xcb, 0x5b, 0xf3, 0xbd, 0x99, 0x45, 0x0e, 0x6f, 0xfc, 0x9f, 0x25, 0x64, 0x8c, + 0xb7, 0xa1, 0xcd, 0x7f, 0xdd, 0xe4, 0x47, 0x50, 0x22, 0x7f, 0x7d, 0xf6, 0x04, 0x25, 0xa2, 0x35, + 0xd7, 0xa5, 0x6a, 0x60, 0x06, 0x0d, 0xb0, 0xa4, 0x11, 0xcb, 0xc3, 0x78, 0x83, 0x78, 0xe5, 0x23, + 0x0c, 0xe2, 0x32, 0x4c, 0xda, 0xc6, 0x43, 0x1a, 0x91, 0xa9, 0xc7, 0x4b, 0xf3, 0xb3, 0x1c, 0x21, + 0xcd, 0x65, 0x98, 0xf4, 0x7e, 0xe2, 0x0f, 0xef, 0x04, 0xe2, 0xec, 0x70, 0xbc, 0xf4, 0x0d, 0x6c, + 0x26, 0xa4, 0xb9, 0x0c, 0x93, 0x0e, 0x71, 0xf1, 0x46, 0xa7, 0x1f, 0x27, 0xcd, 0xd7, 0x78, 0x21, + 0xcd, 0x65, 0xd6, 0x9a, 0x30, 0x1d, 0xd8, 0x0f, 0x3c, 0x6a, 0x3b, 0xe6, 0x87, 0x35, 0x80, 0xb4, + 0x61, 0x84, 0x85, 0x8e, 0x12, 0xa2, 0x4b, 0x27, 0x86, 0x28, 0xf0, 0x1e, 0x48, 0x41, 0xea, 0x57, + 0x07, 0xe9, 0x73, 0x93, 0x06, 0x89, 0x6b, 0x2b, 0x84, 0xe9, 0x5a, 0x21, 0x4c, 0x97, 0x4e, 0x0c, + 0x93, 0x30, 0x4a, 0x04, 0xea, 0x5a, 0x21, 0x50, 0x97, 0x4e, 0x0c, 0x94, 0x90, 0x17, 0xa1, 0xba, + 0x56, 0x08, 0xd5, 0xa5, 0x13, 0x43, 0x25, 0xe4, 0x45, 0xb0, 0xae, 0x15, 0x82, 0x75, 0xe9, 0xc4, + 0x60, 0x09, 0xf9, 0x72, 0xb8, 0xfe, 0xaa, 0xc3, 0x1c, 0xba, 0x8c, 0xdf, 0xc2, 0xfa, 0x7b, 0x14, + 0xef, 0x03, 0xd0, 0x5d, 0xea, 0x1b, 0x4d, 0x95, 0x69, 0x7c, 0x1e, 0x16, 0x38, 0x83, 0x48, 0xd7, + 0x25, 0x3a, 0x5e, 0x97, 0x94, 0x3f, 0xe0, 0x05, 0x51, 0x12, 0xc5, 0x74, 0xb4, 0x61, 0xc7, 0x76, + 0x5a, 0x7c, 0xe5, 0x1c, 0xf9, 0xfa, 0x6e, 0xaa, 0xf4, 0x62, 0x3c, 0xa4, 0x74, 0x94, 0xdd, 0xcb, + 0x09, 0x8a, 0x49, 0xc4, 0xee, 0x88, 0xd0, 0x24, 0x16, 0xcb, 0x44, 0x4a, 0xf2, 0x77, 0x54, 0x8e, + 0x6b, 0xe3, 0xa5, 0x97, 0x78, 0x64, 0x94, 0x31, 0x70, 0x65, 0xcb, 0x2f, 0xf1, 0xc4, 0x8b, 0xee, + 0x9c, 0x33, 0xc1, 0x85, 0x1b, 0x3e, 0xc6, 0x77, 0x63, 0x57, 0x7e, 0x7c, 0x54, 0xb7, 0x14, 0x9e, + 0xf9, 0x0f, 0x0d, 0xce, 0xed, 0xd8, 0x61, 0xec, 0x0e, 0xdc, 0xc0, 0xf6, 0xe3, 0x1e, 0x89, 0x6d, + 0x1c, 0xa7, 0xf2, 0x98, 0x53, 0x7b, 0xb8, 0xc7, 0x9c, 0x3b, 0x30, 0x3f, 0x54, 0x77, 0x20, 0x0f, + 0xb9, 0x79, 0x28, 0x8a, 0x2b, 0x2f, 0x53, 0x6b, 0x0f, 0xfd, 0x32, 0xd5, 0xfc, 0x9e, 0x0e, 0xf3, + 0x85, 0xe5, 0xf5, 0xd8, 0xdc, 0xb4, 0x0a, 0xe0, 0x66, 0x50, 0x3b, 0xe6, 0x80, 0x5e, 0xc5, 0xa3, + 0x25, 0x09, 0x55, 0xdd, 0xf6, 0xd5, 0x4e, 0x7f, 0xdb, 0x77, 0x03, 0x5a, 0x41, 0x1e, 0xa4, 0x63, + 0xf6, 0x47, 0x15, 0xa1, 0xb4, 0x64, 0x51, 0xf3, 0x3d, 0x58, 0x28, 0xad, 0x62, 0x78, 0x6d, 0x47, + 0x0f, 0x88, 0x9f, 0x5d, 0xdb, 0x31, 0x42, 0x02, 0xb4, 0x5e, 0x04, 0xb4, 0xe7, 0x1e, 0xc9, 0xcf, + 0xe4, 0x05, 0x69, 0x7e, 0x5f, 0x87, 0xc5, 0xea, 0x0c, 0xf4, 0xa4, 0xba, 0x7b, 0x17, 0xba, 0xe3, + 0x56, 0xfb, 0x33, 0xf3, 0x7a, 0x8e, 0xee, 0x2c, 0x57, 0x3f, 0xa9, 0xee, 0x3e, 0x97, 0xa2, 0x5b, + 0x4a, 0x87, 0xe6, 0xaf, 0x32, 0xff, 0x64, 0xd5, 0xc8, 0x13, 0xea, 0x1f, 0xe3, 0x32, 0x74, 0xf8, + 0x30, 0xa5, 0xe7, 0x21, 0xbc, 0xb8, 0x2d, 0xf1, 0xf3, 0x95, 0x42, 0x2a, 0x0d, 0xce, 0x0c, 0xb3, + 0xbf, 0xd3, 0xd2, 0x98, 0x64, 0x35, 0xde, 0x27, 0x2a, 0x26, 0x39, 0xd2, 0xa4, 0xc2, 0x47, 0x42, + 0x5a, 0x56, 0x7b, 0xfe, 0x0f, 0x69, 0x27, 0x23, 0x2d, 0xf3, 0xa5, 0x54, 0x04, 0x9a, 0xdf, 0x82, + 0xf6, 0x06, 0xf1, 0x7a, 0xd1, 0x30, 0x7d, 0xbf, 0x7a, 0xa6, 0x9b, 0xc9, 0xe2, 0x2b, 0xbf, 0xa9, + 0xf2, 0x2b, 0xbf, 0x35, 0x98, 0x93, 0x0d, 0x38, 0xcd, 0xfb, 0xcc, 0xb5, 0x0b, 0x5f, 0x5b, 0x5a, + 0x11, 0xff, 0x9e, 0x7d, 0xb5, 0xe4, 0xc4, 0xdd, 0x06, 0xfe, 0x79, 0xf1, 0xa5, 0xff, 0x06, 0x00, + 0x00, 0xff, 0xff, 0x58, 0x4b, 0xb8, 0x00, 0x96, 0x3b, 0x00, 0x00, } diff --git a/pkg/proto/sdk_ws/ws.proto b/pkg/proto/sdk_ws/ws.proto index c2a89652f..5bb67e7f0 100644 --- a/pkg/proto/sdk_ws/ws.proto +++ b/pkg/proto/sdk_ws/ws.proto @@ -1,7 +1,9 @@ syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/wrappers.proto"; option go_package = "./sdk_ws;server_api_params"; package server_api_params; + ////////////////////////////////base/////////////////////////////// @@ -18,6 +20,17 @@ message GroupInfo{ int32 status = 10; string creatorUserID = 11; int32 groupType = 12; + int32 needVerification = 13; +} + +message GroupInfoForSet{ + string groupID = 1; + string groupName = 2; + string notification = 3; + string introduction = 4; + string faceURL = 5; + string ex = 6; + google.protobuf.Int32Value needVerification = 7; } @@ -54,6 +67,7 @@ message UserInfo{ string ex = 8; uint32 createTime = 9; int32 appMangerLevel = 10; + int32 globalRecvMsgOpt = 11; } message FriendInfo{ @@ -170,30 +184,54 @@ message UserInDepartment { ///////////////////////////////////base end///////////////////////////////////// +message PullMessageBySeqListReq{ + string userID = 1; + string operationID = 2; + repeated uint32 seqList = 3; + map groupSeqList = 4; +} + +message seqList { + repeated uint32 seqList = 1; +} + + +message MsgDataList { + repeated MsgData msgDataList = 1; +} message PullMessageBySeqListResp { int32 errCode = 1; string errMsg = 2; repeated MsgData list = 3; + map groupMsgDataList = 4; } -message PullMessageBySeqListReq{ - string userID = 1; - string operationID = 2; - repeated uint32 seqList = 3; -} + + + message GetMaxAndMinSeqReq { + repeated string groupIDList = 1; + string userID = 2; + string operationID =3; +} +message MaxAndMinSeq{ + uint32 maxSeq = 1; + uint32 minSeq = 2; } message GetMaxAndMinSeqResp { uint32 maxSeq = 1; uint32 minSeq = 2; + int32 errCode = 3; + string errMsg = 4; + map groupMaxAndMinSeq = 5; } message UserSendMsgResp { string serverMsgID = 1; string clientMsgID = 2; int64 sendTime = 3; - } + message MsgData { string sendID = 1; string recvID = 2; @@ -214,6 +252,7 @@ message MsgData { map options = 18; OfflinePushInfo offlinePushInfo = 19; repeated string atUserIDList = 20; + bytes msgDataList = 21; } message OfflinePushInfo{ @@ -445,7 +484,12 @@ message ConversationSetPrivateTips{ bool isPrivate = 3; } - +////////////////////message/////////////////////// +message DeleteMessageTips{ + string opUserID = 1; + string userID =2; + repeated uint32 seqList = 3; +} ///cms message RequestPagination { int32 pageNumber = 1; @@ -489,8 +533,9 @@ message InvitationInfo { string roomID = 5; int32 timeout = 6; string mediaType = 7; - int32 platformID = 8; - int32 sessionType = 9; + int32 platformID = 8; + int32 sessionType = 9; + int32 initiateTime = 10; } message ParticipantMetaData{ diff --git a/pkg/proto/user/user.pb.go b/pkg/proto/user/user.pb.go index eeb501ebb..41e69b7f9 100644 --- a/pkg/proto/user/user.pb.go +++ b/pkg/proto/user/user.pb.go @@ -36,7 +36,7 @@ func (m *CommonResp) Reset() { *m = CommonResp{} } func (m *CommonResp) String() string { return proto.CompactTextString(m) } func (*CommonResp) ProtoMessage() {} func (*CommonResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{0} + return fileDescriptor_user_f1112695e0d68005, []int{0} } func (m *CommonResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CommonResp.Unmarshal(m, b) @@ -83,7 +83,7 @@ func (m *DeleteUsersReq) Reset() { *m = DeleteUsersReq{} } func (m *DeleteUsersReq) String() string { return proto.CompactTextString(m) } func (*DeleteUsersReq) ProtoMessage() {} func (*DeleteUsersReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{1} + return fileDescriptor_user_f1112695e0d68005, []int{1} } func (m *DeleteUsersReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteUsersReq.Unmarshal(m, b) @@ -136,7 +136,7 @@ func (m *DeleteUsersResp) Reset() { *m = DeleteUsersResp{} } func (m *DeleteUsersResp) String() string { return proto.CompactTextString(m) } func (*DeleteUsersResp) ProtoMessage() {} func (*DeleteUsersResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{2} + return fileDescriptor_user_f1112695e0d68005, []int{2} } func (m *DeleteUsersResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteUsersResp.Unmarshal(m, b) @@ -182,7 +182,7 @@ func (m *GetAllUserIDReq) Reset() { *m = GetAllUserIDReq{} } func (m *GetAllUserIDReq) String() string { return proto.CompactTextString(m) } func (*GetAllUserIDReq) ProtoMessage() {} func (*GetAllUserIDReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{3} + return fileDescriptor_user_f1112695e0d68005, []int{3} } func (m *GetAllUserIDReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetAllUserIDReq.Unmarshal(m, b) @@ -228,7 +228,7 @@ func (m *GetAllUserIDResp) Reset() { *m = GetAllUserIDResp{} } func (m *GetAllUserIDResp) String() string { return proto.CompactTextString(m) } func (*GetAllUserIDResp) ProtoMessage() {} func (*GetAllUserIDResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{4} + return fileDescriptor_user_f1112695e0d68005, []int{4} } func (m *GetAllUserIDResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetAllUserIDResp.Unmarshal(m, b) @@ -275,7 +275,7 @@ func (m *AccountCheckReq) Reset() { *m = AccountCheckReq{} } func (m *AccountCheckReq) String() string { return proto.CompactTextString(m) } func (*AccountCheckReq) ProtoMessage() {} func (*AccountCheckReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{5} + return fileDescriptor_user_f1112695e0d68005, []int{5} } func (m *AccountCheckReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AccountCheckReq.Unmarshal(m, b) @@ -328,7 +328,7 @@ func (m *AccountCheckResp) Reset() { *m = AccountCheckResp{} } func (m *AccountCheckResp) String() string { return proto.CompactTextString(m) } func (*AccountCheckResp) ProtoMessage() {} func (*AccountCheckResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{6} + return fileDescriptor_user_f1112695e0d68005, []int{6} } func (m *AccountCheckResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AccountCheckResp.Unmarshal(m, b) @@ -374,7 +374,7 @@ func (m *AccountCheckResp_SingleUserStatus) Reset() { *m = AccountCheckR func (m *AccountCheckResp_SingleUserStatus) String() string { return proto.CompactTextString(m) } func (*AccountCheckResp_SingleUserStatus) ProtoMessage() {} func (*AccountCheckResp_SingleUserStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{6, 0} + return fileDescriptor_user_f1112695e0d68005, []int{6, 0} } func (m *AccountCheckResp_SingleUserStatus) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AccountCheckResp_SingleUserStatus.Unmarshal(m, b) @@ -421,7 +421,7 @@ func (m *GetUserInfoReq) Reset() { *m = GetUserInfoReq{} } func (m *GetUserInfoReq) String() string { return proto.CompactTextString(m) } func (*GetUserInfoReq) ProtoMessage() {} func (*GetUserInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{7} + return fileDescriptor_user_f1112695e0d68005, []int{7} } func (m *GetUserInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserInfoReq.Unmarshal(m, b) @@ -474,7 +474,7 @@ func (m *GetUserInfoResp) Reset() { *m = GetUserInfoResp{} } func (m *GetUserInfoResp) String() string { return proto.CompactTextString(m) } func (*GetUserInfoResp) ProtoMessage() {} func (*GetUserInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{8} + return fileDescriptor_user_f1112695e0d68005, []int{8} } func (m *GetUserInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserInfoResp.Unmarshal(m, b) @@ -521,7 +521,7 @@ func (m *UpdateUserInfoReq) Reset() { *m = UpdateUserInfoReq{} } func (m *UpdateUserInfoReq) String() string { return proto.CompactTextString(m) } func (*UpdateUserInfoReq) ProtoMessage() {} func (*UpdateUserInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{9} + return fileDescriptor_user_f1112695e0d68005, []int{9} } func (m *UpdateUserInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateUserInfoReq.Unmarshal(m, b) @@ -573,7 +573,7 @@ func (m *UpdateUserInfoResp) Reset() { *m = UpdateUserInfoResp{} } func (m *UpdateUserInfoResp) String() string { return proto.CompactTextString(m) } func (*UpdateUserInfoResp) ProtoMessage() {} func (*UpdateUserInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{10} + return fileDescriptor_user_f1112695e0d68005, []int{10} } func (m *UpdateUserInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateUserInfoResp.Unmarshal(m, b) @@ -600,6 +600,98 @@ func (m *UpdateUserInfoResp) GetCommonResp() *CommonResp { return nil } +type SetGlobalRecvMessageOptReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + GlobalRecvMsgOpt int32 `protobuf:"varint,3,opt,name=globalRecvMsgOpt" json:"globalRecvMsgOpt,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetGlobalRecvMessageOptReq) Reset() { *m = SetGlobalRecvMessageOptReq{} } +func (m *SetGlobalRecvMessageOptReq) String() string { return proto.CompactTextString(m) } +func (*SetGlobalRecvMessageOptReq) ProtoMessage() {} +func (*SetGlobalRecvMessageOptReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_f1112695e0d68005, []int{11} +} +func (m *SetGlobalRecvMessageOptReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetGlobalRecvMessageOptReq.Unmarshal(m, b) +} +func (m *SetGlobalRecvMessageOptReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetGlobalRecvMessageOptReq.Marshal(b, m, deterministic) +} +func (dst *SetGlobalRecvMessageOptReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetGlobalRecvMessageOptReq.Merge(dst, src) +} +func (m *SetGlobalRecvMessageOptReq) XXX_Size() int { + return xxx_messageInfo_SetGlobalRecvMessageOptReq.Size(m) +} +func (m *SetGlobalRecvMessageOptReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetGlobalRecvMessageOptReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetGlobalRecvMessageOptReq proto.InternalMessageInfo + +func (m *SetGlobalRecvMessageOptReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *SetGlobalRecvMessageOptReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *SetGlobalRecvMessageOptReq) GetGlobalRecvMsgOpt() int32 { + if m != nil { + return m.GlobalRecvMsgOpt + } + return 0 +} + +type SetGlobalRecvMessageOptResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetGlobalRecvMessageOptResp) Reset() { *m = SetGlobalRecvMessageOptResp{} } +func (m *SetGlobalRecvMessageOptResp) String() string { return proto.CompactTextString(m) } +func (*SetGlobalRecvMessageOptResp) ProtoMessage() {} +func (*SetGlobalRecvMessageOptResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_f1112695e0d68005, []int{12} +} +func (m *SetGlobalRecvMessageOptResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetGlobalRecvMessageOptResp.Unmarshal(m, b) +} +func (m *SetGlobalRecvMessageOptResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetGlobalRecvMessageOptResp.Marshal(b, m, deterministic) +} +func (dst *SetGlobalRecvMessageOptResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetGlobalRecvMessageOptResp.Merge(dst, src) +} +func (m *SetGlobalRecvMessageOptResp) XXX_Size() int { + return xxx_messageInfo_SetGlobalRecvMessageOptResp.Size(m) +} +func (m *SetGlobalRecvMessageOptResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetGlobalRecvMessageOptResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetGlobalRecvMessageOptResp proto.InternalMessageInfo + +func (m *SetGlobalRecvMessageOptResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + type Conversation struct { OwnerUserID string `protobuf:"bytes,1,opt,name=OwnerUserID" json:"OwnerUserID,omitempty"` ConversationID string `protobuf:"bytes,2,opt,name=ConversationID" json:"ConversationID,omitempty"` @@ -624,7 +716,7 @@ func (m *Conversation) Reset() { *m = Conversation{} } func (m *Conversation) String() string { return proto.CompactTextString(m) } func (*Conversation) ProtoMessage() {} func (*Conversation) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{11} + return fileDescriptor_user_f1112695e0d68005, []int{13} } func (m *Conversation) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Conversation.Unmarshal(m, b) @@ -755,7 +847,7 @@ func (m *SetConversationReq) Reset() { *m = SetConversationReq{} } func (m *SetConversationReq) String() string { return proto.CompactTextString(m) } func (*SetConversationReq) ProtoMessage() {} func (*SetConversationReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{12} + return fileDescriptor_user_f1112695e0d68005, []int{14} } func (m *SetConversationReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetConversationReq.Unmarshal(m, b) @@ -807,7 +899,7 @@ func (m *SetConversationResp) Reset() { *m = SetConversationResp{} } func (m *SetConversationResp) String() string { return proto.CompactTextString(m) } func (*SetConversationResp) ProtoMessage() {} func (*SetConversationResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{13} + return fileDescriptor_user_f1112695e0d68005, []int{15} } func (m *SetConversationResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetConversationResp.Unmarshal(m, b) @@ -849,7 +941,7 @@ func (m *SetRecvMsgOptReq) Reset() { *m = SetRecvMsgOptReq{} } func (m *SetRecvMsgOptReq) String() string { return proto.CompactTextString(m) } func (*SetRecvMsgOptReq) ProtoMessage() {} func (*SetRecvMsgOptReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{14} + return fileDescriptor_user_f1112695e0d68005, []int{16} } func (m *SetRecvMsgOptReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetRecvMsgOptReq.Unmarshal(m, b) @@ -915,7 +1007,7 @@ func (m *SetRecvMsgOptResp) Reset() { *m = SetRecvMsgOptResp{} } func (m *SetRecvMsgOptResp) String() string { return proto.CompactTextString(m) } func (*SetRecvMsgOptResp) ProtoMessage() {} func (*SetRecvMsgOptResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{15} + return fileDescriptor_user_f1112695e0d68005, []int{17} } func (m *SetRecvMsgOptResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetRecvMsgOptResp.Unmarshal(m, b) @@ -955,7 +1047,7 @@ func (m *GetConversationReq) Reset() { *m = GetConversationReq{} } func (m *GetConversationReq) String() string { return proto.CompactTextString(m) } func (*GetConversationReq) ProtoMessage() {} func (*GetConversationReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{16} + return fileDescriptor_user_f1112695e0d68005, []int{18} } func (m *GetConversationReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetConversationReq.Unmarshal(m, b) @@ -1008,7 +1100,7 @@ func (m *GetConversationResp) Reset() { *m = GetConversationResp{} } func (m *GetConversationResp) String() string { return proto.CompactTextString(m) } func (*GetConversationResp) ProtoMessage() {} func (*GetConversationResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{17} + return fileDescriptor_user_f1112695e0d68005, []int{19} } func (m *GetConversationResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetConversationResp.Unmarshal(m, b) @@ -1055,7 +1147,7 @@ func (m *GetConversationsReq) Reset() { *m = GetConversationsReq{} } func (m *GetConversationsReq) String() string { return proto.CompactTextString(m) } func (*GetConversationsReq) ProtoMessage() {} func (*GetConversationsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{18} + return fileDescriptor_user_f1112695e0d68005, []int{20} } func (m *GetConversationsReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetConversationsReq.Unmarshal(m, b) @@ -1108,7 +1200,7 @@ func (m *GetConversationsResp) Reset() { *m = GetConversationsResp{} } func (m *GetConversationsResp) String() string { return proto.CompactTextString(m) } func (*GetConversationsResp) ProtoMessage() {} func (*GetConversationsResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{19} + return fileDescriptor_user_f1112695e0d68005, []int{21} } func (m *GetConversationsResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetConversationsResp.Unmarshal(m, b) @@ -1154,7 +1246,7 @@ func (m *GetAllConversationsReq) Reset() { *m = GetAllConversationsReq{} func (m *GetAllConversationsReq) String() string { return proto.CompactTextString(m) } func (*GetAllConversationsReq) ProtoMessage() {} func (*GetAllConversationsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{20} + return fileDescriptor_user_f1112695e0d68005, []int{22} } func (m *GetAllConversationsReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetAllConversationsReq.Unmarshal(m, b) @@ -1200,7 +1292,7 @@ func (m *GetAllConversationsResp) Reset() { *m = GetAllConversationsResp func (m *GetAllConversationsResp) String() string { return proto.CompactTextString(m) } func (*GetAllConversationsResp) ProtoMessage() {} func (*GetAllConversationsResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{21} + return fileDescriptor_user_f1112695e0d68005, []int{23} } func (m *GetAllConversationsResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetAllConversationsResp.Unmarshal(m, b) @@ -1248,7 +1340,7 @@ func (m *BatchSetConversationsReq) Reset() { *m = BatchSetConversationsR func (m *BatchSetConversationsReq) String() string { return proto.CompactTextString(m) } func (*BatchSetConversationsReq) ProtoMessage() {} func (*BatchSetConversationsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{22} + return fileDescriptor_user_f1112695e0d68005, []int{24} } func (m *BatchSetConversationsReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BatchSetConversationsReq.Unmarshal(m, b) @@ -1309,7 +1401,7 @@ func (m *BatchSetConversationsResp) Reset() { *m = BatchSetConversations func (m *BatchSetConversationsResp) String() string { return proto.CompactTextString(m) } func (*BatchSetConversationsResp) ProtoMessage() {} func (*BatchSetConversationsResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{23} + return fileDescriptor_user_f1112695e0d68005, []int{25} } func (m *BatchSetConversationsResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BatchSetConversationsResp.Unmarshal(m, b) @@ -1362,7 +1454,7 @@ func (m *ResignUserReq) Reset() { *m = ResignUserReq{} } func (m *ResignUserReq) String() string { return proto.CompactTextString(m) } func (*ResignUserReq) ProtoMessage() {} func (*ResignUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{24} + return fileDescriptor_user_f1112695e0d68005, []int{26} } func (m *ResignUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ResignUserReq.Unmarshal(m, b) @@ -1407,7 +1499,7 @@ func (m *ResignUserResp) Reset() { *m = ResignUserResp{} } func (m *ResignUserResp) String() string { return proto.CompactTextString(m) } func (*ResignUserResp) ProtoMessage() {} func (*ResignUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{25} + return fileDescriptor_user_f1112695e0d68005, []int{27} } func (m *ResignUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ResignUserResp.Unmarshal(m, b) @@ -1446,7 +1538,7 @@ func (m *GetUserByIdReq) Reset() { *m = GetUserByIdReq{} } func (m *GetUserByIdReq) String() string { return proto.CompactTextString(m) } func (*GetUserByIdReq) ProtoMessage() {} func (*GetUserByIdReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{26} + return fileDescriptor_user_f1112695e0d68005, []int{28} } func (m *GetUserByIdReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserByIdReq.Unmarshal(m, b) @@ -1495,7 +1587,7 @@ func (m *User) Reset() { *m = User{} } func (m *User) String() string { return proto.CompactTextString(m) } func (*User) ProtoMessage() {} func (*User) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{27} + return fileDescriptor_user_f1112695e0d68005, []int{29} } func (m *User) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_User.Unmarshal(m, b) @@ -1562,7 +1654,7 @@ func (m *GetUserByIdResp) Reset() { *m = GetUserByIdResp{} } func (m *GetUserByIdResp) String() string { return proto.CompactTextString(m) } func (*GetUserByIdResp) ProtoMessage() {} func (*GetUserByIdResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{28} + return fileDescriptor_user_f1112695e0d68005, []int{30} } func (m *GetUserByIdResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserByIdResp.Unmarshal(m, b) @@ -1609,7 +1701,7 @@ func (m *GetUsersByNameReq) Reset() { *m = GetUsersByNameReq{} } func (m *GetUsersByNameReq) String() string { return proto.CompactTextString(m) } func (*GetUsersByNameReq) ProtoMessage() {} func (*GetUsersByNameReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{29} + return fileDescriptor_user_f1112695e0d68005, []int{31} } func (m *GetUsersByNameReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersByNameReq.Unmarshal(m, b) @@ -1663,7 +1755,7 @@ func (m *GetUsersByNameResp) Reset() { *m = GetUsersByNameResp{} } func (m *GetUsersByNameResp) String() string { return proto.CompactTextString(m) } func (*GetUsersByNameResp) ProtoMessage() {} func (*GetUsersByNameResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{30} + return fileDescriptor_user_f1112695e0d68005, []int{32} } func (m *GetUsersByNameResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersByNameResp.Unmarshal(m, b) @@ -1720,7 +1812,7 @@ func (m *AlterUserReq) Reset() { *m = AlterUserReq{} } func (m *AlterUserReq) String() string { return proto.CompactTextString(m) } func (*AlterUserReq) ProtoMessage() {} func (*AlterUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{31} + return fileDescriptor_user_f1112695e0d68005, []int{33} } func (m *AlterUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AlterUserReq.Unmarshal(m, b) @@ -1793,7 +1885,7 @@ func (m *AlterUserResp) Reset() { *m = AlterUserResp{} } func (m *AlterUserResp) String() string { return proto.CompactTextString(m) } func (*AlterUserResp) ProtoMessage() {} func (*AlterUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{32} + return fileDescriptor_user_f1112695e0d68005, []int{34} } func (m *AlterUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AlterUserResp.Unmarshal(m, b) @@ -1833,7 +1925,7 @@ func (m *GetUsersReq) Reset() { *m = GetUsersReq{} } func (m *GetUsersReq) String() string { return proto.CompactTextString(m) } func (*GetUsersReq) ProtoMessage() {} func (*GetUsersReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{33} + return fileDescriptor_user_f1112695e0d68005, []int{35} } func (m *GetUsersReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersReq.Unmarshal(m, b) @@ -1888,7 +1980,7 @@ func (m *GetUsersResp) Reset() { *m = GetUsersResp{} } func (m *GetUsersResp) String() string { return proto.CompactTextString(m) } func (*GetUsersResp) ProtoMessage() {} func (*GetUsersResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{34} + return fileDescriptor_user_f1112695e0d68005, []int{36} } func (m *GetUsersResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersResp.Unmarshal(m, b) @@ -1951,7 +2043,7 @@ func (m *AddUserReq) Reset() { *m = AddUserReq{} } func (m *AddUserReq) String() string { return proto.CompactTextString(m) } func (*AddUserReq) ProtoMessage() {} func (*AddUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{35} + return fileDescriptor_user_f1112695e0d68005, []int{37} } func (m *AddUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddUserReq.Unmarshal(m, b) @@ -2017,7 +2109,7 @@ func (m *AddUserResp) Reset() { *m = AddUserResp{} } func (m *AddUserResp) String() string { return proto.CompactTextString(m) } func (*AddUserResp) ProtoMessage() {} func (*AddUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{36} + return fileDescriptor_user_f1112695e0d68005, []int{38} } func (m *AddUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddUserResp.Unmarshal(m, b) @@ -2058,7 +2150,7 @@ func (m *BlockUserReq) Reset() { *m = BlockUserReq{} } func (m *BlockUserReq) String() string { return proto.CompactTextString(m) } func (*BlockUserReq) ProtoMessage() {} func (*BlockUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{37} + return fileDescriptor_user_f1112695e0d68005, []int{39} } func (m *BlockUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlockUserReq.Unmarshal(m, b) @@ -2117,7 +2209,7 @@ func (m *BlockUserResp) Reset() { *m = BlockUserResp{} } func (m *BlockUserResp) String() string { return proto.CompactTextString(m) } func (*BlockUserResp) ProtoMessage() {} func (*BlockUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{38} + return fileDescriptor_user_f1112695e0d68005, []int{40} } func (m *BlockUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlockUserResp.Unmarshal(m, b) @@ -2157,7 +2249,7 @@ func (m *UnBlockUserReq) Reset() { *m = UnBlockUserReq{} } func (m *UnBlockUserReq) String() string { return proto.CompactTextString(m) } func (*UnBlockUserReq) ProtoMessage() {} func (*UnBlockUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{39} + return fileDescriptor_user_f1112695e0d68005, []int{41} } func (m *UnBlockUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UnBlockUserReq.Unmarshal(m, b) @@ -2209,7 +2301,7 @@ func (m *UnBlockUserResp) Reset() { *m = UnBlockUserResp{} } func (m *UnBlockUserResp) String() string { return proto.CompactTextString(m) } func (*UnBlockUserResp) ProtoMessage() {} func (*UnBlockUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{40} + return fileDescriptor_user_f1112695e0d68005, []int{42} } func (m *UnBlockUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UnBlockUserResp.Unmarshal(m, b) @@ -2249,7 +2341,7 @@ func (m *GetBlockUsersReq) Reset() { *m = GetBlockUsersReq{} } func (m *GetBlockUsersReq) String() string { return proto.CompactTextString(m) } func (*GetBlockUsersReq) ProtoMessage() {} func (*GetBlockUsersReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{41} + return fileDescriptor_user_f1112695e0d68005, []int{43} } func (m *GetBlockUsersReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetBlockUsersReq.Unmarshal(m, b) @@ -2303,7 +2395,7 @@ func (m *BlockUser) Reset() { *m = BlockUser{} } func (m *BlockUser) String() string { return proto.CompactTextString(m) } func (*BlockUser) ProtoMessage() {} func (*BlockUser) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{42} + return fileDescriptor_user_f1112695e0d68005, []int{44} } func (m *BlockUser) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlockUser.Unmarshal(m, b) @@ -2358,7 +2450,7 @@ func (m *GetBlockUsersResp) Reset() { *m = GetBlockUsersResp{} } func (m *GetBlockUsersResp) String() string { return proto.CompactTextString(m) } func (*GetBlockUsersResp) ProtoMessage() {} func (*GetBlockUsersResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{43} + return fileDescriptor_user_f1112695e0d68005, []int{45} } func (m *GetBlockUsersResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetBlockUsersResp.Unmarshal(m, b) @@ -2418,7 +2510,7 @@ func (m *GetBlockUserByIdReq) Reset() { *m = GetBlockUserByIdReq{} } func (m *GetBlockUserByIdReq) String() string { return proto.CompactTextString(m) } func (*GetBlockUserByIdReq) ProtoMessage() {} func (*GetBlockUserByIdReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{44} + return fileDescriptor_user_f1112695e0d68005, []int{46} } func (m *GetBlockUserByIdReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetBlockUserByIdReq.Unmarshal(m, b) @@ -2463,7 +2555,7 @@ func (m *GetBlockUserByIdResp) Reset() { *m = GetBlockUserByIdResp{} } func (m *GetBlockUserByIdResp) String() string { return proto.CompactTextString(m) } func (*GetBlockUserByIdResp) ProtoMessage() {} func (*GetBlockUserByIdResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{45} + return fileDescriptor_user_f1112695e0d68005, []int{47} } func (m *GetBlockUserByIdResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetBlockUserByIdResp.Unmarshal(m, b) @@ -2503,7 +2595,7 @@ func (m *DeleteUserReq) Reset() { *m = DeleteUserReq{} } func (m *DeleteUserReq) String() string { return proto.CompactTextString(m) } func (*DeleteUserReq) ProtoMessage() {} func (*DeleteUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{46} + return fileDescriptor_user_f1112695e0d68005, []int{48} } func (m *DeleteUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteUserReq.Unmarshal(m, b) @@ -2555,7 +2647,7 @@ func (m *DeleteUserResp) Reset() { *m = DeleteUserResp{} } func (m *DeleteUserResp) String() string { return proto.CompactTextString(m) } func (*DeleteUserResp) ProtoMessage() {} func (*DeleteUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{47} + return fileDescriptor_user_f1112695e0d68005, []int{49} } func (m *DeleteUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteUserResp.Unmarshal(m, b) @@ -2595,6 +2687,8 @@ func init() { proto.RegisterType((*GetUserInfoResp)(nil), "user.GetUserInfoResp") proto.RegisterType((*UpdateUserInfoReq)(nil), "user.UpdateUserInfoReq") proto.RegisterType((*UpdateUserInfoResp)(nil), "user.UpdateUserInfoResp") + proto.RegisterType((*SetGlobalRecvMessageOptReq)(nil), "user.SetGlobalRecvMessageOptReq") + proto.RegisterType((*SetGlobalRecvMessageOptResp)(nil), "user.SetGlobalRecvMessageOptResp") proto.RegisterType((*Conversation)(nil), "user.Conversation") proto.RegisterType((*SetConversationReq)(nil), "user.SetConversationReq") proto.RegisterType((*SetConversationResp)(nil), "user.SetConversationResp") @@ -2647,6 +2741,7 @@ const _ = grpc.SupportPackageIsVersion4 type UserClient interface { GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*UpdateUserInfoResp, error) + SetGlobalRecvMessageOpt(ctx context.Context, in *SetGlobalRecvMessageOptReq, opts ...grpc.CallOption) (*SetGlobalRecvMessageOptResp, error) DeleteUsers(ctx context.Context, in *DeleteUsersReq, opts ...grpc.CallOption) (*DeleteUsersResp, error) GetAllUserID(ctx context.Context, in *GetAllUserIDReq, opts ...grpc.CallOption) (*GetAllUserIDResp, error) AccountCheck(ctx context.Context, in *AccountCheckReq, opts ...grpc.CallOption) (*AccountCheckResp, error) @@ -2695,6 +2790,15 @@ func (c *userClient) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, return out, nil } +func (c *userClient) SetGlobalRecvMessageOpt(ctx context.Context, in *SetGlobalRecvMessageOptReq, opts ...grpc.CallOption) (*SetGlobalRecvMessageOptResp, error) { + out := new(SetGlobalRecvMessageOptResp) + err := grpc.Invoke(ctx, "/user.user/SetGlobalRecvMessageOpt", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *userClient) DeleteUsers(ctx context.Context, in *DeleteUsersReq, opts ...grpc.CallOption) (*DeleteUsersResp, error) { out := new(DeleteUsersResp) err := grpc.Invoke(ctx, "/user.user/DeleteUsers", in, out, c.cc, opts...) @@ -2880,6 +2984,7 @@ func (c *userClient) DeleteUser(ctx context.Context, in *DeleteUserReq, opts ... type UserServer interface { GetUserInfo(context.Context, *GetUserInfoReq) (*GetUserInfoResp, error) UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*UpdateUserInfoResp, error) + SetGlobalRecvMessageOpt(context.Context, *SetGlobalRecvMessageOptReq) (*SetGlobalRecvMessageOptResp, error) DeleteUsers(context.Context, *DeleteUsersReq) (*DeleteUsersResp, error) GetAllUserID(context.Context, *GetAllUserIDReq) (*GetAllUserIDResp, error) AccountCheck(context.Context, *AccountCheckReq) (*AccountCheckResp, error) @@ -2942,6 +3047,24 @@ func _User_UpdateUserInfo_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _User_SetGlobalRecvMessageOpt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetGlobalRecvMessageOptReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).SetGlobalRecvMessageOpt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/SetGlobalRecvMessageOpt", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).SetGlobalRecvMessageOpt(ctx, req.(*SetGlobalRecvMessageOptReq)) + } + return interceptor(ctx, in, info, handler) +} + func _User_DeleteUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteUsersReq) if err := dec(in); err != nil { @@ -3314,6 +3437,10 @@ var _User_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateUserInfo", Handler: _User_UpdateUserInfo_Handler, }, + { + MethodName: "SetGlobalRecvMessageOpt", + Handler: _User_SetGlobalRecvMessageOpt_Handler, + }, { MethodName: "DeleteUsers", Handler: _User_DeleteUsers_Handler, @@ -3399,125 +3526,129 @@ var _User_serviceDesc = grpc.ServiceDesc{ Metadata: "user/user.proto", } -func init() { proto.RegisterFile("user/user.proto", fileDescriptor_user_e11c6a5241e13fcd) } +func init() { proto.RegisterFile("user/user.proto", fileDescriptor_user_f1112695e0d68005) } -var fileDescriptor_user_e11c6a5241e13fcd = []byte{ - // 1857 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xdd, 0x4f, 0x24, 0x4b, - 0x15, 0x4f, 0xcf, 0xc7, 0x02, 0x67, 0x98, 0x61, 0x28, 0xb8, 0xd0, 0xb7, 0x55, 0xc4, 0xce, 0xf5, - 0x4a, 0x48, 0x04, 0x5d, 0x8d, 0x6b, 0xd6, 0xe8, 0x2e, 0x33, 0xb0, 0x64, 0x8c, 0x0b, 0x93, 0x9e, - 0x25, 0x31, 0xc6, 0x84, 0xf4, 0xce, 0x14, 0xd0, 0x61, 0xa6, 0xbb, 0xb7, 0xab, 0x87, 0x5d, 0x7c, - 0x59, 0xe3, 0xc7, 0x8b, 0xf1, 0xc5, 0xa7, 0x5d, 0x7d, 0xf0, 0xef, 0xf0, 0x5d, 0x9f, 0xfc, 0x0f, - 0xf4, 0xc5, 0x7f, 0xc5, 0xd4, 0x47, 0x77, 0x57, 0x55, 0x37, 0x30, 0xb7, 0x21, 0xfb, 0x02, 0x53, - 0xa7, 0xbe, 0x7e, 0xe7, 0x9c, 0xdf, 0x39, 0x75, 0xaa, 0x1a, 0x96, 0xa6, 0x04, 0x47, 0xbb, 0xf4, - 0xcf, 0x4e, 0x18, 0x05, 0x71, 0x80, 0x6a, 0xf4, 0xb7, 0xf5, 0xad, 0xe3, 0x10, 0xfb, 0xa7, 0xbd, - 0x97, 0xbb, 0xe1, 0xe5, 0xf9, 0x2e, 0xeb, 0xd8, 0x25, 0xa3, 0xcb, 0xd3, 0xb7, 0x64, 0xf7, 0x2d, - 0xe1, 0x03, 0xed, 0x9f, 0x01, 0x74, 0x83, 0xc9, 0x24, 0xf0, 0x1d, 0x4c, 0x42, 0x64, 0xc2, 0x1c, - 0x8e, 0xa2, 0x6e, 0x30, 0xc2, 0xa6, 0xb1, 0x69, 0x6c, 0xd5, 0x9d, 0xa4, 0x89, 0xd6, 0xe0, 0x11, - 0x8e, 0xa2, 0x97, 0xe4, 0xdc, 0xac, 0x6c, 0x1a, 0x5b, 0x0b, 0x8e, 0x68, 0xd9, 0xbf, 0x81, 0xd6, - 0x3e, 0x1e, 0xe3, 0x18, 0x9f, 0x10, 0x1c, 0x11, 0x07, 0xbf, 0x41, 0xdb, 0xd0, 0xce, 0x24, 0xbd, - 0xfd, 0x5f, 0x78, 0x24, 0x36, 0x2b, 0x9b, 0xd5, 0xad, 0x05, 0x27, 0x27, 0x47, 0x16, 0xcc, 0x1f, - 0x87, 0xbc, 0x6d, 0x56, 0xd9, 0xba, 0x69, 0x1b, 0x6d, 0x42, 0xe3, 0x38, 0xc4, 0x91, 0x1b, 0x7b, - 0x81, 0xdf, 0xdb, 0x37, 0x6b, 0xac, 0x5b, 0x16, 0xd9, 0x01, 0x2c, 0x29, 0x7b, 0x93, 0x10, 0x7d, - 0x4f, 0x56, 0x87, 0xe9, 0xd0, 0x78, 0xdc, 0xde, 0x61, 0x86, 0xc9, 0xe4, 0x8e, 0xac, 0xf2, 0x36, - 0xb4, 0x5f, 0xb8, 0xde, 0x18, 0x8f, 0xf2, 0x70, 0x75, 0xb9, 0x7d, 0x0c, 0x4b, 0x87, 0x38, 0xde, - 0x1b, 0x8f, 0xb9, 0x8c, 0x6a, 0x6b, 0xc1, 0x7c, 0x90, 0x68, 0x60, 0x70, 0x0d, 0x02, 0x49, 0x83, - 0x40, 0xd2, 0x80, 0x1b, 0x4e, 0x16, 0xd9, 0x23, 0x68, 0xab, 0x0b, 0x96, 0x52, 0x61, 0x03, 0x20, - 0x07, 0x5e, 0x92, 0xd8, 0xd7, 0xb0, 0xb4, 0x37, 0x1c, 0x06, 0x53, 0x3f, 0xee, 0x5e, 0xe0, 0xe1, - 0x25, 0x85, 0xbd, 0x05, 0x4b, 0xec, 0xb7, 0x34, 0xcf, 0x60, 0xf3, 0x74, 0xb1, 0xe2, 0xa2, 0xca, - 0xed, 0x2e, 0xaa, 0xe6, 0x5d, 0xf4, 0x3f, 0x03, 0xda, 0xea, 0xde, 0x5c, 0xc3, 0xe1, 0x0c, 0x1a, - 0x66, 0x63, 0xd0, 0x21, 0x80, 0x83, 0xc9, 0x74, 0x1c, 0xa7, 0x1a, 0x36, 0x1e, 0x7f, 0x87, 0xcf, - 0xd0, 0x57, 0xdf, 0x19, 0x78, 0xfe, 0xf9, 0x98, 0x51, 0x62, 0x10, 0xbb, 0xf1, 0x94, 0x38, 0xd2, - 0x54, 0xab, 0x0f, 0x6d, 0xbd, 0x9f, 0x52, 0x7b, 0x2a, 0x3b, 0x50, 0xb4, 0xd0, 0x17, 0xd0, 0x74, - 0xf9, 0xe2, 0x7c, 0xa0, 0x50, 0x5f, 0x15, 0xda, 0x3e, 0xb4, 0x0e, 0x71, 0xcc, 0x0c, 0xe2, 0x9f, - 0x05, 0xd4, 0xb6, 0x1b, 0x00, 0x53, 0xdd, 0xac, 0x92, 0xe4, 0x9e, 0x16, 0xfd, 0x83, 0xc1, 0x48, - 0x98, 0x6d, 0x58, 0xca, 0xa0, 0xcf, 0x60, 0x31, 0x59, 0x81, 0xa1, 0xac, 0x32, 0x93, 0x7e, 0x6d, - 0x87, 0xe0, 0xe8, 0x0a, 0x47, 0xa7, 0x6e, 0xe8, 0x9d, 0x86, 0x6e, 0xe4, 0x4e, 0xc8, 0x4e, 0xba, - 0x91, 0x32, 0xc1, 0xfe, 0x93, 0x01, 0xcb, 0x27, 0xe1, 0xc8, 0x15, 0xe1, 0x2c, 0x54, 0x7f, 0x02, - 0xf3, 0x49, 0x53, 0xc0, 0xb8, 0x75, 0xc9, 0x74, 0xf0, 0x5d, 0x36, 0x09, 0xf2, 0x36, 0x91, 0xc3, - 0xe8, 0x05, 0x20, 0x1d, 0x4b, 0x19, 0xab, 0xd8, 0xff, 0xad, 0xc2, 0x62, 0x37, 0xf0, 0xaf, 0x70, - 0x44, 0xd8, 0xd2, 0xcc, 0x1d, 0x6f, 0x7d, 0x1c, 0x29, 0x01, 0x2e, 0x8b, 0xd0, 0x97, 0xd0, 0x92, - 0x67, 0xa4, 0xf0, 0x35, 0x29, 0x25, 0x85, 0x83, 0x87, 0x57, 0x2f, 0xc9, 0xf9, 0x71, 0x18, 0x33, - 0x1d, 0xea, 0x8e, 0x24, 0xa1, 0x69, 0x48, 0x9e, 0xf1, 0xea, 0x3a, 0xc4, 0x2c, 0xe5, 0xd5, 0x9d, - 0x9c, 0x9c, 0x12, 0x56, 0x00, 0xaa, 0x73, 0xc2, 0x0a, 0x2c, 0x26, 0xcc, 0x1d, 0x46, 0xc1, 0x34, - 0xec, 0xed, 0x9b, 0x8f, 0x58, 0x47, 0xd2, 0xa4, 0x7a, 0x9c, 0xf8, 0x11, 0x76, 0x47, 0x5d, 0xca, - 0x5c, 0x73, 0x8e, 0x2d, 0x2c, 0x8b, 0x28, 0xd9, 0xf7, 0x23, 0xf7, 0x2c, 0x7e, 0x85, 0xdf, 0xc5, - 0xaf, 0xbc, 0x09, 0x36, 0xe7, 0x37, 0x8d, 0xad, 0xaa, 0xa3, 0x0a, 0xa9, 0x9b, 0x7a, 0xa4, 0xef, - 0xf9, 0x3e, 0x1e, 0x99, 0x0b, 0x9b, 0xc6, 0xd6, 0xbc, 0x93, 0xb6, 0x91, 0x0d, 0x8b, 0x7b, 0x71, - 0xec, 0x0e, 0x2f, 0xf0, 0x88, 0xf9, 0x1f, 0x18, 0x04, 0x45, 0x46, 0x77, 0xe9, 0x91, 0x7e, 0xe4, - 0x5d, 0xb9, 0x31, 0xee, 0x5e, 0xb8, 0xb1, 0xd9, 0x60, 0x8b, 0xa8, 0x42, 0x8a, 0x96, 0x01, 0xdf, - 0x8b, 0x99, 0x19, 0x16, 0x39, 0x5a, 0x49, 0x44, 0xf7, 0xea, 0x91, 0xa3, 0x20, 0xee, 0xf9, 0x4c, - 0x6a, 0x36, 0xd9, 0x32, 0x8a, 0x0c, 0xb5, 0xa0, 0x72, 0xf0, 0xce, 0x6c, 0x31, 0x14, 0x95, 0x83, - 0x77, 0xf6, 0xdf, 0x0c, 0x40, 0x03, 0x1c, 0xcb, 0xd6, 0xa4, 0x94, 0xfd, 0x91, 0xea, 0x72, 0xc1, - 0x13, 0x94, 0xf0, 0x44, 0x1a, 0xac, 0x52, 0x63, 0x1b, 0xda, 0x7e, 0x10, 0x7b, 0x67, 0xde, 0x30, - 0x73, 0x58, 0x85, 0x3b, 0x4c, 0x97, 0xcf, 0x10, 0xd5, 0x87, 0xb0, 0x92, 0xc3, 0x56, 0x8a, 0xc2, - 0xff, 0x36, 0xa0, 0x3d, 0xc0, 0x71, 0xc6, 0x2c, 0xaa, 0xe3, 0x27, 0xa5, 0x71, 0xce, 0x2a, 0xb5, - 0xd9, 0xac, 0x52, 0xcf, 0x5b, 0xe5, 0x00, 0x96, 0x35, 0x5d, 0x4a, 0xd9, 0xe4, 0xb7, 0x06, 0xa0, - 0xc3, 0xbc, 0xe7, 0xf3, 0x3a, 0x1b, 0x85, 0x3a, 0x6b, 0xd6, 0xab, 0xe4, 0xad, 0x77, 0xb7, 0x7f, - 0xdf, 0xc3, 0xca, 0xe1, 0x43, 0xf8, 0x37, 0x47, 0xd7, 0xca, 0x6c, 0x74, 0xb5, 0x7f, 0x6f, 0xe4, - 0x10, 0x90, 0xd9, 0xa8, 0x41, 0x4b, 0x05, 0xc5, 0x20, 0x44, 0x94, 0x18, 0xba, 0x78, 0x06, 0x33, - 0xfc, 0xce, 0x80, 0xd5, 0x3c, 0x8a, 0x52, 0x86, 0xf8, 0x31, 0x34, 0x95, 0x65, 0x44, 0x55, 0x50, - 0x64, 0x09, 0x75, 0xa0, 0xfd, 0x6b, 0x58, 0xe3, 0x45, 0x57, 0x09, 0x63, 0x68, 0x2a, 0x56, 0xf2, - 0x2a, 0xfe, 0xd1, 0x80, 0xf5, 0xc2, 0xe5, 0x3f, 0xb1, 0x96, 0xff, 0x32, 0xc0, 0xec, 0xb8, 0xf1, - 0xf0, 0x62, 0x50, 0xe0, 0xf5, 0xdc, 0xb2, 0xc6, 0x8c, 0xcb, 0xce, 0x10, 0x0c, 0x45, 0x29, 0xa0, - 0x3a, 0x5b, 0x0a, 0xa8, 0x15, 0x05, 0xce, 0xe7, 0x37, 0x68, 0x51, 0xca, 0x9e, 0x26, 0xcc, 0x0d, - 0xa6, 0xc3, 0x21, 0x26, 0x09, 0x89, 0x93, 0x26, 0x3d, 0x54, 0x79, 0xbd, 0xcf, 0x6a, 0xa1, 0x05, - 0x47, 0xb4, 0xec, 0x1e, 0x34, 0x1d, 0x4c, 0xbc, 0x73, 0x9f, 0xaa, 0x47, 0x6d, 0x97, 0x9c, 0xbe, - 0xa3, 0xa4, 0x5c, 0xe4, 0xad, 0x19, 0xa8, 0xd1, 0x81, 0x96, 0xbc, 0x54, 0xa9, 0x5c, 0xf6, 0xf3, - 0xb4, 0xdc, 0xec, 0x5c, 0xf7, 0x46, 0xf7, 0xc3, 0xf3, 0xd1, 0x80, 0x1a, 0x1d, 0x4c, 0x8f, 0xd3, - 0x7e, 0x14, 0x9c, 0x79, 0x63, 0xdc, 0xbf, 0x08, 0xe2, 0x40, 0x2c, 0xa4, 0xc8, 0xe8, 0xd1, 0x7f, - 0xe4, 0x0d, 0x2f, 0x7d, 0x77, 0x82, 0x93, 0x0a, 0x2d, 0x69, 0x4b, 0x10, 0xaa, 0x0a, 0x84, 0x0d, - 0x80, 0x6e, 0x84, 0xdd, 0x18, 0xb3, 0x8a, 0x82, 0x7b, 0x57, 0x92, 0x50, 0x6f, 0xf4, 0x48, 0x67, - 0x1c, 0x0c, 0x2f, 0x59, 0xf6, 0x9f, 0x77, 0x92, 0xa6, 0x3d, 0x4c, 0x8b, 0x5c, 0xae, 0x66, 0xc9, - 0x7b, 0x11, 0xbb, 0x06, 0x8b, 0x1c, 0x09, 0x7c, 0x2c, 0xb3, 0x3d, 0x93, 0xdb, 0x1f, 0x0c, 0x58, - 0x16, 0xbb, 0x90, 0xce, 0xf5, 0x91, 0x3b, 0xc1, 0xe2, 0x46, 0x47, 0x25, 0xb4, 0x99, 0xdc, 0xe8, - 0x92, 0x36, 0xda, 0x07, 0xe8, 0xbb, 0xe7, 0x9e, 0x2f, 0xe7, 0xde, 0x2f, 0x0a, 0x2a, 0x5c, 0x07, - 0xbf, 0x99, 0x62, 0x12, 0x67, 0x63, 0x1d, 0x69, 0xde, 0x0c, 0x79, 0xf2, 0xaf, 0xfc, 0xc4, 0x52, - 0x90, 0x91, 0x10, 0x6d, 0x42, 0x9d, 0x02, 0x4f, 0xc2, 0x55, 0xd6, 0x88, 0x77, 0xa0, 0x83, 0x02, - 0x80, 0xdf, 0x2e, 0x04, 0x48, 0xc2, 0xc0, 0x27, 0xf8, 0x06, 0x84, 0x89, 0x0d, 0xa6, 0x13, 0x22, - 0x62, 0x37, 0x6d, 0xdb, 0xff, 0x30, 0x60, 0x71, 0x6f, 0x1c, 0xf3, 0x78, 0xbf, 0x17, 0x01, 0xe9, - 0x88, 0xfe, 0x45, 0xe0, 0xe3, 0xa3, 0xe9, 0xe4, 0x35, 0x8e, 0xd8, 0x4e, 0x55, 0x47, 0x16, 0x29, - 0xac, 0xab, 0x69, 0xac, 0x5b, 0x85, 0xfa, 0xc1, 0xc4, 0xf5, 0xc6, 0xa2, 0x72, 0xe0, 0x0d, 0xe9, - 0x26, 0x31, 0x12, 0x55, 0x70, 0xda, 0xb6, 0xf7, 0xa0, 0x29, 0x21, 0x2f, 0xc3, 0x29, 0xfb, 0x2f, - 0x06, 0x34, 0x12, 0xcf, 0x24, 0x47, 0x86, 0xa4, 0xa4, 0x91, 0x57, 0xf2, 0x61, 0x38, 0x23, 0xb3, - 0xb2, 0xaa, 0xb2, 0xd2, 0xfe, 0xa7, 0x01, 0x8b, 0x19, 0xa6, 0x7b, 0x86, 0x4a, 0xb5, 0x28, 0x54, - 0x34, 0x5e, 0x55, 0x1f, 0x82, 0x57, 0x35, 0x8d, 0x57, 0x1f, 0x0d, 0x80, 0xbd, 0xd1, 0x28, 0x61, - 0xd5, 0xdd, 0x86, 0xd5, 0xd8, 0x23, 0xf8, 0x25, 0xb3, 0xe7, 0xa6, 0xbc, 0x84, 0xa0, 0x26, 0x31, - 0x8a, 0xfd, 0x56, 0x78, 0x53, 0xd7, 0x78, 0xf3, 0x0c, 0x1a, 0x29, 0xb2, 0x52, 0xac, 0xf9, 0xb3, - 0x01, 0x8b, 0x2c, 0xb1, 0xdd, 0x15, 0x33, 0x5f, 0x42, 0xeb, 0xc0, 0x1f, 0xed, 0x7b, 0xc4, 0x7d, - 0x3d, 0xe6, 0x59, 0x53, 0xd4, 0xe1, 0xaa, 0xf4, 0xee, 0x14, 0xa2, 0xe8, 0x53, 0xcb, 0xc7, 0x81, - 0x84, 0xa6, 0x94, 0x46, 0x67, 0xd0, 0x3a, 0xf1, 0x67, 0x52, 0xe9, 0xee, 0x34, 0x20, 0x43, 0xad, - 0x6a, 0x50, 0xbb, 0xb0, 0xa4, 0xec, 0x53, 0x0a, 0xec, 0xdf, 0x0d, 0xf6, 0xce, 0x96, 0x2e, 0xc3, - 0x22, 0x57, 0x8d, 0x4b, 0xe3, 0x61, 0x72, 0x79, 0x81, 0x76, 0xb6, 0xe4, 0xfa, 0xa3, 0xe9, 0x44, - 0xe4, 0x53, 0x45, 0x66, 0xbf, 0x87, 0x85, 0xb4, 0x4d, 0x63, 0x91, 0xfe, 0x17, 0x90, 0x94, 0x58, - 0x64, 0xfd, 0xdb, 0xd0, 0xee, 0xe0, 0x73, 0xcf, 0xcf, 0xb3, 0x24, 0x27, 0x2f, 0xe0, 0x53, 0xb5, - 0x88, 0x4f, 0xf6, 0x7f, 0xf8, 0x51, 0x28, 0x5b, 0xa8, 0x54, 0x1e, 0xd9, 0x05, 0xc8, 0xd6, 0x10, - 0xd9, 0x64, 0x89, 0xcf, 0xc8, 0x9c, 0x28, 0x0d, 0xf9, 0x14, 0x89, 0xa5, 0xcf, 0x6e, 0x3e, 0xe9, - 0x9e, 0x49, 0xdd, 0xb4, 0x0e, 0x73, 0xb4, 0x79, 0xea, 0x7d, 0xf5, 0xc2, 0xe9, 0x80, 0xdd, 0x62, - 0xb4, 0x15, 0x49, 0x88, 0xbe, 0x2b, 0xb9, 0x51, 0x64, 0xfa, 0x9c, 0xf2, 0xd9, 0x08, 0xfb, 0x0c, - 0x9a, 0xd9, 0xfb, 0xf5, 0xfd, 0x20, 0xdd, 0x1a, 0x43, 0x1d, 0xf9, 0x8d, 0xbe, 0x9c, 0x63, 0x1f, - 0x7f, 0x68, 0xf0, 0x13, 0x02, 0x3d, 0x4d, 0xcf, 0x3f, 0xf6, 0xa2, 0xb3, 0xca, 0x67, 0xa9, 0x4f, - 0xa0, 0xd6, 0x67, 0x05, 0x52, 0x12, 0xa2, 0x2e, 0xb4, 0xd4, 0x77, 0x3a, 0xb4, 0x2e, 0xd8, 0xad, - 0xbf, 0x24, 0x5a, 0x66, 0x71, 0x07, 0x09, 0x29, 0x00, 0xe9, 0xd5, 0x3f, 0x01, 0xa0, 0x7e, 0x84, - 0x48, 0x00, 0xe8, 0x9f, 0x07, 0x7e, 0xca, 0x0e, 0xca, 0xf4, 0xbd, 0x1d, 0x65, 0x38, 0xe5, 0x47, - 0x7d, 0x6b, 0xad, 0x48, 0xcc, 0xa7, 0xcb, 0xcf, 0xcd, 0xc9, 0x74, 0xed, 0x71, 0x3d, 0x99, 0x9e, - 0x7b, 0xf7, 0x7e, 0xc1, 0x8a, 0x5a, 0xe5, 0x15, 0xc9, 0x4c, 0x77, 0xd2, 0x5e, 0x27, 0xac, 0xcf, - 0x6f, 0xe8, 0x21, 0x21, 0x72, 0x18, 0xa1, 0xf5, 0x1b, 0x26, 0xfa, 0xba, 0x8c, 0x5a, 0xbf, 0xf2, - 0x59, 0xdf, 0xb8, 0xa5, 0x97, 0x84, 0xa8, 0xc7, 0x32, 0xa4, 0xba, 0x60, 0x31, 0x04, 0xb6, 0x9a, - 0x75, 0x53, 0x17, 0x09, 0xd1, 0x2f, 0xe1, 0xb3, 0xc2, 0x2b, 0x1b, 0xda, 0x10, 0xb1, 0x70, 0xc3, - 0xad, 0xd4, 0xfa, 0xe6, 0xad, 0xfd, 0xdc, 0x80, 0x83, 0x62, 0x03, 0x0e, 0x6e, 0x34, 0x60, 0xd1, - 0xb3, 0xda, 0x73, 0x68, 0x2a, 0xef, 0x4a, 0x68, 0x2d, 0x1d, 0xab, 0x3c, 0x9c, 0x59, 0xeb, 0x85, - 0x72, 0x4e, 0x42, 0xe9, 0x7e, 0xa2, 0x45, 0x81, 0xc8, 0x30, 0x5a, 0x14, 0xa4, 0x59, 0xa2, 0x9b, - 0x5e, 0xe1, 0x44, 0x6d, 0x9f, 0x44, 0x41, 0xee, 0x2e, 0x62, 0x99, 0xc5, 0x1d, 0x24, 0x44, 0x4f, - 0xd8, 0x17, 0x11, 0x71, 0x97, 0x44, 0x2b, 0x7c, 0x9c, 0x72, 0x51, 0xb5, 0x56, 0xf3, 0x42, 0x12, - 0xa2, 0x1f, 0xc2, 0x42, 0x5a, 0x03, 0x23, 0x71, 0xe1, 0x97, 0xcb, 0x79, 0x6b, 0x25, 0x27, 0x23, - 0x21, 0xfa, 0x3e, 0xcc, 0x27, 0x20, 0xd0, 0xb2, 0x0a, 0x8a, 0xce, 0x41, 0xba, 0x88, 0x84, 0x68, - 0x07, 0xe6, 0x44, 0xd1, 0x84, 0x44, 0x6a, 0xc9, 0xaa, 0x3b, 0x6b, 0x59, 0x93, 0x70, 0x60, 0xd9, - 0x19, 0x88, 0xf4, 0xb4, 0x99, 0x01, 0x53, 0x8b, 0x81, 0xa7, 0xd0, 0x90, 0xea, 0x83, 0xc4, 0x11, - 0x6a, 0x69, 0x92, 0x38, 0x42, 0x2f, 0x24, 0x9e, 0x43, 0x53, 0x39, 0xf3, 0x50, 0x16, 0xf7, 0x4a, - 0xa9, 0x60, 0xad, 0x17, 0xca, 0xd3, 0xa8, 0x51, 0x0e, 0x02, 0x29, 0x6a, 0xf4, 0x23, 0x47, 0x8a, - 0x9a, 0xfc, 0xd9, 0xf1, 0x04, 0x20, 0xcb, 0x56, 0x89, 0x43, 0x95, 0xe3, 0xc1, 0x5a, 0xcd, 0x0b, - 0x49, 0xd8, 0x69, 0xfe, 0xaa, 0xb1, 0xc3, 0x3e, 0xfd, 0xfe, 0x84, 0xfe, 0x79, 0xfd, 0x88, 0x7d, - 0xd7, 0xfd, 0xc1, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x34, 0x9a, 0x78, 0xde, 0x13, 0x1e, 0x00, - 0x00, +var fileDescriptor_user_f1112695e0d68005 = []byte{ + // 1923 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcd, 0x6f, 0x23, 0x49, + 0x15, 0x57, 0xfb, 0x63, 0x92, 0x3c, 0xc7, 0x8e, 0x53, 0x93, 0x9d, 0xf4, 0xf6, 0xc2, 0xe0, 0x6d, + 0x2d, 0x4b, 0x34, 0x12, 0x09, 0x0c, 0x88, 0x41, 0x8b, 0x60, 0x37, 0x76, 0x32, 0x96, 0x11, 0x93, + 0x58, 0xed, 0x19, 0x09, 0x21, 0x44, 0xd4, 0x63, 0x57, 0x9c, 0x56, 0xec, 0xee, 0xde, 0xae, 0xf6, + 0x7c, 0x70, 0x59, 0xb4, 0xc0, 0x05, 0x71, 0xe1, 0xc4, 0xc0, 0x81, 0xbf, 0x83, 0x3b, 0x9c, 0xf8, + 0x0f, 0xe0, 0xc2, 0x9f, 0xc1, 0x15, 0xd5, 0x47, 0x77, 0x57, 0x55, 0xb7, 0x63, 0x6f, 0x67, 0x34, + 0x97, 0xc4, 0xf5, 0xea, 0xa3, 0xdf, 0xef, 0xbd, 0xdf, 0x7b, 0xf5, 0xaa, 0x0a, 0x76, 0x16, 0x04, + 0x47, 0x47, 0xf4, 0xcf, 0x61, 0x18, 0x05, 0x71, 0x80, 0x6a, 0xf4, 0xb7, 0xf5, 0xe1, 0x79, 0x88, + 0xfd, 0x8b, 0xc1, 0x93, 0xa3, 0xf0, 0x7a, 0x7a, 0xc4, 0x3a, 0x8e, 0xc8, 0xe4, 0xfa, 0xe2, 0x25, + 0x39, 0x7a, 0x49, 0xf8, 0x40, 0xfb, 0x27, 0x00, 0xbd, 0x60, 0x3e, 0x0f, 0x7c, 0x07, 0x93, 0x10, + 0x99, 0xb0, 0x81, 0xa3, 0xa8, 0x17, 0x4c, 0xb0, 0x69, 0x74, 0x8c, 0x83, 0xba, 0x93, 0x34, 0xd1, + 0x3d, 0xb8, 0x83, 0xa3, 0xe8, 0x09, 0x99, 0x9a, 0x95, 0x8e, 0x71, 0xb0, 0xe5, 0x88, 0x96, 0xfd, + 0x6b, 0x68, 0x9d, 0xe0, 0x19, 0x8e, 0xf1, 0x33, 0x82, 0x23, 0xe2, 0xe0, 0xcf, 0xd1, 0x03, 0x68, + 0x67, 0x92, 0xc1, 0xc9, 0xcf, 0x3c, 0x12, 0x9b, 0x95, 0x4e, 0xf5, 0x60, 0xcb, 0xc9, 0xc9, 0x91, + 0x05, 0x9b, 0xe7, 0x21, 0x6f, 0x9b, 0x55, 0xb6, 0x6e, 0xda, 0x46, 0x1d, 0x68, 0x9c, 0x87, 0x38, + 0x72, 0x63, 0x2f, 0xf0, 0x07, 0x27, 0x66, 0x8d, 0x75, 0xcb, 0x22, 0x3b, 0x80, 0x1d, 0xe5, 0xdb, + 0x24, 0x44, 0xdf, 0x91, 0xe1, 0x30, 0x0c, 0x8d, 0x87, 0xed, 0x43, 0x66, 0x98, 0x4c, 0xee, 0xc8, + 0x90, 0x1f, 0x40, 0xfb, 0xb1, 0xeb, 0xcd, 0xf0, 0x24, 0xaf, 0xae, 0x2e, 0xb7, 0xcf, 0x61, 0xa7, + 0x8f, 0xe3, 0xe3, 0xd9, 0x8c, 0xcb, 0x28, 0x5a, 0x0b, 0x36, 0x83, 0x04, 0x81, 0xc1, 0x11, 0x04, + 0x12, 0x82, 0x40, 0x42, 0xc0, 0x0d, 0x27, 0x8b, 0xec, 0x09, 0xb4, 0xd5, 0x05, 0x4b, 0x41, 0xb8, + 0x0f, 0x90, 0x53, 0x5e, 0x92, 0xd8, 0xaf, 0x61, 0xe7, 0x78, 0x3c, 0x0e, 0x16, 0x7e, 0xdc, 0xbb, + 0xc2, 0xe3, 0x6b, 0xaa, 0xf6, 0x01, 0xec, 0xb0, 0xdf, 0xd2, 0x3c, 0x83, 0xcd, 0xd3, 0xc5, 0x8a, + 0x8b, 0x2a, 0x37, 0xbb, 0xa8, 0x9a, 0x77, 0xd1, 0x7f, 0x0d, 0x68, 0xab, 0xdf, 0xe6, 0x08, 0xc7, + 0x6b, 0x20, 0xcc, 0xc6, 0xa0, 0x3e, 0x80, 0x83, 0xc9, 0x62, 0x16, 0xa7, 0x08, 0x1b, 0x0f, 0xbf, + 0xc5, 0x67, 0xe8, 0xab, 0x1f, 0x8e, 0x3c, 0x7f, 0x3a, 0x63, 0x94, 0x18, 0xc5, 0x6e, 0xbc, 0x20, + 0x8e, 0x34, 0xd5, 0x1a, 0x42, 0x5b, 0xef, 0xa7, 0xd4, 0x5e, 0xc8, 0x0e, 0x14, 0x2d, 0xf4, 0x11, + 0x34, 0x5d, 0xbe, 0x38, 0x1f, 0x28, 0xe0, 0xab, 0x42, 0xdb, 0x87, 0x56, 0x1f, 0xc7, 0xcc, 0x20, + 0xfe, 0x65, 0x40, 0x6d, 0x7b, 0x1f, 0x60, 0xa1, 0x9b, 0x55, 0x92, 0xdc, 0xd2, 0xa2, 0xbf, 0x33, + 0x18, 0x09, 0xb3, 0x0f, 0x96, 0x32, 0xe8, 0xa7, 0xb0, 0x9d, 0xac, 0xc0, 0xb4, 0xac, 0x32, 0x93, + 0x7e, 0x70, 0x48, 0x70, 0xf4, 0x02, 0x47, 0x17, 0x6e, 0xe8, 0x5d, 0x84, 0x6e, 0xe4, 0xce, 0xc9, + 0x61, 0xfa, 0x21, 0x65, 0x82, 0xfd, 0x07, 0x03, 0x76, 0x9f, 0x85, 0x13, 0x57, 0x84, 0xb3, 0x80, + 0xfe, 0x08, 0x36, 0x93, 0xa6, 0x50, 0xe3, 0xc6, 0x25, 0xd3, 0xc1, 0xab, 0x6c, 0x12, 0xe4, 0x6d, + 0x22, 0x87, 0xd1, 0x63, 0x40, 0xba, 0x2e, 0x65, 0xac, 0x62, 0x7f, 0x69, 0x80, 0x35, 0xc2, 0x71, + 0x7f, 0x16, 0x3c, 0x77, 0x67, 0x0e, 0x1e, 0xbf, 0x78, 0x82, 0x09, 0x71, 0xa7, 0xf8, 0x3c, 0x8c, + 0x29, 0xba, 0x65, 0x44, 0x59, 0x19, 0xe7, 0x34, 0xc9, 0x4c, 0xb3, 0x45, 0xc9, 0xf4, 0x3c, 0x8c, + 0x19, 0x8e, 0xba, 0x93, 0x93, 0xdb, 0xe7, 0xf0, 0xc1, 0x52, 0x1d, 0x4a, 0xa1, 0xfa, 0x4f, 0x15, + 0xb6, 0x7b, 0x81, 0xff, 0x02, 0x47, 0x84, 0xe9, 0xc3, 0x48, 0xf6, 0xd2, 0xc7, 0x91, 0x92, 0xb6, + 0x64, 0x11, 0xfa, 0x18, 0x5a, 0xf2, 0x8c, 0x14, 0x94, 0x26, 0xa5, 0x54, 0xcf, 0x21, 0x92, 0x24, + 0x14, 0xb7, 0x3c, 0xe3, 0xe9, 0xeb, 0x10, 0xb3, 0x44, 0x5e, 0x77, 0x72, 0x72, 0x6a, 0x5d, 0xa1, + 0x50, 0x9d, 0x5b, 0x57, 0xe8, 0x62, 0xc2, 0x46, 0x3f, 0x0a, 0x16, 0xe1, 0xe0, 0xc4, 0xbc, 0xc3, + 0x3a, 0x92, 0x26, 0xc5, 0xf1, 0xcc, 0x8f, 0xb0, 0x3b, 0xe9, 0xd1, 0x78, 0x34, 0x37, 0xd8, 0xc2, + 0xb2, 0x88, 0x86, 0xf0, 0x49, 0xe4, 0x5e, 0xc6, 0x4f, 0xf1, 0xab, 0xf8, 0xa9, 0x37, 0xc7, 0xe6, + 0x66, 0xc7, 0x38, 0xa8, 0x3a, 0xaa, 0x90, 0x92, 0x6f, 0x40, 0x86, 0x9e, 0xef, 0xe3, 0x89, 0xb9, + 0xd5, 0x31, 0x0e, 0x36, 0x9d, 0xb4, 0x8d, 0x6c, 0xd8, 0x3e, 0x8e, 0x63, 0x77, 0x7c, 0x85, 0x27, + 0x8c, 0xd5, 0xc0, 0x54, 0x50, 0x64, 0xf4, 0x2b, 0x03, 0x32, 0x8c, 0xbc, 0x17, 0x6e, 0x8c, 0x7b, + 0x57, 0x6e, 0x6c, 0x36, 0xd8, 0x22, 0xaa, 0x90, 0x6a, 0xcb, 0x14, 0x3f, 0x8e, 0x99, 0x19, 0xb6, + 0xb9, 0xb6, 0x92, 0x88, 0x7e, 0x6b, 0x40, 0xce, 0x82, 0x78, 0xe0, 0x33, 0xa9, 0xd9, 0x64, 0xcb, + 0x28, 0x32, 0xd4, 0x82, 0xca, 0xe9, 0x2b, 0xb3, 0xc5, 0xb4, 0xa8, 0x9c, 0xbe, 0xb2, 0xff, 0x6a, + 0x00, 0x1a, 0xe1, 0x58, 0xb6, 0x26, 0xa5, 0xea, 0x0f, 0x54, 0x97, 0x0b, 0x9e, 0xa0, 0x84, 0x27, + 0xd2, 0x60, 0x95, 0x1a, 0x0f, 0xa0, 0xed, 0x07, 0xb1, 0x77, 0xe9, 0x8d, 0x33, 0x87, 0x55, 0xb8, + 0xc3, 0x74, 0xf9, 0x1a, 0xb9, 0xaa, 0x0f, 0x77, 0x73, 0xba, 0x95, 0xa2, 0xf0, 0xbf, 0x0c, 0x68, + 0x8f, 0x70, 0x9c, 0x31, 0x8b, 0x62, 0x7c, 0xa7, 0x34, 0xce, 0x59, 0xa5, 0xb6, 0x9e, 0x55, 0xea, + 0x79, 0xab, 0x9c, 0xc2, 0xae, 0x86, 0xa5, 0x94, 0x4d, 0x7e, 0x63, 0x00, 0xea, 0xe7, 0x3d, 0x9f, + 0xc7, 0x6c, 0x14, 0x62, 0xd6, 0xac, 0x57, 0xc9, 0x5b, 0x6f, 0xb5, 0x7f, 0xbf, 0x80, 0xbb, 0xfd, + 0xb7, 0xe1, 0xdf, 0x1c, 0x5d, 0x2b, 0xeb, 0xd1, 0xd5, 0xfe, 0xad, 0x91, 0xd3, 0x80, 0xac, 0x47, + 0x0d, 0x5a, 0x00, 0x29, 0x06, 0x21, 0xa2, 0x70, 0xd2, 0xc5, 0x6b, 0x98, 0xe1, 0x4b, 0x03, 0xf6, + 0xf2, 0x5a, 0x94, 0x32, 0xc4, 0x0f, 0xa1, 0xa9, 0x2c, 0x23, 0x6a, 0x9d, 0x22, 0x4b, 0xa8, 0x03, + 0xed, 0x5f, 0xc2, 0x3d, 0x5e, 0x4a, 0x96, 0x30, 0x86, 0x06, 0xb1, 0x92, 0x87, 0xf8, 0x7b, 0x03, + 0xf6, 0x0b, 0x97, 0x7f, 0xc7, 0x28, 0xff, 0x69, 0x80, 0xd9, 0x75, 0xe3, 0xf1, 0xd5, 0xa8, 0xc0, + 0xeb, 0xb9, 0x65, 0x8d, 0x35, 0x97, 0x5d, 0x23, 0x18, 0x8a, 0x52, 0x40, 0x75, 0xbd, 0x14, 0x50, + 0x2b, 0x0a, 0x9c, 0xf7, 0x97, 0xa0, 0x28, 0x65, 0x4f, 0x13, 0x36, 0x46, 0x8b, 0xf1, 0x18, 0x93, + 0x84, 0xc4, 0x49, 0x93, 0x6e, 0xaa, 0xfc, 0x14, 0xc3, 0x2a, 0xbc, 0x2d, 0x47, 0xb4, 0xec, 0x01, + 0x34, 0x1d, 0x4c, 0xbc, 0xa9, 0x4f, 0xe1, 0x89, 0xda, 0x86, 0x21, 0x9d, 0x24, 0xb5, 0x0d, 0x6f, + 0xad, 0x41, 0x8d, 0x2e, 0xb4, 0xe4, 0xa5, 0x4a, 0xe5, 0xb2, 0x9f, 0xa6, 0x45, 0x74, 0xf7, 0xf5, + 0x60, 0x72, 0x3b, 0x7d, 0xde, 0x18, 0x50, 0xa3, 0x83, 0xe9, 0x76, 0x3a, 0x8c, 0x82, 0x4b, 0x6f, + 0x86, 0x87, 0x57, 0x41, 0x1c, 0x88, 0x85, 0x14, 0x19, 0xdd, 0xfa, 0xcf, 0xbc, 0xf1, 0xb5, 0xef, + 0xce, 0x71, 0x52, 0x77, 0x26, 0x6d, 0x49, 0x85, 0xaa, 0xa2, 0xc2, 0x7d, 0x80, 0x5e, 0x84, 0xdd, + 0x18, 0xb3, 0x8a, 0x82, 0x7b, 0x57, 0x92, 0x50, 0x6f, 0x0c, 0x48, 0x77, 0x16, 0x8c, 0xaf, 0x59, + 0xf6, 0xdf, 0x74, 0x92, 0xa6, 0x3d, 0x4e, 0x4b, 0x77, 0x0e, 0xb3, 0xe4, 0x69, 0x8f, 0x1d, 0xee, + 0x45, 0x8e, 0x04, 0x3e, 0x96, 0xd9, 0x9e, 0xc9, 0xed, 0x3f, 0x1b, 0xb0, 0x2b, 0xbe, 0x42, 0xba, + 0xaf, 0xcf, 0xdc, 0x39, 0x16, 0xe7, 0x54, 0x2a, 0xa1, 0xcd, 0xe4, 0x9c, 0x9a, 0xb4, 0xd1, 0x09, + 0xc0, 0xd0, 0x9d, 0x7a, 0xbe, 0x9c, 0x7b, 0x3f, 0x2a, 0xa8, 0xdb, 0x1d, 0xfc, 0xf9, 0x02, 0x93, + 0x38, 0x1b, 0xeb, 0x48, 0xf3, 0xd6, 0xc8, 0x93, 0x7f, 0xe1, 0x3b, 0x96, 0xa2, 0x19, 0x09, 0x51, + 0x07, 0xea, 0x54, 0xf1, 0x24, 0x5c, 0x65, 0x44, 0xbc, 0x03, 0x9d, 0x16, 0x28, 0xf8, 0xcd, 0x42, + 0x05, 0x49, 0x18, 0xf8, 0x04, 0x2f, 0xd1, 0x30, 0xb1, 0xc1, 0x62, 0x4e, 0x44, 0xec, 0xa6, 0x6d, + 0xfb, 0xef, 0x06, 0x6c, 0x1f, 0xcf, 0x62, 0x1e, 0xef, 0xb7, 0x22, 0x20, 0x1d, 0x31, 0xbc, 0x0a, + 0x7c, 0x7c, 0xb6, 0x98, 0x3f, 0xc7, 0x11, 0xfb, 0x52, 0xd5, 0x91, 0x45, 0x0a, 0xeb, 0x6a, 0x1a, + 0xeb, 0xf6, 0xa0, 0x7e, 0x3a, 0x77, 0xbd, 0x99, 0xa8, 0x1c, 0x78, 0x43, 0x3a, 0x1f, 0x4d, 0x44, + 0x15, 0x9c, 0xb6, 0xed, 0x63, 0x68, 0x4a, 0x9a, 0x97, 0xe1, 0x94, 0xfd, 0x27, 0x03, 0x1a, 0x89, + 0x67, 0x92, 0x2d, 0x43, 0x02, 0x69, 0xe4, 0x41, 0xbe, 0x1d, 0xce, 0xc8, 0xac, 0xac, 0xaa, 0xac, + 0xb4, 0xff, 0x61, 0xc0, 0x76, 0xa6, 0xd3, 0x2d, 0x43, 0xa5, 0x5a, 0x14, 0x2a, 0x1a, 0xaf, 0xaa, + 0x6f, 0x83, 0x57, 0x35, 0x8d, 0x57, 0x6f, 0x0c, 0x80, 0xe3, 0xc9, 0x24, 0x61, 0xd5, 0x6a, 0xc3, + 0x6a, 0xec, 0x11, 0xfc, 0x92, 0xd9, 0xb3, 0x2c, 0x2f, 0x21, 0xa8, 0x49, 0x8c, 0x62, 0xbf, 0x15, + 0xde, 0xd4, 0x35, 0xde, 0x7c, 0x0a, 0x8d, 0x54, 0xb3, 0x52, 0xac, 0xf9, 0xa3, 0x01, 0xdb, 0x2c, + 0xb1, 0xad, 0x8a, 0x99, 0x8f, 0xa1, 0x75, 0xea, 0x4f, 0x4e, 0x3c, 0xe2, 0x3e, 0x9f, 0xf1, 0xac, + 0x29, 0xea, 0x70, 0x55, 0xba, 0x3a, 0x85, 0x28, 0x78, 0x6a, 0xf9, 0x38, 0x90, 0xb4, 0x29, 0x85, + 0xe8, 0x12, 0x5a, 0xcf, 0xfc, 0xb5, 0x20, 0xad, 0x4e, 0x03, 0xb2, 0xaa, 0x55, 0x4d, 0xd5, 0x1e, + 0xec, 0x28, 0xdf, 0x29, 0xa5, 0xec, 0xdf, 0x0c, 0x76, 0x7b, 0x98, 0x2e, 0xc3, 0x22, 0x57, 0x8d, + 0x4b, 0xe3, 0xed, 0xe4, 0xf2, 0x02, 0x74, 0xb6, 0xe4, 0xfa, 0xb3, 0xc5, 0x5c, 0xe4, 0x53, 0x45, + 0x66, 0x7f, 0x01, 0x5b, 0x69, 0x9b, 0xc6, 0x22, 0xfd, 0x2f, 0x54, 0x52, 0x62, 0x91, 0xf5, 0x3f, + 0x80, 0x76, 0x17, 0x4f, 0x3d, 0x3f, 0xcf, 0x92, 0x9c, 0xbc, 0x80, 0x4f, 0xd5, 0x22, 0x3e, 0xd9, + 0xff, 0xe6, 0x5b, 0xa1, 0x6c, 0xa1, 0x52, 0x79, 0xe4, 0x08, 0x20, 0x5b, 0x43, 0x64, 0x93, 0x1d, + 0x3e, 0x23, 0x73, 0xa2, 0x34, 0xe4, 0x5d, 0x24, 0x96, 0x21, 0x3b, 0xf9, 0xa4, 0xdf, 0x4c, 0xea, + 0xa6, 0x7d, 0xd8, 0xa0, 0xcd, 0x0b, 0xef, 0xab, 0x17, 0x4e, 0xa7, 0xec, 0x14, 0xa3, 0xad, 0x48, + 0x42, 0xf4, 0x6d, 0xc9, 0x8d, 0x22, 0xd3, 0xe7, 0xc0, 0x67, 0x23, 0xec, 0x4b, 0x68, 0x66, 0xb7, + 0xf2, 0xb7, 0x53, 0xe9, 0xc6, 0x18, 0xea, 0xca, 0x2f, 0x0f, 0xe5, 0x1c, 0xfb, 0xf0, 0x7f, 0x0d, + 0xbe, 0x43, 0xa0, 0x4f, 0xd2, 0xfd, 0x8f, 0xdd, 0xe8, 0xec, 0xf1, 0x59, 0xea, 0xc5, 0xae, 0xf5, + 0x5e, 0x81, 0x94, 0x84, 0xa8, 0x07, 0x2d, 0xf5, 0xf6, 0x11, 0xed, 0x0b, 0x76, 0xeb, 0xf7, 0xa3, + 0x96, 0x59, 0xdc, 0x41, 0x42, 0xf4, 0x2b, 0xd8, 0x5f, 0x72, 0xeb, 0x87, 0x3a, 0x7c, 0xd2, 0xf2, + 0x8b, 0x49, 0xeb, 0xc3, 0x15, 0x23, 0x48, 0x48, 0x01, 0x4a, 0x6f, 0x25, 0x09, 0x40, 0xf5, 0xe9, + 0x26, 0x01, 0xa8, 0x3f, 0xaa, 0xfc, 0x98, 0x6d, 0xc4, 0xe9, 0x2b, 0x05, 0xca, 0xec, 0x20, 0x3f, + 0x85, 0x58, 0xf7, 0x8a, 0xc4, 0x7c, 0xba, 0x7c, 0x49, 0x9f, 0x4c, 0xd7, 0x9e, 0x24, 0x92, 0xe9, + 0xb9, 0xd7, 0x82, 0xc7, 0xac, 0x68, 0x56, 0x6e, 0xa9, 0xcc, 0xf4, 0x4b, 0xda, 0xed, 0x87, 0xf5, + 0xfe, 0x92, 0x1e, 0x12, 0x22, 0x87, 0x05, 0x8c, 0x7e, 0x82, 0x45, 0x5f, 0x93, 0xb5, 0xd6, 0x8f, + 0x94, 0xd6, 0xd7, 0x6f, 0xe8, 0x25, 0x21, 0x1a, 0xb0, 0x0c, 0xac, 0x2e, 0x58, 0xac, 0x02, 0x5b, + 0xcd, 0x5a, 0xd6, 0x45, 0x42, 0xf4, 0x73, 0x78, 0xaf, 0xf0, 0x48, 0x88, 0xee, 0x8b, 0x58, 0x5b, + 0x72, 0xea, 0xb5, 0xbe, 0x71, 0x63, 0x3f, 0x37, 0xe0, 0xa8, 0xd8, 0x80, 0xa3, 0xa5, 0x06, 0x2c, + 0xba, 0xb6, 0xfb, 0x0c, 0x9a, 0xca, 0xbd, 0x15, 0xba, 0x97, 0x8e, 0x55, 0x2e, 0xe6, 0xac, 0xfd, + 0x42, 0x39, 0x27, 0xa1, 0x74, 0xfe, 0xd1, 0xa2, 0x4c, 0x64, 0x30, 0x2d, 0xca, 0xd2, 0x2c, 0xd4, + 0x4b, 0x8f, 0x88, 0xe2, 0xec, 0x90, 0x44, 0x59, 0xee, 0xac, 0x63, 0x99, 0xc5, 0x1d, 0x24, 0x44, + 0x8f, 0xd8, 0x3b, 0x92, 0x38, 0xab, 0xa2, 0xbb, 0x7c, 0x9c, 0x72, 0x10, 0xb6, 0xf6, 0xf2, 0x42, + 0x12, 0xa2, 0xef, 0xc3, 0x56, 0x5a, 0x63, 0x23, 0x71, 0xa1, 0x20, 0x1f, 0x17, 0xac, 0xbb, 0x39, + 0x19, 0x09, 0xd1, 0x77, 0x61, 0x33, 0x51, 0x02, 0xed, 0xaa, 0x4a, 0xd1, 0x39, 0x48, 0x17, 0x91, + 0x10, 0x1d, 0xc2, 0x86, 0x28, 0xca, 0x90, 0x48, 0x5d, 0x59, 0xf5, 0x68, 0xed, 0x6a, 0x12, 0xae, + 0x58, 0xb6, 0xc7, 0x22, 0x3d, 0x2d, 0x67, 0x8a, 0xa9, 0xc5, 0xc6, 0x27, 0xd0, 0x90, 0xea, 0x8f, + 0xc4, 0x11, 0x6a, 0xe9, 0x93, 0x38, 0x42, 0x2f, 0x54, 0x3e, 0x83, 0xa6, 0xb2, 0xa7, 0xa2, 0x2c, + 0xee, 0x95, 0x52, 0xc4, 0xda, 0x2f, 0x94, 0xa7, 0x51, 0xa3, 0x6c, 0x34, 0x52, 0xd4, 0xe8, 0x5b, + 0x9a, 0x14, 0x35, 0xf9, 0xbd, 0xe9, 0x11, 0x40, 0x96, 0xad, 0x12, 0x87, 0x2a, 0xdb, 0x8f, 0xb5, + 0x97, 0x17, 0x92, 0xb0, 0xdb, 0xfc, 0x45, 0xe3, 0x90, 0x3d, 0x98, 0xff, 0x88, 0xfe, 0x79, 0x7e, + 0x87, 0xbd, 0x86, 0x7f, 0xef, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x32, 0x71, 0xc8, 0xa6, 0x49, + 0x1f, 0x00, 0x00, } diff --git a/pkg/proto/user/user.proto b/pkg/proto/user/user.proto index 3fbfd0162..fa7025b28 100644 --- a/pkg/proto/user/user.proto +++ b/pkg/proto/user/user.proto @@ -66,6 +66,14 @@ message UpdateUserInfoReq{ message UpdateUserInfoResp{ CommonResp commonResp = 1; } +message SetGlobalRecvMessageOptReq{ + string userID = 1; + string operationID = 2; + int32 globalRecvMsgOpt = 3; +} +message SetGlobalRecvMessageOptResp{ + CommonResp commonResp = 1; +} message Conversation{ string OwnerUserID = 1; @@ -293,6 +301,7 @@ message DeleteUserResp { service user { rpc GetUserInfo(GetUserInfoReq) returns(GetUserInfoResp); rpc UpdateUserInfo(UpdateUserInfoReq) returns(UpdateUserInfoResp); + rpc SetGlobalRecvMessageOpt(SetGlobalRecvMessageOptReq) returns(SetGlobalRecvMessageOptResp); rpc DeleteUsers(DeleteUsersReq)returns(DeleteUsersResp); rpc GetAllUserID(GetAllUserIDReq)returns(GetAllUserIDResp); @@ -315,8 +324,4 @@ service user { rpc GetBlockUsers(GetBlockUsersReq) returns (GetBlockUsersResp); rpc GetBlockUserById(GetBlockUserByIdReq) returns (GetBlockUserByIdResp); rpc DeleteUser(DeleteUserReq) returns (DeleteUserResp); - - - rpc GetUserInfoFromCache(GetUserInfoReq) returns(GetUserInfoResp); - } diff --git a/pkg/statistics/statistics.go b/pkg/statistics/statistics.go index 800f5864b..63653c42f 100644 --- a/pkg/statistics/statistics.go +++ b/pkg/statistics/statistics.go @@ -9,7 +9,7 @@ type Statistics struct { AllCount *uint64 ModuleName string PrintArgs string - SleepTime int + SleepTime uint64 } func (s *Statistics) output() { @@ -17,6 +17,7 @@ func (s *Statistics) output() { t := time.NewTicker(time.Duration(s.SleepTime) * time.Second) defer t.Stop() var sum uint64 + var timeIntervalNum uint64 for { sum = *s.AllCount select { @@ -27,12 +28,13 @@ func (s *Statistics) output() { } else { intervalCount = *s.AllCount - sum } - log.NewWarn("", " system stat ", s.ModuleName, s.PrintArgs, intervalCount, "total:", *s.AllCount) + timeIntervalNum++ + log.NewWarn("", " system stat ", s.ModuleName, s.PrintArgs, intervalCount, "total:", *s.AllCount, "intervalNum", timeIntervalNum, "avg", (*s.AllCount)/(timeIntervalNum)/s.SleepTime) } } func NewStatistics(allCount *uint64, moduleName, printArgs string, sleepTime int) *Statistics { - p := &Statistics{AllCount: allCount, ModuleName: moduleName, SleepTime: sleepTime, PrintArgs: printArgs} + p := &Statistics{AllCount: allCount, ModuleName: moduleName, SleepTime: uint64(sleepTime), PrintArgs: printArgs} go p.output() return p } diff --git a/pkg/utils/base64.go b/pkg/utils/base64.go new file mode 100644 index 000000000..3f01c1488 --- /dev/null +++ b/pkg/utils/base64.go @@ -0,0 +1,12 @@ +package utils + +import "encoding/base64" + +func Base64Encode(data string) string { + return base64.StdEncoding.EncodeToString([]byte(data)) +} + +func Base64Decode(data string) string { + decodedByte, _ := base64.StdEncoding.DecodeString(data) + return string(decodedByte) +} diff --git a/pkg/utils/encryption .go b/pkg/utils/encryption .go new file mode 100644 index 000000000..a4862de2e --- /dev/null +++ b/pkg/utils/encryption .go @@ -0,0 +1,64 @@ +package utils + +import ( + "bytes" + "crypto/aes" + "crypto/cipher" + "crypto/md5" + "encoding/hex" + "errors" +) + +func Md5(s string, salt ...string) string { + h := md5.New() + h.Write([]byte(s)) + if len(salt) > 0 { + h.Write([]byte(salt[0])) + } + cipher := h.Sum(nil) + return hex.EncodeToString(cipher) +} + +func AesEncrypt(data []byte, key []byte) ([]byte, error) { + block, err := aes.NewCipher(key) + if err != nil { + return nil, err + } + blockSize := block.BlockSize() + encryptBytes := pkcs7Padding(data, blockSize) + crypted := make([]byte, len(encryptBytes)) + blockMode := cipher.NewCBCEncrypter(block, key[:blockSize]) + blockMode.CryptBlocks(crypted, encryptBytes) + return crypted, nil +} + +func AesDecrypt(data []byte, key []byte) ([]byte, error) { + block, err := aes.NewCipher(key) + if err != nil { + return nil, err + } + blockSize := block.BlockSize() + blockMode := cipher.NewCBCDecrypter(block, key[:blockSize]) + crypted := make([]byte, len(data)) + blockMode.CryptBlocks(crypted, data) + crypted, err = pkcs7UnPadding(crypted) + if err != nil { + return nil, err + } + return crypted, nil +} + +func pkcs7Padding(data []byte, blockSize int) []byte { + padding := blockSize - len(data)%blockSize + padText := bytes.Repeat([]byte{byte(padding)}, padding) + return append(data, padText...) +} + +func pkcs7UnPadding(data []byte) ([]byte, error) { + length := len(data) + if length == 0 { + return nil, errors.New("encrypt error") + } + unPadding := int(data[length-1]) + return data[:(length - unPadding)], nil +} diff --git a/pkg/utils/map.go b/pkg/utils/map.go index fc24cc87d..7a5fb2d6b 100644 --- a/pkg/utils/map.go +++ b/pkg/utils/map.go @@ -116,11 +116,15 @@ func JsonStringToMap(str string) (tempMap map[string]int32) { return tempMap } func GetSwitchFromOptions(Options map[string]bool, key string) (result bool) { + if Options == nil { + return true + } if flag, ok := Options[key]; !ok || flag { return true } return false } + func SetSwitchFromOptions(options map[string]bool, key string, value bool) { if options == nil { options = make(map[string]bool, 5) diff --git a/pkg/utils/md5.go b/pkg/utils/md5.go deleted file mode 100644 index 8e3531668..000000000 --- a/pkg/utils/md5.go +++ /dev/null @@ -1,13 +0,0 @@ -package utils - -import ( - "crypto/md5" - "encoding/hex" -) - -func Md5(s string) string { - h := md5.New() - h.Write([]byte(s)) - cipher := h.Sum(nil) - return hex.EncodeToString(cipher) -} diff --git a/pkg/utils/strings.go b/pkg/utils/strings.go index a05ba927a..0e7c16106 100644 --- a/pkg/utils/strings.go +++ b/pkg/utils/strings.go @@ -51,7 +51,14 @@ func IsContainInt32(target int32, List []int32) bool { } return false } - +func IsContainInt(target int, List []int) bool { + for _, element := range List { + if target == element { + return true + } + } + return false +} func InterfaceArrayToStringArray(data []interface{}) (i []string) { for _, param := range data { i = append(i, param.(string)) diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 86b1be180..8d144c7e8 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -136,17 +136,40 @@ func RemoveRepeatedStringInList(slc []string) []string { return result } +func Pb2String(pb proto.Message) (string, error) { + marshaler := jsonpb.Marshaler{ + OrigName: true, + EnumsAsInts: false, + EmitDefaults: false, + } + return marshaler.MarshalToString(pb) +} + +func String2Pb(s string, pb proto.Message) error { + return proto.Unmarshal([]byte(s), pb) +} + +func Map2Pb(m map[string]string) (pb proto.Message, err error) { + b, err := json.Marshal(m) + if err != nil { + return nil, err + } + err = proto.Unmarshal(b, pb) + if err != nil { + return nil, err + } + return pb, nil +} func Pb2Map(pb proto.Message) (map[string]interface{}, error) { _buffer := bytes.Buffer{} jsonbMarshaller := &jsonpb.Marshaler{ OrigName: true, EnumsAsInts: true, - EmitDefaults: true, + EmitDefaults: false, } _ = jsonbMarshaller.Marshal(&_buffer, pb) jsonCnt := _buffer.Bytes() var out map[string]interface{} err := json.Unmarshal(jsonCnt, &out) - return out, err } diff --git a/script/batch_build_all_service.sh b/script/batch_build_all_service.sh new file mode 100644 index 000000000..bf780008f --- /dev/null +++ b/script/batch_build_all_service.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash + +source ./style_info.cfg +source ./path_info.cfg +source ./function.sh + +bin_dir="../bin" +logs_dir="../logs" +sdk_db_dir="../db/sdk/" +#Automatically created when there is no bin, logs folder +if [ ! -d $bin_dir ]; then + mkdir -p $bin_dir +fi +if [ ! -d $logs_dir ]; then + mkdir -p $logs_dir +fi +if [ ! -d $sdk_db_dir ]; then + mkdir -p $sdk_db_dir +fi + +#begin path +begin_path=$PWD + + +build_pid_array=() + +for ((i = 0; i < ${#service_source_root[*]}; i++)); do + cd $begin_path + service_path=${service_source_root[$i]} + cd $service_path + make install > /dev/null & + build_pid=$! + build_pid_array[i]=$build_pid +done + + +echo "wait all build finish....." + +success_num=0 +for ((i = 0; i < ${#service_source_root[*]}; i++)); do + echo "wait pid: " ${build_pid_array[i]} ${service_names[$i]} + wait ${build_pid_array[i]} + stat=$? + echo ${service_names[$i]} "pid: " ${build_pid_array[i]} "stat: " $stat + if [ $stat == 0 ] + then + echo -e "${GREEN_PREFIX}${service_names[$i]} successfully be built ${COLOR_SUFFIX}\n" + let success_num=$success_num+1 + + else + echo -e "${RED_PREFIX}${service_names[$i]} build failed ${COLOR_SUFFIX}\n" + exit -1 + fi +done + +echo "success_num" $success_num "service num:" ${#service_source_root[*]} +if [ $success_num == ${#service_source_root[*]} ] +then + echo -e ${YELLOW_PREFIX}"all services build success"${COLOR_SUFFIX} +fi diff --git a/script/batch_start_all.sh b/script/batch_start_all.sh new file mode 100644 index 000000000..c2d78c509 --- /dev/null +++ b/script/batch_start_all.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +#fixme This script is the total startup script +#fixme The full name of the shell script that needs to be started is placed in the need_to_start_server_shell array + +#fixme Put the shell script name here +need_to_start_server_shell=( + start_rpc_service.sh + msg_gateway_start.sh + push_start.sh + msg_transfer_start.sh + sdk_svr_start.sh + demo_svr_start.sh +) +time=`date +"%Y-%m-%d %H:%M:%S"` +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========server start time:${time}===========">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & + +build_pid_array=() +idx=0 +for i in ${need_to_start_server_shell[*]}; do + chmod +x $i + ./$i & + build_pid=$! + echo "build_pid " $build_pid + build_pid_array[idx]=$build_pid + let idx=idx+1 +done + +echo "wait all start finish....." + +exit 0 + +success_num=0 +for ((i = 0; i < ${#need_to_start_server_shell[*]}; i++)); do + echo "wait pid: " ${build_pid_array[i]} ${need_to_start_server_shell[$i]} + wait ${build_pid_array[i]} + stat=$? + echo ${build_pid_array[i]} " " $stat + if [ $stat == 0 ] + then + # echo -e "${GREEN_PREFIX}${need_to_start_server_shell[$i]} successfully be built ${COLOR_SUFFIX}\n" + let success_num=$success_num+1 + + else + #echo -e "${RED_PREFIX}${need_to_start_server_shell[$i]} build failed ${COLOR_SUFFIX}\n" + exit -1 + fi +done + +echo "success_num" $success_num "service num:" ${#need_to_start_server_shell[*]} +if [ $success_num == ${#need_to_start_server_shell[*]} ] +then + echo -e ${YELLOW_PREFIX}"all services build success"${COLOR_SUFFIX} +fi + + diff --git a/script/check_all.sh b/script/check_all.sh index ccd62684b..14bca6c81 100644 --- a/script/check_all.sh +++ b/script/check_all.sh @@ -27,7 +27,7 @@ service_port_name=( switch=$(cat $config_path | grep demoswitch |awk -F '[:]' '{print $NF}') for i in ${service_port_name[*]}; do if [ ${switch} != "true" ]; then - if [ ${i} == "openImDemoPort"]; then + if [ ${i} == "openImDemoPort" ]; then continue fi fi diff --git a/script/mongo-init.sh b/script/mongo-init.sh new file mode 100644 index 000000000..ad9c84428 --- /dev/null +++ b/script/mongo-init.sh @@ -0,0 +1,12 @@ +mongo -- "$MONGO_INITDB_DATABASE" <