diff --git a/cmd/open_im_api/docs/docs.go b/cmd/open_im_api/docs/docs.go index 5919ca314..04efc9ea5 100644 --- a/cmd/open_im_api/docs/docs.go +++ b/cmd/open_im_api/docs/docs.go @@ -16,6 +16,2115 @@ const docTemplate = `{ "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, 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.ForceLogoutResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.ForceLogoutResp" + } + } + } + } + }, + "/auth/parse_token": { + "post": { + "description": "解析用户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字段, platform为平台ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.ParseTokenReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.ParseTokenResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.ParseTokenResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.ParseTokenResp" + } + } + } + } + }, + "/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为拓展字段", + "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.UserRegisterResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.UserRegisterResp" + } + } + } + } + }, + "/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字段, 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.UserTokenResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.UserTokenResp" + } + } + } + } + }, + "/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为设置的用户, 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.AddBlacklistResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.AddBlacklistResp" + } + } + } + } + }, + "/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为申请信息, fromUserID为申请用户, 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.AddFriendResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.AddFriendResp" + } + } + } + } + }, + "/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, toUserID为申请用户, handleMsg为处理信息, flag为具体操作, 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.AddFriendResponseResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.AddFriendResponseResp" + } + } + } + } + }, + "/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为操作用户, toUserID为被删除用户", + "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.DeleteFriendResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.DeleteFriendResp" + } + } + } + } + }, + "/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": { + "$ref": "#/definitions/base_info.GetBlackListResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetBlackListResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetBlackListResp" + } + } + } + } + }, + "/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": { + "$ref": "#/definitions/base_info.GetFriendApplyListResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetFriendApplyListResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetFriendApplyListResp" + } + } + } + } + }, + "/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": { + "$ref": "#/definitions/base_info.GetFriendListResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetFriendListResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetFriendListResp" + } + } + } + } + }, + "/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": { + "$ref": "#/definitions/base_info.GetSelfApplyListResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetSelfApplyListResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetSelfApplyListResp" + } + } + } + } + }, + "/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, friendUserIDList为", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.ImportFriendReq" + } + } + ], + "responses": { + "0": { + "description": "data列表中对象的result-1为添加该用户失败, 0为成功", + "schema": { + "$ref": "#/definitions/base_info.ImportFriendResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.ImportFriendResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.ImportFriendResp" + } + } + } + } + }, + "/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为请求用户, 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.IsFriendResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.IsFriendResp" + } + } + } + } + }, + "/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.RemoveBlackListResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.RemoveBlackListResp" + } + } + } + } + }, + "/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为设置的用户, toUserID为被设置的用户, 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.SetFriendRemarkResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.SetFriendRemarkResp" + } + } + } + } + }, + "/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.CancelMuteGroupResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.CancelMuteGroupResp" + } + } + } + } + }, + "/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.CancelMuteGroupMemberResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.CancelMuteGroupMemberResp" + } + } + } + } + }, + "/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": "ownerUserID为群主ID \u003cbr\u003e ex为群扩展字段 \u003cbr\u003e 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.CreateGroupResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.CreateGroupResp" + } + } + } + } + }, + "/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.DismissGroupResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.DismissGroupResp" + } + } + } + } + }, + "/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.GetGroupAllMemberResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetGroupAllMemberResp" + } + } + } + } + }, + "/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": "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.GetGroupMembersInfoResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetGroupMembersInfoResp" + } + } + } + } + }, + "/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.GetGroupInfoResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetGroupInfoResp" + } + } + } + } + }, + "/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.GetJoinedGroupListResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetJoinedGroupListResp" + } + } + } + } + }, + "/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": { + "$ref": "#/definitions/base_info.GetGroupApplicationListResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetGroupApplicationListResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetGroupApplicationListResp" + } + } + } + } + }, + "/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": { + "$ref": "#/definitions/base_info.GetGroupApplicationListResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetGroupApplicationListResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetGroupApplicationListResp" + } + } + } + } + }, + "/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.ApplicationGroupResponseResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.ApplicationGroupResponseResp" + } + } + } + } + }, + "/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.InviteUserToGroupResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.InviteUserToGroupResp" + } + } + } + } + }, + "/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为申请进群信息", + "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.JoinGroupResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.JoinGroupResp" + } + } + } + } + }, + "/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.KickGroupMemberResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.KickGroupMemberResp" + } + } + } + } + }, + "/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.DismissGroupResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.DismissGroupResp" + } + } + } + } + }, + "/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.QuitGroupResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.QuitGroupResp" + } + } + } + } + }, + "/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": "notification为群介绍 \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.SetGroupInfoResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.SetGroupInfoResp" + } + } + } + } + }, + "/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其他参数可选", + "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.SetGroupMemberInfoResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.SetGroupMemberInfoResp" + } + } + } + } + }, + "/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.TransferGroupOwnerResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.TransferGroupOwnerResp" + } + } + } + } + }, + "/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.CleanUpMsgResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.CleanUpMsgResp" + } + } + } + } + }, + "/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.DelMsgResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.DelMsgResp" + } + } + } + } + }, "/office/comment_one_work_moment": { "post": { "description": "评论一条工作圈", @@ -826,6 +2935,72 @@ const docTemplate = `{ } } }, + "/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.MinioUploadFileResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.MinioUploadFileResp" + } + } + } + } + }, "/user/account_check": { "post": { "description": "传入UserIDList检查列表账户注册状态,并且返回结果", @@ -970,7 +3145,19 @@ const docTemplate = `{ "0": { "description": "", "schema": { - "$ref": "#/definitions/base_info.GetSelfUserInfoResp" + "allOf": [ + { + "$ref": "#/definitions/base_info.GetSelfUserInfoResp" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/server_api_params.UserInfo" + } + } + } + ] } }, "400": { @@ -1242,6 +3429,235 @@ const docTemplate = `{ } } }, + "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": { @@ -1273,7 +3689,6 @@ const docTemplate = `{ "required": [ "content", "operationID", - "replyUserID", "workMomentID" ], "properties": { @@ -1305,6 +3720,58 @@ const docTemplate = `{ } } }, + "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": { @@ -1365,6 +3832,39 @@ const docTemplate = `{ } } }, + "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": [ @@ -1398,6 +3898,36 @@ const docTemplate = `{ } } }, + "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": [ @@ -1453,6 +3983,66 @@ const docTemplate = `{ } } }, + "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.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.GetAllUsersUidReq": { "type": "object", "required": [ @@ -1481,6 +4071,314 @@ const docTemplate = `{ } } }, + "base_info.GetBlackListReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetBlackListResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "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": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "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": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "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": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "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": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "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": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "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": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "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": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "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": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, "base_info.GetSelfUserInfoReq": { "type": "object", "required": [ @@ -1499,10 +4397,6 @@ const docTemplate = `{ "base_info.GetSelfUserInfoResp": { "type": "object", "properties": { - "data": { - "type": "object", - "additionalProperties": true - }, "errCode": { "type": "integer" }, @@ -1605,6 +4499,21 @@ const docTemplate = `{ } } }, + "base_info.GetUserReqGroupApplicationListReq": { + "type": "object", + "required": [ + "operationID", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, "base_info.GetUserTagByIDReq": { "type": "object", "required": [ @@ -1743,13 +4652,6 @@ const docTemplate = `{ "base_info.GetUsersInfoResp": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - } - }, "errCode": { "type": "integer" }, @@ -1828,6 +4730,206 @@ const docTemplate = `{ } } }, + "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": [ @@ -1857,6 +4959,162 @@ const docTemplate = `{ } } }, + "base_info.MinioUploadFileResp": { + "type": "object", + "properties": { + "URL": { + "type": "string" + }, + "newName": { + "type": "string" + }, + "snapshotName": { + "type": "string" + }, + "snapshotURL": { + "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": { + "data": { + "type": "object", + "additionalProperties": true + }, + "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": [ @@ -1905,6 +5163,40 @@ const docTemplate = `{ } } }, + "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": [ @@ -1935,6 +5227,94 @@ const docTemplate = `{ } } }, + "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": [ @@ -1976,6 +5356,40 @@ const docTemplate = `{ } } }, + "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.UpdateSelfUserInfoReq": { "type": "object", "required": [ @@ -2036,6 +5450,147 @@ const docTemplate = `{ } } }, + "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": { @@ -2277,6 +5832,126 @@ const docTemplate = `{ } } }, + "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": { + "$ref": "#/definitions/wrapperspb.Int32Value" + }, + "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.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" + } + } + }, "user.AccountCheckResp_SingleUserStatus": { "type": "object", "properties": { @@ -2287,6 +5962,15 @@ const docTemplate = `{ "type": "string" } } + }, + "wrapperspb.Int32Value": { + "type": "object", + "properties": { + "value": { + "description": "The int32 value.", + "type": "integer" + } + } } } }` diff --git a/cmd/open_im_api/docs/swagger.json b/cmd/open_im_api/docs/swagger.json index 4a6c587da..ff3c03dc5 100644 --- a/cmd/open_im_api/docs/swagger.json +++ b/cmd/open_im_api/docs/swagger.json @@ -4,6 +4,2115 @@ "contact": {} }, "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, 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.ForceLogoutResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.ForceLogoutResp" + } + } + } + } + }, + "/auth/parse_token": { + "post": { + "description": "解析用户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字段, platform为平台ID", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.ParseTokenReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.ParseTokenResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.ParseTokenResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.ParseTokenResp" + } + } + } + } + }, + "/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为拓展字段", + "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.UserRegisterResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.UserRegisterResp" + } + } + } + } + }, + "/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字段, 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.UserTokenResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.UserTokenResp" + } + } + } + } + }, + "/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为设置的用户, 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.AddBlacklistResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.AddBlacklistResp" + } + } + } + } + }, + "/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为申请信息, fromUserID为申请用户, 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.AddFriendResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.AddFriendResp" + } + } + } + } + }, + "/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, toUserID为申请用户, handleMsg为处理信息, flag为具体操作, 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.AddFriendResponseResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.AddFriendResponseResp" + } + } + } + } + }, + "/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为操作用户, toUserID为被删除用户", + "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.DeleteFriendResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.DeleteFriendResp" + } + } + } + } + }, + "/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": { + "$ref": "#/definitions/base_info.GetBlackListResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetBlackListResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetBlackListResp" + } + } + } + } + }, + "/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": { + "$ref": "#/definitions/base_info.GetFriendApplyListResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetFriendApplyListResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetFriendApplyListResp" + } + } + } + } + }, + "/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": { + "$ref": "#/definitions/base_info.GetFriendListResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetFriendListResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetFriendListResp" + } + } + } + } + }, + "/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": { + "$ref": "#/definitions/base_info.GetSelfApplyListResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetSelfApplyListResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetSelfApplyListResp" + } + } + } + } + }, + "/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, friendUserIDList为", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.ImportFriendReq" + } + } + ], + "responses": { + "0": { + "description": "data列表中对象的result-1为添加该用户失败, 0为成功", + "schema": { + "$ref": "#/definitions/base_info.ImportFriendResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.ImportFriendResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.ImportFriendResp" + } + } + } + } + }, + "/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为请求用户, 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.IsFriendResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.IsFriendResp" + } + } + } + } + }, + "/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.RemoveBlackListResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.RemoveBlackListResp" + } + } + } + } + }, + "/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为设置的用户, toUserID为被设置的用户, 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.SetFriendRemarkResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.SetFriendRemarkResp" + } + } + } + } + }, + "/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.CancelMuteGroupResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.CancelMuteGroupResp" + } + } + } + } + }, + "/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.CancelMuteGroupMemberResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.CancelMuteGroupMemberResp" + } + } + } + } + }, + "/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": "ownerUserID为群主ID \u003cbr\u003e ex为群扩展字段 \u003cbr\u003e 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.CreateGroupResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.CreateGroupResp" + } + } + } + } + }, + "/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.DismissGroupResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.DismissGroupResp" + } + } + } + } + }, + "/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.GetGroupAllMemberResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetGroupAllMemberResp" + } + } + } + } + }, + "/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": "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.GetGroupMembersInfoResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetGroupMembersInfoResp" + } + } + } + } + }, + "/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.GetGroupInfoResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetGroupInfoResp" + } + } + } + } + }, + "/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.GetJoinedGroupListResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetJoinedGroupListResp" + } + } + } + } + }, + "/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": { + "$ref": "#/definitions/base_info.GetGroupApplicationListResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetGroupApplicationListResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetGroupApplicationListResp" + } + } + } + } + }, + "/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": { + "$ref": "#/definitions/base_info.GetGroupApplicationListResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetGroupApplicationListResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetGroupApplicationListResp" + } + } + } + } + }, + "/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.ApplicationGroupResponseResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.ApplicationGroupResponseResp" + } + } + } + } + }, + "/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.InviteUserToGroupResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.InviteUserToGroupResp" + } + } + } + } + }, + "/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为申请进群信息", + "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.JoinGroupResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.JoinGroupResp" + } + } + } + } + }, + "/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.KickGroupMemberResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.KickGroupMemberResp" + } + } + } + } + }, + "/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.DismissGroupResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.DismissGroupResp" + } + } + } + } + }, + "/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.QuitGroupResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.QuitGroupResp" + } + } + } + } + }, + "/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": "notification为群介绍 \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.SetGroupInfoResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.SetGroupInfoResp" + } + } + } + } + }, + "/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其他参数可选", + "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.SetGroupMemberInfoResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.SetGroupMemberInfoResp" + } + } + } + } + }, + "/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.TransferGroupOwnerResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.TransferGroupOwnerResp" + } + } + } + } + }, + "/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.CleanUpMsgResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.CleanUpMsgResp" + } + } + } + } + }, + "/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.DelMsgResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.DelMsgResp" + } + } + } + } + }, "/office/comment_one_work_moment": { "post": { "description": "评论一条工作圈", @@ -814,6 +2923,72 @@ } } }, + "/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.MinioUploadFileResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.MinioUploadFileResp" + } + } + } + } + }, "/user/account_check": { "post": { "description": "传入UserIDList检查列表账户注册状态,并且返回结果", @@ -958,7 +3133,19 @@ "0": { "description": "", "schema": { - "$ref": "#/definitions/base_info.GetSelfUserInfoResp" + "allOf": [ + { + "$ref": "#/definitions/base_info.GetSelfUserInfoResp" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/server_api_params.UserInfo" + } + } + } + ] } }, "400": { @@ -1230,6 +3417,235 @@ } } }, + "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": { @@ -1261,7 +3677,6 @@ "required": [ "content", "operationID", - "replyUserID", "workMomentID" ], "properties": { @@ -1293,6 +3708,58 @@ } } }, + "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": { @@ -1353,6 +3820,39 @@ } } }, + "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": [ @@ -1386,6 +3886,36 @@ } } }, + "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": [ @@ -1441,6 +3971,66 @@ } } }, + "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.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.GetAllUsersUidReq": { "type": "object", "required": [ @@ -1469,6 +4059,314 @@ } } }, + "base_info.GetBlackListReq": { + "type": "object", + "required": [ + "fromUserID", + "operationID" + ], + "properties": { + "fromUserID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.GetBlackListResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "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": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "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": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "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": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "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": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "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": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "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": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "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": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "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": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, "base_info.GetSelfUserInfoReq": { "type": "object", "required": [ @@ -1487,10 +4385,6 @@ "base_info.GetSelfUserInfoResp": { "type": "object", "properties": { - "data": { - "type": "object", - "additionalProperties": true - }, "errCode": { "type": "integer" }, @@ -1593,6 +4487,21 @@ } } }, + "base_info.GetUserReqGroupApplicationListReq": { + "type": "object", + "required": [ + "operationID", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, "base_info.GetUserTagByIDReq": { "type": "object", "required": [ @@ -1731,13 +4640,6 @@ "base_info.GetUsersInfoResp": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - } - }, "errCode": { "type": "integer" }, @@ -1816,6 +4718,206 @@ } } }, + "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": [ @@ -1845,6 +4947,162 @@ } } }, + "base_info.MinioUploadFileResp": { + "type": "object", + "properties": { + "URL": { + "type": "string" + }, + "newName": { + "type": "string" + }, + "snapshotName": { + "type": "string" + }, + "snapshotURL": { + "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": { + "data": { + "type": "object", + "additionalProperties": true + }, + "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": [ @@ -1893,6 +5151,40 @@ } } }, + "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": [ @@ -1923,6 +5215,94 @@ } } }, + "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": [ @@ -1964,6 +5344,40 @@ } } }, + "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.UpdateSelfUserInfoReq": { "type": "object", "required": [ @@ -2024,6 +5438,147 @@ } } }, + "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": { @@ -2265,6 +5820,126 @@ } } }, + "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": { + "$ref": "#/definitions/wrapperspb.Int32Value" + }, + "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.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" + } + } + }, "user.AccountCheckResp_SingleUserStatus": { "type": "object", "properties": { @@ -2275,6 +5950,15 @@ "type": "string" } } + }, + "wrapperspb.Int32Value": { + "type": "object", + "properties": { + "value": { + "description": "The int32 value.", + "type": "integer" + } + } } } } \ No newline at end of file diff --git a/cmd/open_im_api/docs/swagger.yaml b/cmd/open_im_api/docs/swagger.yaml index c8b35f1c6..07440bc83 100644 --- a/cmd/open_im_api/docs/swagger.yaml +++ b/cmd/open_im_api/docs/swagger.yaml @@ -23,6 +23,160 @@ definitions: 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: @@ -53,7 +207,6 @@ definitions: required: - content - operationID - - replyUserID - workMomentID type: object base_info.CommentOneWorkMomentResp: @@ -65,6 +218,40 @@ definitions: 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: @@ -105,6 +292,28 @@ definitions: 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: @@ -127,6 +336,26 @@ definitions: 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: @@ -163,6 +392,47 @@ definitions: 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.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.GetAllUsersUidReq: properties: operationID: @@ -181,6 +451,212 @@ definitions: errMsg: type: string type: object + base_info.GetBlackListReq: + properties: + fromUserID: + type: string + operationID: + type: string + required: + - fromUserID + - operationID + type: object + base_info.GetBlackListResp: + properties: + data: + items: + additionalProperties: true + type: object + type: array + 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: + data: + items: + additionalProperties: true + type: object + type: array + 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: + data: + items: + additionalProperties: true + type: object + type: array + 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: + data: + items: + additionalProperties: true + type: object + type: array + 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: + data: + items: + additionalProperties: true + type: object + type: array + 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: + data: + items: + additionalProperties: true + type: object + type: array + 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: + data: + items: + additionalProperties: true + type: object + type: array + 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: + data: + items: + additionalProperties: true + type: object + type: array + 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: + data: + items: + additionalProperties: true + type: object + type: array + errCode: + type: integer + errMsg: + type: string + type: object base_info.GetSelfUserInfoReq: properties: operationID: @@ -193,9 +669,6 @@ definitions: type: object base_info.GetSelfUserInfoResp: properties: - data: - additionalProperties: true - type: object errCode: type: integer errMsg: @@ -263,6 +736,16 @@ definitions: 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: @@ -353,11 +836,6 @@ definitions: type: object base_info.GetUsersInfoResp: properties: - data: - items: - additionalProperties: true - type: object - type: array errCode: type: integer errMsg: @@ -409,6 +887,139 @@ definitions: 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: @@ -428,6 +1039,109 @@ definitions: errMsg: type: string type: object + base_info.MinioUploadFileResp: + properties: + URL: + type: string + newName: + type: string + snapshotName: + type: string + snapshotURL: + 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: + data: + additionalProperties: true + type: object + 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: @@ -460,6 +1174,29 @@ definitions: 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: @@ -480,6 +1217,65 @@ definitions: 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: @@ -507,6 +1303,29 @@ definitions: errMsg: 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.UpdateSelfUserInfoReq: properties: birth: @@ -550,6 +1369,106 @@ definitions: 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: @@ -707,6 +1626,85 @@ definitions: userID: 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: + $ref: '#/definitions/wrapperspb.Int32Value' + 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.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 user.AccountCheckResp_SingleUserStatus: properties: accountStatus: @@ -714,9 +1712,1414 @@ definitions: userID: type: string type: object + wrapperspb.Int32Value: + properties: + value: + description: The int32 value. + type: integer + type: object info: contact: {} 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.ForceLogoutResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.ForceLogoutResp' + summary: 强制登出 + tags: + - 鉴权认证 + /auth/parse_token: + post: + consumes: + - application/json + description: 解析用户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: + $ref: '#/definitions/base_info.ParseTokenResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.ParseTokenResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.ParseTokenResp' + 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为拓展字段 + 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.UserRegisterResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.UserRegisterResp' + 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.UserTokenResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.UserTokenResp' + 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.AddBlacklistResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.AddBlacklistResp' + 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.AddFriendResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.AddFriendResp' + 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为申请用户, 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.AddFriendResponseResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.AddFriendResponseResp' + 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.DeleteFriendResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.DeleteFriendResp' + 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: + $ref: '#/definitions/base_info.GetBlackListResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.GetBlackListResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetBlackListResp' + 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: + $ref: '#/definitions/base_info.GetFriendApplyListResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.GetFriendApplyListResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetFriendApplyListResp' + 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: + $ref: '#/definitions/base_info.GetFriendListResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.GetFriendListResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetFriendListResp' + 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: + $ref: '#/definitions/base_info.GetSelfApplyListResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.GetSelfApplyListResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetSelfApplyListResp' + 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.ImportFriendResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.ImportFriendResp' + 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.IsFriendResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.IsFriendResp' + 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.RemoveBlackListResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.RemoveBlackListResp' + 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.SetFriendRemarkResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.SetFriendRemarkResp' + 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.CancelMuteGroupResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.CancelMuteGroupResp' + 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.CancelMuteGroupMemberResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.CancelMuteGroupMemberResp' + 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: ownerUserID为群主ID
ex为群扩展字段
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.CreateGroupResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.CreateGroupResp' + 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.DismissGroupResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.DismissGroupResp' + 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.GetGroupAllMemberResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetGroupAllMemberResp' + 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: 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.GetGroupMembersInfoResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetGroupMembersInfoResp' + 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.GetGroupInfoResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetGroupInfoResp' + 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.GetJoinedGroupListResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetJoinedGroupListResp' + 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: + $ref: '#/definitions/base_info.GetGroupApplicationListResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.GetGroupApplicationListResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetGroupApplicationListResp' + 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: + $ref: '#/definitions/base_info.GetGroupApplicationListResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.GetGroupApplicationListResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetGroupApplicationListResp' + 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.ApplicationGroupResponseResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.ApplicationGroupResponseResp' + 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.InviteUserToGroupResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.InviteUserToGroupResp' + 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为申请进群信息 + 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.JoinGroupResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.JoinGroupResp' + 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.KickGroupMemberResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.KickGroupMemberResp' + 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.DismissGroupResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.DismissGroupResp' + 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.QuitGroupResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.QuitGroupResp' + 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: 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.SetGroupInfoResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.SetGroupInfoResp' + 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其他参数可选 + 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.SetGroupMemberInfoResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.SetGroupMemberInfoResp' + 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.TransferGroupOwnerResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.TransferGroupOwnerResp' + 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.CleanUpMsgResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.CleanUpMsgResp' + 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.DelMsgResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.DelMsgResp' + summary: 根据seq列表删除消息 + tags: + - 消息相关 /office/comment_one_work_moment: post: consumes: @@ -1258,6 +3661,51 @@ paths: 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.MinioUploadFileResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.MinioUploadFileResp' + summary: minio上传文件(web api) + tags: + - 第三方服务相关 /user/account_check: post: consumes: @@ -1354,7 +3802,12 @@ paths: "0": description: "" schema: - $ref: '#/definitions/base_info.GetSelfUserInfoResp' + allOf: + - $ref: '#/definitions/base_info.GetSelfUserInfoResp' + - properties: + data: + $ref: '#/definitions/server_api_params.UserInfo' + type: object "400": description: errCode为400 一般为参数输入错误, token未带上等 schema: diff --git a/internal/api/auth/auth.go b/internal/api/auth/auth.go index 605cc890b..1f06ec847 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为拓展字段" +// @Produce json +// @Success 0 {object} api.UserRegisterResp +// @Failure 500 {object} api.UserRegisterResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.UserRegisterResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /auth/user_register [post] func UserRegister(c *gin.Context) { params := api.UserRegisterReq{} if err := c.BindJSON(¶ms); err != nil { @@ -73,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.UserTokenResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.UserTokenResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /auth/user_token [post] func UserToken(c *gin.Context) { params := api.UserTokenReq{} if err := c.BindJSON(¶ms); err != nil { @@ -111,6 +135,18 @@ func UserToken(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 解析token +// @Description 解析用户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 +// @Failure 500 {object} api.ParseTokenResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.ParseTokenResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /auth/parse_token [post] func ParseToken(c *gin.Context) { params := api.ParseTokenReq{} if err := c.BindJSON(¶ms); err != nil { @@ -137,6 +173,18 @@ func ParseToken(c *gin.Context) { 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.ForceLogoutResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.ForceLogoutResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /auth/force_logout [post] func ForceLogout(c *gin.Context) { params := api.ForceLogoutReq{} if err := c.BindJSON(¶ms); err != nil { diff --git a/internal/api/chat/del_msg.go b/internal/api/chat/del_msg.go index cb13f3dca..d993ef23f 100644 --- a/internal/api/chat/del_msg.go +++ b/internal/api/chat/del_msg.go @@ -16,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.DelMsgResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.DelMsgResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /msg/del_msg [post] func DelMsg(c *gin.Context) { var ( req api.DelMsgReq @@ -30,6 +42,17 @@ func DelMsg(c *gin.Context) { if err := utils.CopyStructFields(&reqPb, &req); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields", err.Error()) } + + 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" @@ -50,6 +73,18 @@ func DelMsg(c *gin.Context) { 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.CleanUpMsgResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.CleanUpMsgResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /msg/clear_msg [post] func ClearMsg(c *gin.Context) { params := api.CleanUpMsgReq{} if err := c.BindJSON(¶ms); err != nil { diff --git a/internal/api/friend/friend.go b/internal/api/friend/friend.go index e756983a9..1170a3363 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.AddBlacklistResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.AddBlacklistResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/add_black [post] func AddBlack(c *gin.Context) { params := api.AddBlacklistReq{} if err := c.BindJSON(¶ms); 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.ImportFriendResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.ImportFriendResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/import_friend [post] func ImportFriend(c *gin.Context) { params := api.ImportFriendReq{} if err := c.BindJSON(¶ms); err != nil { @@ -97,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.AddFriendResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.AddFriendResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/add_friend [post] func AddFriend(c *gin.Context) { params := api.AddFriendReq{} if err := c.BindJSON(¶ms); err != nil { @@ -114,7 +150,7 @@ 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 } @@ -140,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为申请用户, handleMsg为处理信息, flag为具体操作, 1为同意, 2为拒绝" +// @Produce json +// @Success 0 {object} api.AddFriendResponseResp +// @Failure 500 {object} api.AddFriendResponseResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.AddFriendResponseResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/add_friend_response [post] func AddFriendResponse(c *gin.Context) { params := api.AddFriendResponseReq{} if err := c.BindJSON(¶ms); err != nil { @@ -158,7 +206,7 @@ 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 } @@ -186,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.DeleteFriendResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.DeleteFriendResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/delete_friend [post] func DeleteFriend(c *gin.Context) { params := api.DeleteFriendReq{} if err := c.BindJSON(¶ms); err != nil { @@ -228,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 +// @Failure 500 {object} api.GetBlackListResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetBlackListResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/get_black_list [post] func GetBlacklist(c *gin.Context) { params := api.GetBlackListReq{} if err := c.BindJSON(¶ms); err != nil { @@ -244,7 +316,7 @@ 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 } @@ -276,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.SetFriendRemarkResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.SetFriendRemarkResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/set_friend_remark [post] func SetFriendRemark(c *gin.Context) { params := api.SetFriendRemarkReq{} if err := c.BindJSON(¶ms); err != nil { @@ -319,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.RemoveBlackListResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.RemoveBlackListResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/remove_black [post] func RemoveBlack(c *gin.Context) { params := api.RemoveBlackListReq{} if err := c.BindJSON(¶ms); err != nil { @@ -335,7 +431,7 @@ 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 } @@ -360,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.IsFriendResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.IsFriendResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/is_friend [post] func IsFriend(c *gin.Context) { params := api.IsFriendReq{} if err := c.BindJSON(¶ms); err != nil { @@ -376,7 +484,7 @@ 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 } @@ -403,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 +// @Failure 500 {object} api.GetFriendListResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetFriendListResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /friend/get_friend_list [post] func GetFriendList(c *gin.Context) { params := api.GetFriendListReq{} if err := c.BindJSON(¶ms); err != nil { @@ -447,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 +// @Failure 500 {object} api.GetFriendApplyListResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetFriendApplyListResp "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 { @@ -463,7 +595,7 @@ 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 } @@ -491,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 +// @Failure 500 {object} api.GetSelfApplyListResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetSelfApplyListResp "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 { @@ -507,7 +651,7 @@ 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 } diff --git a/internal/api/group/group.go b/internal/api/group/group.go index 74d56346c..fafb33081 100644 --- a/internal/api/group/group.go +++ b/internal/api/group/group.go @@ -20,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.KickGroupMemberResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.KickGroupMemberResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/kick_group [post] func KickGroupMember(c *gin.Context) { params := api.KickGroupMemberReq{} if err := c.BindJSON(¶ms); err != nil { @@ -72,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 "memberList为要获取群成员的群ID列表" +// @Produce json +// @Success 0 {object} api.GetGroupMembersInfoResp{data=[]open_im_sdk.GroupMemberFullInfo} +// @Failure 500 {object} api.GetGroupMembersInfoResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetGroupMembersInfoResp "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 { @@ -161,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.GetGroupAllMemberResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetGroupAllMemberResp "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 { @@ -204,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.GetJoinedGroupListResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetJoinedGroupListResp "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 { @@ -247,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.InviteUserToGroupResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.InviteUserToGroupResp "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 { @@ -297,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 "ownerUserID为群主ID
ex为群扩展字段
roleLevel为群员角色,1为普通用户 2为群主 3为管理员" +// @Produce json +// @Success 0 {object} api.CreateGroupResp{data=open_im_sdk.GroupInfo} +// @Failure 500 {object} api.CreateGroupResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.CreateGroupResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/create_group [post] func CreateGroup(c *gin.Context) { params := api.CreateGroupReq{} if err := c.BindJSON(¶ms); err != nil { @@ -318,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 } @@ -351,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 +// @Failure 500 {object} api.GetGroupApplicationListResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetGroupApplicationListResp "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 { @@ -361,13 +444,15 @@ 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, req.OperationID) @@ -391,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 +// @Failure 500 {object} api.GetGroupApplicationListResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetGroupApplicationListResp "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 { @@ -400,12 +497,15 @@ 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, req.OperationID) if etcdConn == nil { @@ -428,6 +528,18 @@ func GetUserReqGroupApplicationList(c *gin.Context) { 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.GetGroupInfoResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetGroupInfoResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/get_groups_info [post] func GetGroupsInfo(c *gin.Context) { params := api.GetGroupInfoReq{} if err := c.BindJSON(¶ms); err != nil { @@ -484,6 +596,19 @@ func GetGroupsInfo(c *gin.Context) { //} //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.ApplicationGroupResponseResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.ApplicationGroupResponseResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/group_application_response [post] func ApplicationGroupResponse(c *gin.Context) { params := api.ApplicationGroupResponseReq{} if err := c.BindJSON(¶ms); err != nil { @@ -526,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为申请进群信息" +// @Produce json +// @Success 0 {object} api.JoinGroupResp +// @Failure 500 {object} api.JoinGroupResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.JoinGroupResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/join_group [post] func JoinGroup(c *gin.Context) { params := api.JoinGroupReq{} if err := c.BindJSON(¶ms); err != nil { @@ -542,7 +679,7 @@ 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 } @@ -567,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.QuitGroupResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.QuitGroupResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/quit_group [post] func QuitGroup(c *gin.Context) { params := api.QuitGroupReq{} if err := c.BindJSON(¶ms); err != nil { @@ -608,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 "notification为群介绍
introduction为群公告
needVerification为加群验证 0为申请需要同意 邀请直接进 1为所有人进群需要验证,除了群主管理员邀请进群 2为直接进群" +// @Produce json +// @Success 0 {object} api.SetGroupInfoResp +// @Failure 500 {object} api.SetGroupInfoResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.SetGroupInfoResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/set_group_info [post] func SetGroupInfo(c *gin.Context) { params := api.SetGroupInfoReq{} if err := c.BindJSON(¶ms); err != nil { @@ -655,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.TransferGroupOwnerResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.TransferGroupOwnerResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/transfer_group [post] func TransferGroupOwner(c *gin.Context) { params := api.TransferGroupOwnerReq{} if err := c.BindJSON(¶ms); err != nil { @@ -697,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.DismissGroupResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.DismissGroupResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/dismiss_group [post] func DismissGroup(c *gin.Context) { params := api.DismissGroupReq{} if err := c.BindJSON(¶ms); err != nil { @@ -739,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.DismissGroupResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.DismissGroupResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/mute_group_member [post] func MuteGroupMember(c *gin.Context) { params := api.MuteGroupMemberReq{} if err := c.BindJSON(¶ms); err != nil { @@ -781,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.CancelMuteGroupMemberResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.CancelMuteGroupMemberResp "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 { @@ -823,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 { @@ -865,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.CancelMuteGroupResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.CancelMuteGroupResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/cancel_mute_group [post] func CancelMuteGroup(c *gin.Context) { params := api.CancelMuteGroupReq{} if err := c.BindJSON(¶ms); err != nil { @@ -951,6 +1184,18 @@ func SetGroupMemberNickname(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 修改群成员信息 +// @Description 修改群成员信息 +// @Tags 群组相关 +// @ID SetGroupMemberInfo +// @Accept json +// @Param token header string true "im token" +// @Param req body api.SetGroupMemberInfoReq true "除了operationID, userID, groupID其他参数可选" +// @Produce json +// @Success 0 {object} api.SetGroupMemberInfoResp +// @Failure 500 {object} api.SetGroupMemberInfoResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.SetGroupMemberInfoResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /group/set_group_member_info [post] func SetGroupMemberInfo(c *gin.Context) { var ( req api.SetGroupMemberInfoReq diff --git a/internal/api/third/minio_storage_credential.go b/internal/api/third/minio_storage_credential.go index 542c99ba7..7d0124688 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.MinioUploadFileResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.MinioUploadFileResp "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.MinioUploadFileResp ) 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 } @@ -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/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 d195c4b96..81832f5b2 100644 --- a/internal/api/user/user.go +++ b/internal/api/user/user.go @@ -317,7 +317,7 @@ func SetGlobalRecvMessageOpt(c *gin.Context) { // @Param token header string true "im token" // @Param req body api.GetSelfUserInfoReq true "请求体" // @Produce json -// @Success 0 {object} api.GetSelfUserInfoResp +// @Success 0 {object} api.GetSelfUserInfoResp{data=open_im_sdk.UserInfo} // @Failure 500 {object} api.GetSelfUserInfoResp "errCode为500 一般为服务器内部错误" // @Failure 400 {object} api.GetSelfUserInfoResp "errCode为400 一般为参数输入错误, token未带上等" // @Router /user/get_self_user_info [post] diff --git a/pkg/base_info/group_api_struct.go b/pkg/base_info/group_api_struct.go index 9e65700fe..d38615026 100644 --- a/pkg/base_info/group_api_struct.go +++ b/pkg/base_info/group_api_struct.go @@ -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 { diff --git a/pkg/base_info/msg.go b/pkg/base_info/msg.go index 15941f340..153313f65 100644 --- a/pkg/base_info/msg.go +++ b/pkg/base_info/msg.go @@ -1,10 +1,9 @@ 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 { diff --git a/pkg/base_info/user_api_struct.go b/pkg/base_info/user_api_struct.go index 45c8cb22d..09e19bd6b 100644 --- a/pkg/base_info/user_api_struct.go +++ b/pkg/base_info/user_api_struct.go @@ -11,7 +11,7 @@ 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 { @@ -36,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 {