From 25704e5ddd7cc6b899e0e67f22dd4fbfb0ef2224 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 27 Jun 2022 12:19:54 +0800 Subject: [PATCH 1/8] docker-compose --- config/config.yaml | 4 ++-- docker-compose.yaml | 22 +++++++++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 864a31a20..d608e1951 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -28,8 +28,8 @@ mongo: dbTimeout: 60 dbDatabase: openIM #mongo db 默认即可 dbSource: admin - dbUserName: #mongo用户名,建议先不设置 - dbPassword: #mongo密码,建议先不设置 + dbUserName: openIM #mongo用户名,建议先不设置 + dbPassword: openIM #mongo密码,建议先不设置 dbMaxPoolSize: 100 dbRetainChatRecords: 3650 #mongo保存离线消息时间(天),根据需求修改 diff --git a/docker-compose.yaml b/docker-compose.yaml index 0b159bfd8..b75dc33de 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -29,11 +29,8 @@ services: - TZ=Asia/Shanghai # cache - wiredTigerCacheSizeGB=1 -# environment: -# - MONGO_INITDB_ROOT_USERNAME=openIM -# - MONGO_INITDB_ROOT_PASSWORD=openIM - - + - MONGO_INITDB_ROOT_USERNAME=openIM + - MONGO_INITDB_ROOT_PASSWORD=openIM #TZ: Asia/Shanghai restart: always @@ -99,6 +96,21 @@ services: restart: always command: /usr/local/bin/etcd --name etcd0 --data-dir /etcd-data --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379 --listen-peer-urls http://0.0.0.0:2380 --initial-advertise-peer-urls http://0.0.0.0:2380 --initial-cluster etcd0=http://0.0.0.0:2380 --initial-cluster-token tkn --initial-cluster-state new + minio: + image: minio/minio + ports: + - 10005:9000 + - 9090:9090 + container_name: minio + volumes: + - /mnt/data:/data + - /mnt/config:/root/.minio + environment: + MINIO_ROOT_USER: user12345 + MINIO_ROOT_PASSWORD: key12345 + restart: always + command: minio server /data --console-address ':9090' + open_im_server: image: openim/open_im_server:v2.1.0 container_name: open_im_server From ccd7be727630f3ee38a15f5e10f81e30bd9fd12d Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 27 Jun 2022 13:20:31 +0800 Subject: [PATCH 2/8] docker-compose --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index b75dc33de..63cc05e83 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -20,7 +20,7 @@ services: ports: - 37017:27017 container_name: mongo - command: --wiredTigerCacheSizeGB 1 + command: --wiredTigerCacheSizeGB 1 --auth volumes: - ./components/mongodb/data/db:/data/db - ./components/mongodb/data/logs:/data/logs From 919eacc0a9afabb343899f0a323f8540c76fb7a6 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 27 Jun 2022 13:22:35 +0800 Subject: [PATCH 3/8] docker-compose --- docker-compose.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index 63cc05e83..33322160d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -126,6 +126,7 @@ services: - mongodb - redis - etcd + - minio network_mode: "host" logging: driver: json-file From 7280ef42a996216be6bfe1d1d4307dd80b62b4b8 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 27 Jun 2022 13:24:21 +0800 Subject: [PATCH 4/8] docker-compose --- config/config.yaml | 4 ++-- docker-compose.yaml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index d608e1951..4f5b60536 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -28,8 +28,8 @@ mongo: dbTimeout: 60 dbDatabase: openIM #mongo db 默认即可 dbSource: admin - dbUserName: openIM #mongo用户名,建议先不设置 - dbPassword: openIM #mongo密码,建议先不设置 + dbUserName: #mongo用户名,建议先不设置 + dbPassword: #mongo密码,建议先不设置 dbMaxPoolSize: 100 dbRetainChatRecords: 3650 #mongo保存离线消息时间(天),根据需求修改 diff --git a/docker-compose.yaml b/docker-compose.yaml index 33322160d..e3af24080 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -20,7 +20,7 @@ services: ports: - 37017:27017 container_name: mongo - command: --wiredTigerCacheSizeGB 1 --auth + command: --wiredTigerCacheSizeGB 1 volumes: - ./components/mongodb/data/db:/data/db - ./components/mongodb/data/logs:/data/logs @@ -29,8 +29,8 @@ services: - TZ=Asia/Shanghai # cache - wiredTigerCacheSizeGB=1 - - MONGO_INITDB_ROOT_USERNAME=openIM - - MONGO_INITDB_ROOT_PASSWORD=openIM +# - MONGO_INITDB_ROOT_USERNAME=openIM +# - MONGO_INITDB_ROOT_PASSWORD=openIM #TZ: Asia/Shanghai restart: always From 226108f5587d848446b766917ac60104372e319c Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 27 Jun 2022 13:31:37 +0800 Subject: [PATCH 5/8] docker-compose --- cmd/open_im_api/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index 18b4f4c5a..42b715180 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -133,7 +133,7 @@ func main() { chatGroup.POST("/pull_msg_by_seq", apiChat.PullMsgBySeqList) chatGroup.POST("/del_msg", apiChat.DelMsg) chatGroup.POST("/clear_msg", apiChat.ClearMsg) - chatGroup.POST("/send_msg", manage.ManagementSendMsg) + chatGroup.POST("/manage_send_msg", manage.ManagementSendMsg) chatGroup.POST("/batch_send_msg", manage.ManagementBatchSendMsg) } //Manager From 5207e268dec18dd51c107e32879a09ed0527bb28 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 28 Jun 2022 10:29:14 +0800 Subject: [PATCH 6/8] swagger doc --- cmd/open_im_api/docs/docs.go | 2160 +++++++++++++++++++++++- cmd/open_im_api/docs/swagger.json | 2160 +++++++++++++++++++++++- cmd/open_im_api/docs/swagger.yaml | 1433 +++++++++++++++- internal/api/manage/management_user.go | 30 +- internal/api/office/tag.go | 128 +- internal/api/office/work_moments.go | 187 +- internal/api/user/user.go | 64 +- pkg/base_info/office_struct.go | 4 +- pkg/base_info/public_struct.go | 4 +- pkg/base_info/work_moments_struct.go | 18 +- 10 files changed, 6094 insertions(+), 94 deletions(-) diff --git a/cmd/open_im_api/docs/docs.go b/cmd/open_im_api/docs/docs.go index cea8c2481..5919ca314 100644 --- a/cmd/open_im_api/docs/docs.go +++ b/cmd/open_im_api/docs/docs.go @@ -16,6 +16,1140 @@ const docTemplate = `{ "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { + "/office/comment_one_work_moment": { + "post": { + "description": "评论一条工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "评论一条工作圈", + "operationId": "CommentOneWorkMoment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CommentOneWorkMomentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CommentOneWorkMomentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.CommentOneWorkMomentResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.CommentOneWorkMomentResp" + } + } + } + } + }, + "/office/create_one_work_moment": { + "post": { + "description": "用户创建一条工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "创建一条工作圈", + "operationId": "CreateOneWorkMoment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求 atUserList likeUserList permissionGroupList permissionUserList 字段中userName可以不填", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CreateOneWorkMomentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CreateOneWorkMomentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.CreateOneWorkMomentResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.CreateOneWorkMomentResp" + } + } + } + } + }, + "/office/create_tag": { + "post": { + "description": "创建标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "创建标签", + "operationId": "CreateTag", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CreateTagReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CreateTagResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.CreateTagResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.CreateTagResp" + } + } + } + } + }, + "/office/delete_comment": { + "post": { + "description": "删除一条评论", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "删除一条评论", + "operationId": "DeleteComment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteCommentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteCommentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.DeleteCommentResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.DeleteCommentResp" + } + } + } + } + }, + "/office/delete_one_work_moment": { + "post": { + "description": "根据用户工作圈ID删除一条工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "删除一条工作圈", + "operationId": "DeleteOneWorkMoment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteOneWorkMomentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteOneWorkMomentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.DeleteOneWorkMomentResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.DeleteOneWorkMomentResp" + } + } + } + } + }, + "/office/delete_tag": { + "post": { + "description": "根据标签ID创建标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "删除标签", + "operationId": "DeleteTag", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteTagReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteTagResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.DeleteTagResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.DeleteTagResp" + } + } + } + } + }, + "/office/get_send_tag_log": { + "post": { + "description": "分页获取发送历史记录", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "获取发送历史记录", + "operationId": "GetTagSendLogs", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetTagSendLogsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetTagSendLogsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetTagSendLogsResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetTagSendLogsResp" + } + } + } + } + }, + "/office/get_user_friend_work_moments": { + "post": { + "description": "查询用户工作圈页面", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "查询自己大工作圈页面", + "operationId": "GetUserFriendWorkMoments", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserFriendWorkMomentsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUserFriendWorkMomentsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetUserFriendWorkMomentsResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetUserFriendWorkMomentsResp" + } + } + } + } + }, + "/office/get_user_tag_by_id": { + "post": { + "description": "通过标签id获取该用户的标签信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "获取该用户的标签信息", + "operationId": "GetUserTagByID", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserTagByIDReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUserTagByIDResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetUserTagByIDResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetUserTagByIDResp" + } + } + } + } + }, + "/office/get_user_tags": { + "post": { + "description": "用户获取自己的所有的标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "获取用户标签信息", + "operationId": "GetUserTags", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserTagsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUserTagsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetUserTagsResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetUserTagsResp" + } + } + } + } + }, + "/office/get_user_work_moments": { + "post": { + "description": "查询用户工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "查询用户工作圈", + "operationId": "GetUserWorkMoments", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserWorkMomentsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUserWorkMomentsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetUserWorkMomentsResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetUserWorkMomentsResp" + } + } + } + } + }, + "/office/get_work_moment_by_id": { + "post": { + "description": "通过ID获取工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "通过ID获取工作圈", + "operationId": "GetWorkMomentByID", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetWorkMomentByIDReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetWorkMomentByIDResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetWorkMomentByIDResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetWorkMomentByIDResp" + } + } + } + } + }, + "/office/like_one_work_moment": { + "post": { + "description": "工作圈ID点赞一条工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "点赞一条工作圈", + "operationId": "LikeOneWorkMoment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.LikeOneWorkMomentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.LikeOneWorkMomentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.LikeOneWorkMomentResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.LikeOneWorkMomentResp" + } + } + } + } + }, + "/office/send_msg_to_tag": { + "post": { + "description": "对标签用户发送消息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "发送标签消息", + "operationId": "SendMsg2Tag", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SendMsg2TagReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SendMsg2TagResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.SendMsg2TagResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.SendMsg2TagResp" + } + } + } + } + }, + "/office/set_tag": { + "post": { + "description": "根据标签ID修改标签用户列表, 名称", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "修改标签", + "operationId": "SetTag", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SetTagReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SetTagResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.SetTagResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.SetTagResp" + } + } + } + } + }, + "/user/account_check": { + "post": { + "description": "传入UserIDList检查列表账户注册状态,并且返回结果", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "检查列表账户注册状态,并且返回结果", + "operationId": "AccountCheck", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.AccountCheckReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.AccountCheckResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.AccountCheckResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.AccountCheckResp" + } + } + } + } + }, + "/user/get_all_users_uid": { + "post": { + "description": "获取所有用户uid列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "获取所有用户uid列表", + "operationId": "GetAllUsersUid", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetAllUsersUidReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetAllUsersUidResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetAllUsersUidResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetAllUsersUidResp" + } + } + } + } + }, + "/user/get_self_user_info": { + "post": { + "description": "传入ID获取自己的信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "获取自己的信息", + "operationId": "GetSelfUserInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetSelfUserInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetSelfUserInfoResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetSelfUserInfoResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetSelfUserInfoResp" + } + } + } + } + }, + "/user/get_users_info": { + "post": { + "description": "根据用户列表批量获取用户信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "获取用户信息", + "operationId": "GetUsersInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUsersInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUsersInfoResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetUsersInfoResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetUsersInfoResp" + } + } + } + } + }, + "/user/get_users_online_status": { + "post": { + "description": "获取用户在线状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "获取用户在线状态", + "operationId": "GetUsersOnlineStatus", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUsersOnlineStatusReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUsersOnlineStatusResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetUsersOnlineStatusResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetUsersOnlineStatusResp" + } + } + } + } + }, + "/user/set_global_msg_recv_opt": { + "post": { + "description": "设置全局免打扰", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "设置全局免打扰", + "operationId": "SetGlobalRecvMessageOpt", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SetGlobalRecvMessageOptReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SetGlobalRecvMessageOptResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.SetGlobalRecvMessageOptResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.SetGlobalRecvMessageOptResp" + } + } + } + } + }, "/user/update_user_info": { "post": { "description": "修改用户信息 userID faceURL等", @@ -26,7 +1160,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "用户信息" + "用户相关" ], "summary": "修改用户信息", "operationId": "UpdateUserInfo", @@ -39,7 +1173,7 @@ const docTemplate = `{ "required": true }, { - "description": "请求", + "description": "请求体", "name": "req", "in": "body", "required": true, @@ -72,6 +1206,776 @@ const docTemplate = `{ } }, "definitions": { + "base_info.AccountCheckReq": { + "type": "object", + "required": [ + "checkUserIDList", + "operationID" + ], + "properties": { + "checkUserIDList": { + "type": "array", + "maxItems": 100, + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.AccountCheckResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/user.AccountCheckResp_SingleUserStatus" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.Comment": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "contentID": { + "type": "string" + }, + "createTime": { + "type": "integer" + }, + "replyUserID": { + "type": "string" + }, + "replyUserName": { + "type": "string" + }, + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "base_info.CommentOneWorkMomentReq": { + "type": "object", + "required": [ + "content", + "operationID", + "replyUserID", + "workMomentID" + ], + "properties": { + "content": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "replyUserID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.CommentOneWorkMomentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CreateOneWorkMomentReq": { + "type": "object", + "properties": { + "operationID": { + "type": "string" + }, + "workMoment": { + "$ref": "#/definitions/office.WorkMoment" + } + } + }, + "base_info.CreateOneWorkMomentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CreateTagReq": { + "type": "object", + "required": [ + "operationID", + "tagName", + "userIDList" + ], + "properties": { + "operationID": { + "type": "string" + }, + "tagName": { + "description": "tag名称", + "type": "string" + }, + "userIDList": { + "description": "用户ID列表", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "base_info.CreateTagResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteCommentReq": { + "type": "object", + "required": [ + "contentID", + "operationID", + "workMomentID" + ], + "properties": { + "contentID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.DeleteCommentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteOneWorkMomentReq": { + "type": "object", + "required": [ + "operationID", + "workMomentID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.DeleteOneWorkMomentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteTagReq": { + "type": "object", + "required": [ + "operationID", + "tagID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "tagID": { + "type": "string" + } + } + }, + "base_info.DeleteTagResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetAllUsersUidReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "base_info.GetAllUsersUidResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "string" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetSelfUserInfoReq": { + "type": "object", + "required": [ + "operationID", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.GetSelfUserInfoResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": true + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetTagSendLogsReq": { + "type": "object", + "required": [ + "operationID", + "pageNumber", + "showNumber" + ], + "properties": { + "operationID": { + "type": "string" + }, + "pageNumber": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + } + } + }, + "base_info.GetTagSendLogsResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "logs": { + "type": "array", + "items": { + "$ref": "#/definitions/office.TagSendLog" + } + }, + "showNumber": { + "type": "integer" + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserFriendWorkMomentsReq": { + "type": "object", + "required": [ + "operationID", + "pageNumber", + "showNumber" + ], + "properties": { + "operationID": { + "type": "string" + }, + "pageNumber": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + } + } + }, + "base_info.GetUserFriendWorkMomentsResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + }, + "workMoments": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMoment" + } + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserTagByIDReq": { + "type": "object", + "required": [ + "operationID", + "tagID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "tagID": { + "type": "string" + } + } + }, + "base_info.GetUserTagByIDResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "tag": { + "$ref": "#/definitions/office.Tag" + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserTagsReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "base_info.GetUserTagsResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/office.Tag" + } + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserWorkMomentsReq": { + "type": "object", + "required": [ + "operationID", + "pageNumber", + "showNumber" + ], + "properties": { + "operationID": { + "type": "string" + }, + "pageNumber": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.GetUserWorkMomentsResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + }, + "workMoments": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMoment" + } + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUsersInfoReq": { + "type": "object", + "required": [ + "operationID", + "userIDList" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userIDList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "base_info.GetUsersInfoResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUsersOnlineStatusReq": { + "type": "object", + "required": [ + "operationID", + "userIDList" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userIDList": { + "type": "array", + "maxItems": 200, + "items": { + "type": "string" + } + } + } + }, + "base_info.GetUsersOnlineStatusResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/pbRelay.GetUsersOnlineStatusResp_SuccessResult" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetWorkMomentByIDReq": { + "type": "object", + "required": [ + "operationID", + "workMomentID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.GetWorkMomentByIDResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "workMoment": { + "$ref": "#/definitions/base_info.WorkMoment" + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.LikeOneWorkMomentReq": { + "type": "object", + "required": [ + "operationID", + "workMomentID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.LikeOneWorkMomentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.SendMsg2TagReq": { + "type": "object", + "required": [ + "content", + "operationID", + "senderPlatformID" + ], + "properties": { + "content": { + "type": "string" + }, + "groupList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + }, + "senderPlatformID": { + "type": "integer" + }, + "tagList": { + "type": "array", + "items": { + "type": "string" + } + }, + "userList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "base_info.SendMsg2TagResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.SetGlobalRecvMessageOptReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "globalRecvMsgOpt": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ] + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.SetGlobalRecvMessageOptResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.SetTagReq": { + "type": "object", + "required": [ + "operationID", + "tagID" + ], + "properties": { + "increaseUserIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "newName": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "reduceUserIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "tagID": { + "type": "string" + } + } + }, + "base_info.SetTagResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, "base_info.UpdateSelfUserInfoReq": { "type": "object", "required": [ @@ -131,6 +2035,258 @@ const docTemplate = `{ "type": "string" } } + }, + "base_info.WorkMoment": { + "type": "object", + "properties": { + "atUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMomentUser" + } + }, + "comments": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.Comment" + } + }, + "content": { + "type": "string" + }, + "createTime": { + "type": "integer" + }, + "faceURL": { + "type": "string" + }, + "likeUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMomentUser" + } + }, + "permission": { + "type": "integer" + }, + "permissionUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMomentUser" + } + }, + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.WorkMomentUser": { + "type": "object", + "properties": { + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "office.Comment": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "contentID": { + "type": "string" + }, + "createTime": { + "type": "integer" + }, + "faceURL": { + "type": "string" + }, + "replyUserID": { + "type": "string" + }, + "replyUserName": { + "type": "string" + }, + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "office.PermissionGroup": { + "type": "object", + "properties": { + "groupID": { + "type": "string" + }, + "groupName": { + "type": "string" + } + } + }, + "office.Tag": { + "type": "object", + "properties": { + "tagID": { + "type": "string" + }, + "tagName": { + "type": "string" + }, + "userList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.TagUser" + } + } + } + }, + "office.TagSendLog": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "sendTime": { + "type": "integer" + }, + "userList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.TagUser" + } + } + } + }, + "office.TagUser": { + "type": "object", + "properties": { + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "office.WorkMoment": { + "type": "object", + "properties": { + "atUserList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.WorkMomentUser" + } + }, + "comments": { + "type": "array", + "items": { + "$ref": "#/definitions/office.Comment" + } + }, + "content": { + "type": "string" + }, + "createTime": { + "type": "integer" + }, + "faceURL": { + "type": "string" + }, + "likeUserList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.WorkMomentUser" + } + }, + "permission": { + "type": "integer" + }, + "permissionGroupList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.PermissionGroup" + } + }, + "permissionUserList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.WorkMomentUser" + } + }, + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "office.WorkMomentUser": { + "type": "object", + "properties": { + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "pbRelay.GetUsersOnlineStatusResp_SuccessDetail": { + "type": "object", + "properties": { + "platform": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, + "pbRelay.GetUsersOnlineStatusResp_SuccessResult": { + "type": "object", + "properties": { + "detailPlatformStatus": { + "type": "array", + "items": { + "$ref": "#/definitions/pbRelay.GetUsersOnlineStatusResp_SuccessDetail" + } + }, + "status": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "user.AccountCheckResp_SingleUserStatus": { + "type": "object", + "properties": { + "accountStatus": { + "type": "string" + }, + "userID": { + "type": "string" + } + } } } }` diff --git a/cmd/open_im_api/docs/swagger.json b/cmd/open_im_api/docs/swagger.json index a15524326..4a6c587da 100644 --- a/cmd/open_im_api/docs/swagger.json +++ b/cmd/open_im_api/docs/swagger.json @@ -4,6 +4,1140 @@ "contact": {} }, "paths": { + "/office/comment_one_work_moment": { + "post": { + "description": "评论一条工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "评论一条工作圈", + "operationId": "CommentOneWorkMoment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CommentOneWorkMomentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CommentOneWorkMomentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.CommentOneWorkMomentResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.CommentOneWorkMomentResp" + } + } + } + } + }, + "/office/create_one_work_moment": { + "post": { + "description": "用户创建一条工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "创建一条工作圈", + "operationId": "CreateOneWorkMoment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求 atUserList likeUserList permissionGroupList permissionUserList 字段中userName可以不填", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CreateOneWorkMomentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CreateOneWorkMomentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.CreateOneWorkMomentResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.CreateOneWorkMomentResp" + } + } + } + } + }, + "/office/create_tag": { + "post": { + "description": "创建标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "创建标签", + "operationId": "CreateTag", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.CreateTagReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.CreateTagResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.CreateTagResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.CreateTagResp" + } + } + } + } + }, + "/office/delete_comment": { + "post": { + "description": "删除一条评论", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "删除一条评论", + "operationId": "DeleteComment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteCommentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteCommentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.DeleteCommentResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.DeleteCommentResp" + } + } + } + } + }, + "/office/delete_one_work_moment": { + "post": { + "description": "根据用户工作圈ID删除一条工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "删除一条工作圈", + "operationId": "DeleteOneWorkMoment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteOneWorkMomentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteOneWorkMomentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.DeleteOneWorkMomentResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.DeleteOneWorkMomentResp" + } + } + } + } + }, + "/office/delete_tag": { + "post": { + "description": "根据标签ID创建标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "删除标签", + "operationId": "DeleteTag", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.DeleteTagReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.DeleteTagResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.DeleteTagResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.DeleteTagResp" + } + } + } + } + }, + "/office/get_send_tag_log": { + "post": { + "description": "分页获取发送历史记录", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "获取发送历史记录", + "operationId": "GetTagSendLogs", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetTagSendLogsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetTagSendLogsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetTagSendLogsResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetTagSendLogsResp" + } + } + } + } + }, + "/office/get_user_friend_work_moments": { + "post": { + "description": "查询用户工作圈页面", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "查询自己大工作圈页面", + "operationId": "GetUserFriendWorkMoments", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserFriendWorkMomentsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUserFriendWorkMomentsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetUserFriendWorkMomentsResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetUserFriendWorkMomentsResp" + } + } + } + } + }, + "/office/get_user_tag_by_id": { + "post": { + "description": "通过标签id获取该用户的标签信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "获取该用户的标签信息", + "operationId": "GetUserTagByID", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserTagByIDReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUserTagByIDResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetUserTagByIDResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetUserTagByIDResp" + } + } + } + } + }, + "/office/get_user_tags": { + "post": { + "description": "用户获取自己的所有的标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "获取用户标签信息", + "operationId": "GetUserTags", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserTagsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUserTagsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetUserTagsResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetUserTagsResp" + } + } + } + } + }, + "/office/get_user_work_moments": { + "post": { + "description": "查询用户工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "查询用户工作圈", + "operationId": "GetUserWorkMoments", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUserWorkMomentsReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUserWorkMomentsResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetUserWorkMomentsResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetUserWorkMomentsResp" + } + } + } + } + }, + "/office/get_work_moment_by_id": { + "post": { + "description": "通过ID获取工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "通过ID获取工作圈", + "operationId": "GetWorkMomentByID", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetWorkMomentByIDReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetWorkMomentByIDResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetWorkMomentByIDResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetWorkMomentByIDResp" + } + } + } + } + }, + "/office/like_one_work_moment": { + "post": { + "description": "工作圈ID点赞一条工作圈", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作圈" + ], + "summary": "点赞一条工作圈", + "operationId": "LikeOneWorkMoment", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.LikeOneWorkMomentReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.LikeOneWorkMomentResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.LikeOneWorkMomentResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.LikeOneWorkMomentResp" + } + } + } + } + }, + "/office/send_msg_to_tag": { + "post": { + "description": "对标签用户发送消息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "发送标签消息", + "operationId": "SendMsg2Tag", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SendMsg2TagReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SendMsg2TagResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.SendMsg2TagResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.SendMsg2TagResp" + } + } + } + } + }, + "/office/set_tag": { + "post": { + "description": "根据标签ID修改标签用户列表, 名称", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "标签" + ], + "summary": "修改标签", + "operationId": "SetTag", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SetTagReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SetTagResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.SetTagResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.SetTagResp" + } + } + } + } + }, + "/user/account_check": { + "post": { + "description": "传入UserIDList检查列表账户注册状态,并且返回结果", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "检查列表账户注册状态,并且返回结果", + "operationId": "AccountCheck", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.AccountCheckReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.AccountCheckResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.AccountCheckResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.AccountCheckResp" + } + } + } + } + }, + "/user/get_all_users_uid": { + "post": { + "description": "获取所有用户uid列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "获取所有用户uid列表", + "operationId": "GetAllUsersUid", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetAllUsersUidReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetAllUsersUidResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetAllUsersUidResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetAllUsersUidResp" + } + } + } + } + }, + "/user/get_self_user_info": { + "post": { + "description": "传入ID获取自己的信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "获取自己的信息", + "operationId": "GetSelfUserInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetSelfUserInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetSelfUserInfoResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetSelfUserInfoResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetSelfUserInfoResp" + } + } + } + } + }, + "/user/get_users_info": { + "post": { + "description": "根据用户列表批量获取用户信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "获取用户信息", + "operationId": "GetUsersInfo", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUsersInfoReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUsersInfoResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetUsersInfoResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetUsersInfoResp" + } + } + } + } + }, + "/user/get_users_online_status": { + "post": { + "description": "获取用户在线状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "获取用户在线状态", + "operationId": "GetUsersOnlineStatus", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.GetUsersOnlineStatusReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.GetUsersOnlineStatusResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.GetUsersOnlineStatusResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.GetUsersOnlineStatusResp" + } + } + } + } + }, + "/user/set_global_msg_recv_opt": { + "post": { + "description": "设置全局免打扰", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户相关" + ], + "summary": "设置全局免打扰", + "operationId": "SetGlobalRecvMessageOpt", + "parameters": [ + { + "type": "string", + "description": "im token", + "name": "token", + "in": "header", + "required": true + }, + { + "description": "请求体", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/base_info.SetGlobalRecvMessageOptReq" + } + } + ], + "responses": { + "0": { + "description": "", + "schema": { + "$ref": "#/definitions/base_info.SetGlobalRecvMessageOptResp" + } + }, + "400": { + "description": "errCode为400 一般为参数输入错误, token未带上等", + "schema": { + "$ref": "#/definitions/base_info.SetGlobalRecvMessageOptResp" + } + }, + "500": { + "description": "errCode为500 一般为服务器内部错误", + "schema": { + "$ref": "#/definitions/base_info.SetGlobalRecvMessageOptResp" + } + } + } + } + }, "/user/update_user_info": { "post": { "description": "修改用户信息 userID faceURL等", @@ -14,7 +1148,7 @@ "application/json" ], "tags": [ - "用户信息" + "用户相关" ], "summary": "修改用户信息", "operationId": "UpdateUserInfo", @@ -27,7 +1161,7 @@ "required": true }, { - "description": "请求", + "description": "请求体", "name": "req", "in": "body", "required": true, @@ -60,6 +1194,776 @@ } }, "definitions": { + "base_info.AccountCheckReq": { + "type": "object", + "required": [ + "checkUserIDList", + "operationID" + ], + "properties": { + "checkUserIDList": { + "type": "array", + "maxItems": 100, + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.AccountCheckResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/user.AccountCheckResp_SingleUserStatus" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.Comment": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "contentID": { + "type": "string" + }, + "createTime": { + "type": "integer" + }, + "replyUserID": { + "type": "string" + }, + "replyUserName": { + "type": "string" + }, + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "base_info.CommentOneWorkMomentReq": { + "type": "object", + "required": [ + "content", + "operationID", + "replyUserID", + "workMomentID" + ], + "properties": { + "content": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "replyUserID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.CommentOneWorkMomentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CreateOneWorkMomentReq": { + "type": "object", + "properties": { + "operationID": { + "type": "string" + }, + "workMoment": { + "$ref": "#/definitions/office.WorkMoment" + } + } + }, + "base_info.CreateOneWorkMomentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.CreateTagReq": { + "type": "object", + "required": [ + "operationID", + "tagName", + "userIDList" + ], + "properties": { + "operationID": { + "type": "string" + }, + "tagName": { + "description": "tag名称", + "type": "string" + }, + "userIDList": { + "description": "用户ID列表", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "base_info.CreateTagResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteCommentReq": { + "type": "object", + "required": [ + "contentID", + "operationID", + "workMomentID" + ], + "properties": { + "contentID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.DeleteCommentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteOneWorkMomentReq": { + "type": "object", + "required": [ + "operationID", + "workMomentID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.DeleteOneWorkMomentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.DeleteTagReq": { + "type": "object", + "required": [ + "operationID", + "tagID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "tagID": { + "type": "string" + } + } + }, + "base_info.DeleteTagResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetAllUsersUidReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "base_info.GetAllUsersUidResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "string" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetSelfUserInfoReq": { + "type": "object", + "required": [ + "operationID", + "userID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.GetSelfUserInfoResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": true + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetTagSendLogsReq": { + "type": "object", + "required": [ + "operationID", + "pageNumber", + "showNumber" + ], + "properties": { + "operationID": { + "type": "string" + }, + "pageNumber": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + } + } + }, + "base_info.GetTagSendLogsResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "logs": { + "type": "array", + "items": { + "$ref": "#/definitions/office.TagSendLog" + } + }, + "showNumber": { + "type": "integer" + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserFriendWorkMomentsReq": { + "type": "object", + "required": [ + "operationID", + "pageNumber", + "showNumber" + ], + "properties": { + "operationID": { + "type": "string" + }, + "pageNumber": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + } + } + }, + "base_info.GetUserFriendWorkMomentsResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + }, + "workMoments": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMoment" + } + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserTagByIDReq": { + "type": "object", + "required": [ + "operationID", + "tagID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "tagID": { + "type": "string" + } + } + }, + "base_info.GetUserTagByIDResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "tag": { + "$ref": "#/definitions/office.Tag" + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserTagsReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "base_info.GetUserTagsResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/office.Tag" + } + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUserWorkMomentsReq": { + "type": "object", + "required": [ + "operationID", + "pageNumber", + "showNumber" + ], + "properties": { + "operationID": { + "type": "string" + }, + "pageNumber": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, + "base_info.GetUserWorkMomentsResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "showNumber": { + "type": "integer" + }, + "workMoments": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMoment" + } + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUsersInfoReq": { + "type": "object", + "required": [ + "operationID", + "userIDList" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userIDList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "base_info.GetUsersInfoResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetUsersOnlineStatusReq": { + "type": "object", + "required": [ + "operationID", + "userIDList" + ], + "properties": { + "operationID": { + "type": "string" + }, + "userIDList": { + "type": "array", + "maxItems": 200, + "items": { + "type": "string" + } + } + } + }, + "base_info.GetUsersOnlineStatusResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/pbRelay.GetUsersOnlineStatusResp_SuccessResult" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.GetWorkMomentByIDReq": { + "type": "object", + "required": [ + "operationID", + "workMomentID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.GetWorkMomentByIDResp": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "workMoment": { + "$ref": "#/definitions/base_info.WorkMoment" + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.LikeOneWorkMomentReq": { + "type": "object", + "required": [ + "operationID", + "workMomentID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.LikeOneWorkMomentResp": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.SendMsg2TagReq": { + "type": "object", + "required": [ + "content", + "operationID", + "senderPlatformID" + ], + "properties": { + "content": { + "type": "string" + }, + "groupList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + }, + "senderPlatformID": { + "type": "integer" + }, + "tagList": { + "type": "array", + "items": { + "type": "string" + } + }, + "userList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "base_info.SendMsg2TagResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.SetGlobalRecvMessageOptReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "globalRecvMsgOpt": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ] + }, + "operationID": { + "type": "string" + } + } + }, + "base_info.SetGlobalRecvMessageOptResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "base_info.SetTagReq": { + "type": "object", + "required": [ + "operationID", + "tagID" + ], + "properties": { + "increaseUserIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "newName": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "reduceUserIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "tagID": { + "type": "string" + } + } + }, + "base_info.SetTagResp": { + "type": "object", + "properties": { + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, "base_info.UpdateSelfUserInfoReq": { "type": "object", "required": [ @@ -119,6 +2023,258 @@ "type": "string" } } + }, + "base_info.WorkMoment": { + "type": "object", + "properties": { + "atUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMomentUser" + } + }, + "comments": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.Comment" + } + }, + "content": { + "type": "string" + }, + "createTime": { + "type": "integer" + }, + "faceURL": { + "type": "string" + }, + "likeUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMomentUser" + } + }, + "permission": { + "type": "integer" + }, + "permissionUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/base_info.WorkMomentUser" + } + }, + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "base_info.WorkMomentUser": { + "type": "object", + "properties": { + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "office.Comment": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "contentID": { + "type": "string" + }, + "createTime": { + "type": "integer" + }, + "faceURL": { + "type": "string" + }, + "replyUserID": { + "type": "string" + }, + "replyUserName": { + "type": "string" + }, + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "office.PermissionGroup": { + "type": "object", + "properties": { + "groupID": { + "type": "string" + }, + "groupName": { + "type": "string" + } + } + }, + "office.Tag": { + "type": "object", + "properties": { + "tagID": { + "type": "string" + }, + "tagName": { + "type": "string" + }, + "userList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.TagUser" + } + } + } + }, + "office.TagSendLog": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "sendTime": { + "type": "integer" + }, + "userList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.TagUser" + } + } + } + }, + "office.TagUser": { + "type": "object", + "properties": { + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "office.WorkMoment": { + "type": "object", + "properties": { + "atUserList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.WorkMomentUser" + } + }, + "comments": { + "type": "array", + "items": { + "$ref": "#/definitions/office.Comment" + } + }, + "content": { + "type": "string" + }, + "createTime": { + "type": "integer" + }, + "faceURL": { + "type": "string" + }, + "likeUserList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.WorkMomentUser" + } + }, + "permission": { + "type": "integer" + }, + "permissionGroupList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.PermissionGroup" + } + }, + "permissionUserList": { + "type": "array", + "items": { + "$ref": "#/definitions/office.WorkMomentUser" + } + }, + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + }, + "workMomentID": { + "type": "string" + } + } + }, + "office.WorkMomentUser": { + "type": "object", + "properties": { + "userID": { + "type": "string" + }, + "userName": { + "type": "string" + } + } + }, + "pbRelay.GetUsersOnlineStatusResp_SuccessDetail": { + "type": "object", + "properties": { + "platform": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, + "pbRelay.GetUsersOnlineStatusResp_SuccessResult": { + "type": "object", + "properties": { + "detailPlatformStatus": { + "type": "array", + "items": { + "$ref": "#/definitions/pbRelay.GetUsersOnlineStatusResp_SuccessDetail" + } + }, + "status": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "user.AccountCheckResp_SingleUserStatus": { + "type": "object", + "properties": { + "accountStatus": { + "type": "string" + }, + "userID": { + "type": "string" + } + } } } } \ No newline at end of file diff --git a/cmd/open_im_api/docs/swagger.yaml b/cmd/open_im_api/docs/swagger.yaml index 9803f031a..c8b35f1c6 100644 --- a/cmd/open_im_api/docs/swagger.yaml +++ b/cmd/open_im_api/docs/swagger.yaml @@ -1,4 +1,512 @@ definitions: + base_info.AccountCheckReq: + properties: + checkUserIDList: + items: + type: string + maxItems: 100 + type: array + operationID: + type: string + required: + - checkUserIDList + - operationID + type: object + base_info.AccountCheckResp: + properties: + data: + items: + $ref: '#/definitions/user.AccountCheckResp_SingleUserStatus' + type: array + errCode: + type: integer + errMsg: + type: string + type: object + base_info.Comment: + properties: + content: + type: string + contentID: + type: string + createTime: + type: integer + replyUserID: + type: string + replyUserName: + type: string + userID: + type: string + userName: + type: string + type: object + base_info.CommentOneWorkMomentReq: + properties: + content: + type: string + operationID: + type: string + replyUserID: + type: string + workMomentID: + type: string + required: + - content + - operationID + - replyUserID + - workMomentID + type: object + base_info.CommentOneWorkMomentResp: + properties: + data: + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.CreateOneWorkMomentReq: + properties: + operationID: + type: string + workMoment: + $ref: '#/definitions/office.WorkMoment' + type: object + base_info.CreateOneWorkMomentResp: + properties: + data: + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.CreateTagReq: + properties: + operationID: + type: string + tagName: + description: tag名称 + type: string + userIDList: + description: 用户ID列表 + items: + type: string + type: array + required: + - operationID + - tagName + - userIDList + type: object + base_info.CreateTagResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.DeleteCommentReq: + properties: + contentID: + type: string + operationID: + type: string + workMomentID: + type: string + required: + - contentID + - operationID + - workMomentID + type: object + base_info.DeleteCommentResp: + properties: + data: + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.DeleteOneWorkMomentReq: + properties: + operationID: + type: string + workMomentID: + type: string + required: + - operationID + - workMomentID + type: object + base_info.DeleteOneWorkMomentResp: + properties: + data: + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.DeleteTagReq: + properties: + operationID: + type: string + tagID: + type: string + required: + - operationID + - tagID + type: object + base_info.DeleteTagResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetAllUsersUidReq: + properties: + operationID: + type: string + required: + - operationID + type: object + base_info.GetAllUsersUidResp: + properties: + data: + items: + type: string + type: array + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetSelfUserInfoReq: + properties: + operationID: + type: string + userID: + type: string + required: + - operationID + - userID + type: object + base_info.GetSelfUserInfoResp: + properties: + data: + additionalProperties: true + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetTagSendLogsReq: + properties: + operationID: + type: string + pageNumber: + type: integer + showNumber: + type: integer + required: + - operationID + - pageNumber + - showNumber + type: object + base_info.GetTagSendLogsResp: + properties: + data: + properties: + currentPage: + type: integer + logs: + items: + $ref: '#/definitions/office.TagSendLog' + type: array + showNumber: + type: integer + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetUserFriendWorkMomentsReq: + properties: + operationID: + type: string + pageNumber: + type: integer + showNumber: + type: integer + required: + - operationID + - pageNumber + - showNumber + type: object + base_info.GetUserFriendWorkMomentsResp: + properties: + data: + properties: + currentPage: + type: integer + showNumber: + type: integer + workMoments: + items: + $ref: '#/definitions/base_info.WorkMoment' + type: array + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetUserTagByIDReq: + properties: + operationID: + type: string + tagID: + type: string + required: + - operationID + - tagID + type: object + base_info.GetUserTagByIDResp: + properties: + data: + properties: + tag: + $ref: '#/definitions/office.Tag' + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetUserTagsReq: + properties: + operationID: + type: string + required: + - operationID + type: object + base_info.GetUserTagsResp: + properties: + data: + properties: + tags: + items: + $ref: '#/definitions/office.Tag' + type: array + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetUserWorkMomentsReq: + properties: + operationID: + type: string + pageNumber: + type: integer + showNumber: + type: integer + userID: + type: string + required: + - operationID + - pageNumber + - showNumber + type: object + base_info.GetUserWorkMomentsResp: + properties: + data: + properties: + currentPage: + type: integer + showNumber: + type: integer + workMoments: + items: + $ref: '#/definitions/base_info.WorkMoment' + type: array + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetUsersInfoReq: + properties: + operationID: + type: string + userIDList: + items: + type: string + type: array + required: + - operationID + - userIDList + type: object + base_info.GetUsersInfoResp: + properties: + data: + items: + additionalProperties: true + type: object + type: array + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetUsersOnlineStatusReq: + properties: + operationID: + type: string + userIDList: + items: + type: string + maxItems: 200 + type: array + required: + - operationID + - userIDList + type: object + base_info.GetUsersOnlineStatusResp: + properties: + data: + items: + $ref: '#/definitions/pbRelay.GetUsersOnlineStatusResp_SuccessResult' + type: array + errCode: + type: integer + errMsg: + type: string + type: object + base_info.GetWorkMomentByIDReq: + properties: + operationID: + type: string + workMomentID: + type: string + required: + - operationID + - workMomentID + type: object + base_info.GetWorkMomentByIDResp: + properties: + data: + properties: + workMoment: + $ref: '#/definitions/base_info.WorkMoment' + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.LikeOneWorkMomentReq: + properties: + operationID: + type: string + workMomentID: + type: string + required: + - operationID + - workMomentID + type: object + base_info.LikeOneWorkMomentResp: + properties: + data: + type: object + errCode: + type: integer + errMsg: + type: string + type: object + base_info.SendMsg2TagReq: + properties: + content: + type: string + groupList: + items: + type: string + type: array + operationID: + type: string + senderPlatformID: + type: integer + tagList: + items: + type: string + type: array + userList: + items: + type: string + type: array + required: + - content + - operationID + - senderPlatformID + type: object + base_info.SendMsg2TagResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.SetGlobalRecvMessageOptReq: + properties: + globalRecvMsgOpt: + enum: + - 0 + - 1 + - 2 + type: integer + operationID: + type: string + required: + - operationID + type: object + base_info.SetGlobalRecvMessageOptResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object + base_info.SetTagReq: + properties: + increaseUserIDList: + items: + type: string + type: array + newName: + type: string + operationID: + type: string + reduceUserIDList: + items: + type: string + type: array + tagID: + type: string + required: + - operationID + - tagID + type: object + base_info.SetTagResp: + properties: + errCode: + type: integer + errMsg: + type: string + type: object base_info.UpdateSelfUserInfoReq: properties: birth: @@ -42,9 +550,930 @@ definitions: errMsg: type: string type: object + base_info.WorkMoment: + properties: + atUsers: + items: + $ref: '#/definitions/base_info.WorkMomentUser' + type: array + comments: + items: + $ref: '#/definitions/base_info.Comment' + type: array + content: + type: string + createTime: + type: integer + faceURL: + type: string + likeUsers: + items: + $ref: '#/definitions/base_info.WorkMomentUser' + type: array + permission: + type: integer + permissionUsers: + items: + $ref: '#/definitions/base_info.WorkMomentUser' + type: array + userID: + type: string + userName: + type: string + workMomentID: + type: string + type: object + base_info.WorkMomentUser: + properties: + userID: + type: string + userName: + type: string + type: object + office.Comment: + properties: + content: + type: string + contentID: + type: string + createTime: + type: integer + faceURL: + type: string + replyUserID: + type: string + replyUserName: + type: string + userID: + type: string + userName: + type: string + type: object + office.PermissionGroup: + properties: + groupID: + type: string + groupName: + type: string + type: object + office.Tag: + properties: + tagID: + type: string + tagName: + type: string + userList: + items: + $ref: '#/definitions/office.TagUser' + type: array + type: object + office.TagSendLog: + properties: + content: + type: string + sendTime: + type: integer + userList: + items: + $ref: '#/definitions/office.TagUser' + type: array + type: object + office.TagUser: + properties: + userID: + type: string + userName: + type: string + type: object + office.WorkMoment: + properties: + atUserList: + items: + $ref: '#/definitions/office.WorkMomentUser' + type: array + comments: + items: + $ref: '#/definitions/office.Comment' + type: array + content: + type: string + createTime: + type: integer + faceURL: + type: string + likeUserList: + items: + $ref: '#/definitions/office.WorkMomentUser' + type: array + permission: + type: integer + permissionGroupList: + items: + $ref: '#/definitions/office.PermissionGroup' + type: array + permissionUserList: + items: + $ref: '#/definitions/office.WorkMomentUser' + type: array + userID: + type: string + userName: + type: string + workMomentID: + type: string + type: object + office.WorkMomentUser: + properties: + userID: + type: string + userName: + type: string + type: object + pbRelay.GetUsersOnlineStatusResp_SuccessDetail: + properties: + platform: + type: string + status: + type: string + type: object + pbRelay.GetUsersOnlineStatusResp_SuccessResult: + properties: + detailPlatformStatus: + items: + $ref: '#/definitions/pbRelay.GetUsersOnlineStatusResp_SuccessDetail' + type: array + status: + type: string + userID: + type: string + type: object + user.AccountCheckResp_SingleUserStatus: + properties: + accountStatus: + type: string + userID: + type: string + type: object info: contact: {} paths: + /office/comment_one_work_moment: + post: + consumes: + - application/json + description: 评论一条工作圈 + operationId: CommentOneWorkMoment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.CommentOneWorkMomentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.CommentOneWorkMomentResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.CommentOneWorkMomentResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.CommentOneWorkMomentResp' + summary: 评论一条工作圈 + tags: + - 工作圈 + /office/create_one_work_moment: + post: + consumes: + - application/json + description: 用户创建一条工作圈 + operationId: CreateOneWorkMoment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 atUserList likeUserList permissionGroupList permissionUserList + 字段中userName可以不填 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.CreateOneWorkMomentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.CreateOneWorkMomentResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.CreateOneWorkMomentResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.CreateOneWorkMomentResp' + summary: 创建一条工作圈 + tags: + - 工作圈 + /office/create_tag: + post: + consumes: + - application/json + description: 创建标签 + operationId: CreateTag + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.CreateTagReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.CreateTagResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.CreateTagResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.CreateTagResp' + summary: 创建标签 + tags: + - 标签 + /office/delete_comment: + post: + consumes: + - application/json + description: 删除一条评论 + operationId: DeleteComment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.DeleteCommentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.DeleteCommentResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.DeleteCommentResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.DeleteCommentResp' + summary: 删除一条评论 + tags: + - 工作圈 + /office/delete_one_work_moment: + post: + consumes: + - application/json + description: 根据用户工作圈ID删除一条工作圈 + operationId: DeleteOneWorkMoment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.DeleteOneWorkMomentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.DeleteOneWorkMomentResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.DeleteOneWorkMomentResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.DeleteOneWorkMomentResp' + summary: 删除一条工作圈 + tags: + - 工作圈 + /office/delete_tag: + post: + consumes: + - application/json + description: 根据标签ID创建标签 + operationId: DeleteTag + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.DeleteTagReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.DeleteTagResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.DeleteTagResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.DeleteTagResp' + summary: 删除标签 + tags: + - 标签 + /office/get_send_tag_log: + post: + consumes: + - application/json + description: 分页获取发送历史记录 + operationId: GetTagSendLogs + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetTagSendLogsReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetTagSendLogsResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.GetTagSendLogsResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetTagSendLogsResp' + summary: 获取发送历史记录 + tags: + - 标签 + /office/get_user_friend_work_moments: + post: + consumes: + - application/json + description: 查询用户工作圈页面 + operationId: GetUserFriendWorkMoments + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetUserFriendWorkMomentsReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetUserFriendWorkMomentsResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.GetUserFriendWorkMomentsResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetUserFriendWorkMomentsResp' + summary: 查询自己大工作圈页面 + tags: + - 工作圈 + /office/get_user_tag_by_id: + post: + consumes: + - application/json + description: 通过标签id获取该用户的标签信息 + operationId: GetUserTagByID + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetUserTagByIDReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetUserTagByIDResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.GetUserTagByIDResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetUserTagByIDResp' + summary: 获取该用户的标签信息 + tags: + - 标签 + /office/get_user_tags: + post: + consumes: + - application/json + description: 用户获取自己的所有的标签 + operationId: GetUserTags + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetUserTagsReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetUserTagsResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.GetUserTagsResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetUserTagsResp' + summary: 获取用户标签信息 + tags: + - 标签 + /office/get_user_work_moments: + post: + consumes: + - application/json + description: 查询用户工作圈 + operationId: GetUserWorkMoments + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetUserWorkMomentsReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetUserWorkMomentsResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.GetUserWorkMomentsResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetUserWorkMomentsResp' + summary: 查询用户工作圈 + tags: + - 工作圈 + /office/get_work_moment_by_id: + post: + consumes: + - application/json + description: 通过ID获取工作圈 + operationId: GetWorkMomentByID + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetWorkMomentByIDReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetWorkMomentByIDResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.GetWorkMomentByIDResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetWorkMomentByIDResp' + summary: 通过ID获取工作圈 + tags: + - 工作圈 + /office/like_one_work_moment: + post: + consumes: + - application/json + description: 工作圈ID点赞一条工作圈 + operationId: LikeOneWorkMoment + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.LikeOneWorkMomentReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.LikeOneWorkMomentResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.LikeOneWorkMomentResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.LikeOneWorkMomentResp' + summary: 点赞一条工作圈 + tags: + - 工作圈 + /office/send_msg_to_tag: + post: + consumes: + - application/json + description: 对标签用户发送消息 + operationId: SendMsg2Tag + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.SendMsg2TagReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.SendMsg2TagResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.SendMsg2TagResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.SendMsg2TagResp' + summary: 发送标签消息 + tags: + - 标签 + /office/set_tag: + post: + consumes: + - application/json + description: 根据标签ID修改标签用户列表, 名称 + operationId: SetTag + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.SetTagReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.SetTagResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.SetTagResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.SetTagResp' + summary: 修改标签 + tags: + - 标签 + /user/account_check: + post: + consumes: + - application/json + description: 传入UserIDList检查列表账户注册状态,并且返回结果 + operationId: AccountCheck + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求体 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.AccountCheckReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.AccountCheckResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.AccountCheckResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.AccountCheckResp' + summary: 检查列表账户注册状态,并且返回结果 + tags: + - 用户相关 + /user/get_all_users_uid: + post: + consumes: + - application/json + description: 获取所有用户uid列表 + operationId: GetAllUsersUid + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求体 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetAllUsersUidReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetAllUsersUidResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.GetAllUsersUidResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetAllUsersUidResp' + summary: 获取所有用户uid列表 + tags: + - 用户相关 + /user/get_self_user_info: + post: + consumes: + - application/json + description: 传入ID获取自己的信息 + operationId: GetSelfUserInfo + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求体 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetSelfUserInfoReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetSelfUserInfoResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.GetSelfUserInfoResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetSelfUserInfoResp' + summary: 获取自己的信息 + tags: + - 用户相关 + /user/get_users_info: + post: + consumes: + - application/json + description: 根据用户列表批量获取用户信息 + operationId: GetUsersInfo + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求体 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetUsersInfoReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetUsersInfoResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.GetUsersInfoResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetUsersInfoResp' + summary: 获取用户信息 + tags: + - 用户相关 + /user/get_users_online_status: + post: + consumes: + - application/json + description: 获取用户在线状态 + operationId: GetUsersOnlineStatus + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求体 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.GetUsersOnlineStatusReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.GetUsersOnlineStatusResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.GetUsersOnlineStatusResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.GetUsersOnlineStatusResp' + summary: 获取用户在线状态 + tags: + - 用户相关 + /user/set_global_msg_recv_opt: + post: + consumes: + - application/json + description: 设置全局免打扰 + operationId: SetGlobalRecvMessageOpt + parameters: + - description: im token + in: header + name: token + required: true + type: string + - description: 请求体 + in: body + name: req + required: true + schema: + $ref: '#/definitions/base_info.SetGlobalRecvMessageOptReq' + produces: + - application/json + responses: + "0": + description: "" + schema: + $ref: '#/definitions/base_info.SetGlobalRecvMessageOptResp' + "400": + description: errCode为400 一般为参数输入错误, token未带上等 + schema: + $ref: '#/definitions/base_info.SetGlobalRecvMessageOptResp' + "500": + description: errCode为500 一般为服务器内部错误 + schema: + $ref: '#/definitions/base_info.SetGlobalRecvMessageOptResp' + summary: 设置全局免打扰 + tags: + - 用户相关 /user/update_user_info: post: consumes: @@ -57,7 +1486,7 @@ paths: name: token required: true type: string - - description: 请求 + - description: 请求体 in: body name: req required: true @@ -80,5 +1509,5 @@ paths: $ref: '#/definitions/base_info.UpdateUserInfoResp' summary: 修改用户信息 tags: - - 用户信息 + - 用户相关 swagger: "2.0" diff --git a/internal/api/manage/management_user.go b/internal/api/manage/management_user.go index 62d2d6651..775c31366 100644 --- a/internal/api/manage/management_user.go +++ b/internal/api/manage/management_user.go @@ -64,6 +64,19 @@ func DeleteUser(c *gin.Context) { log.NewInfo(req.OperationID, "DeleteUser api return", resp) c.JSON(http.StatusOK, resp) } + +// @Summary 获取所有用户uid列表 +// @Description 获取所有用户uid列表 +// @Tags 用户相关 +// @ID GetAllUsersUid +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetAllUsersUidReq true "请求体" +// @Produce json +// @Success 0 {object} api.GetAllUsersUidResp +// @Failure 500 {object} api.GetAllUsersUidResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetAllUsersUidResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /user/get_all_users_uid [post] func GetAllUsersUid(c *gin.Context) { params := api.GetAllUsersUidReq{} if err := c.BindJSON(¶ms); err != nil { @@ -79,7 +92,7 @@ func GetAllUsersUid(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } @@ -106,6 +119,19 @@ func GetAllUsersUid(c *gin.Context) { c.JSON(http.StatusOK, resp) } + +// @Summary 检查列表账户注册状态,并且返回结果 +// @Description 传入UserIDList检查列表账户注册状态,并且返回结果 +// @Tags 用户相关 +// @ID AccountCheck +// @Accept json +// @Param token header string true "im token" +// @Param req body api.AccountCheckReq true "请求体" +// @Produce json +// @Success 0 {object} api.AccountCheckResp +// @Failure 500 {object} api.AccountCheckResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.AccountCheckResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /user/account_check [post] func AccountCheck(c *gin.Context) { params := api.AccountCheckReq{} if err := c.BindJSON(¶ms); err != nil { @@ -121,7 +147,7 @@ func AccountCheck(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } diff --git a/internal/api/office/tag.go b/internal/api/office/tag.go index 9617d381d..b23c75826 100644 --- a/internal/api/office/tag.go +++ b/internal/api/office/tag.go @@ -1,7 +1,7 @@ package office import ( - apistruct "Open_IM/pkg/base_info" + api "Open_IM/pkg/base_info" "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/common/token_verify" @@ -16,10 +16,22 @@ import ( "strings" ) +// @Summary 获取用户标签信息 +// @Description 用户获取自己的所有的标签 +// @Tags 标签 +// @ID GetUserTags +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetUserTagsReq true "请求" +// @Produce json +// @Success 0 {object} api.GetUserTagsResp +// @Failure 500 {object} api.GetUserTagsResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetUserTagsResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/get_user_tags [post] func GetUserTags(c *gin.Context) { var ( - req apistruct.GetUserTagsReq - resp apistruct.GetUserTagsResp + req api.GetUserTagsReq + resp api.GetUserTagsResp reqPb pbOffice.GetUserTagsReq respPb *pbOffice.GetUserTagsResp ) @@ -36,7 +48,7 @@ func GetUserTags(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } @@ -67,10 +79,22 @@ func GetUserTags(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 创建标签 +// @Description 创建标签 +// @Tags 标签 +// @ID CreateTag +// @Accept json +// @Param token header string true "im token" +// @Param req body api.CreateTagReq true "请求" +// @Produce json +// @Success 0 {object} api.CreateTagResp +// @Failure 500 {object} api.CreateTagResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.CreateTagResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/create_tag [post] func CreateTag(c *gin.Context) { var ( - req apistruct.CreateTagReq - resp apistruct.CreateTagResp + req api.CreateTagReq + resp api.CreateTagResp reqPb pbOffice.CreateTagReq respPb *pbOffice.CreateTagResp ) @@ -90,7 +114,7 @@ func CreateTag(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } @@ -115,10 +139,22 @@ func CreateTag(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 删除标签 +// @Description 根据标签ID创建标签 +// @Tags 标签 +// @ID DeleteTag +// @Accept json +// @Param token header string true "im token" +// @Param req body api.DeleteTagReq true "请求" +// @Produce json +// @Success 0 {object} api.DeleteTagResp +// @Failure 500 {object} api.DeleteTagResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.DeleteTagResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/delete_tag [post] func DeleteTag(c *gin.Context) { var ( - req apistruct.DeleteTagReq - resp apistruct.DeleteTagResp + req api.DeleteTagReq + resp api.DeleteTagResp reqPb pbOffice.DeleteTagReq respPb *pbOffice.DeleteTagResp ) @@ -138,7 +174,7 @@ func DeleteTag(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } @@ -163,10 +199,22 @@ func DeleteTag(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 修改标签 +// @Description 根据标签ID修改标签用户列表, 名称 +// @Tags 标签 +// @ID SetTag +// @Accept json +// @Param token header string true "im token" +// @Param req body api.SetTagReq true "请求" +// @Produce json +// @Success 0 {object} api.SetTagResp +// @Failure 500 {object} api.SetTagResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.SetTagResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/set_tag [post] func SetTag(c *gin.Context) { var ( - req apistruct.SetTagReq - resp apistruct.SetTagResp + req api.SetTagReq + resp api.SetTagResp reqPb pbOffice.SetTagReq respPb *pbOffice.SetTagResp ) @@ -211,10 +259,22 @@ func SetTag(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 发送标签消息 +// @Description 对标签用户发送消息 +// @Tags 标签 +// @ID SendMsg2Tag +// @Accept json +// @Param token header string true "im token" +// @Param req body api.SendMsg2TagReq true "请求" +// @Produce json +// @Success 0 {object} api.SendMsg2TagResp +// @Failure 500 {object} api.SendMsg2TagResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.SendMsg2TagResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/send_msg_to_tag [post] func SendMsg2Tag(c *gin.Context) { var ( - req apistruct.SendMsg2TagReq - resp apistruct.SendMsg2TagResp + req api.SendMsg2TagReq + resp api.SendMsg2TagResp reqPb pbOffice.SendMsg2TagReq respPb *pbOffice.SendMsg2TagResp ) @@ -234,7 +294,7 @@ func SendMsg2Tag(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } @@ -259,10 +319,22 @@ func SendMsg2Tag(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 获取发送历史记录 +// @Description 分页获取发送历史记录 +// @Tags 标签 +// @ID GetTagSendLogs +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetTagSendLogsReq true "请求" +// @Produce json +// @Success 0 {object} api.GetTagSendLogsResp +// @Failure 500 {object} api.GetTagSendLogsResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetTagSendLogsResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/get_send_tag_log [post] func GetTagSendLogs(c *gin.Context) { var ( - req apistruct.GetTagSendLogsReq - resp apistruct.GetTagSendLogsResp + req api.GetTagSendLogsReq + resp api.GetTagSendLogsResp reqPb pbOffice.GetTagSendLogsReq respPb *pbOffice.GetTagSendLogsResp ) @@ -279,7 +351,7 @@ func GetTagSendLogs(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } @@ -293,7 +365,7 @@ func GetTagSendLogs(c *gin.Context) { if etcdConn == nil { errMsg := req.OperationID + "getcdv3.GetConn == nil" 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 } client := pbOffice.NewOfficeServiceClient(etcdConn) @@ -317,10 +389,22 @@ func GetTagSendLogs(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 获取该用户的标签信息 +// @Description 通过标签id获取该用户的标签信息 +// @Tags 标签 +// @ID GetUserTagByID +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetUserTagByIDReq true "请求" +// @Produce json +// @Success 0 {object} api.GetUserTagByIDResp +// @Failure 500 {object} api.GetUserTagByIDResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetUserTagByIDResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/get_user_tag_by_id [post] func GetUserTagByID(c *gin.Context) { var ( - req apistruct.GetUserTagByIDReq - resp apistruct.GetUserTagByIDResp + req api.GetUserTagByIDReq + resp api.GetUserTagByIDResp reqPb pbOffice.GetUserTagByIDReq respPb *pbOffice.GetUserTagByIDResp ) @@ -337,7 +421,7 @@ func GetUserTagByID(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } diff --git a/internal/api/office/work_moments.go b/internal/api/office/work_moments.go index ae4863b75..86b3dc7bf 100644 --- a/internal/api/office/work_moments.go +++ b/internal/api/office/work_moments.go @@ -1,7 +1,7 @@ package office import ( - apiStruct "Open_IM/pkg/base_info" + api "Open_IM/pkg/base_info" "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/common/token_verify" @@ -15,10 +15,22 @@ import ( "strings" ) +// @Summary 创建一条工作圈 +// @Description 用户创建一条工作圈 +// @Tags 工作圈 +// @ID CreateOneWorkMoment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.CreateOneWorkMomentReq true "请求 atUserList likeUserList permissionGroupList permissionUserList 字段中userName可以不填" +// @Produce json +// @Success 0 {object} api.CreateOneWorkMomentResp +// @Failure 500 {object} api.CreateOneWorkMomentResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.CreateOneWorkMomentResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/create_one_work_moment [post] func CreateOneWorkMoment(c *gin.Context) { var ( - req apiStruct.CreateOneWorkMomentReq - resp apiStruct.CreateOneWorkMomentResp + req api.CreateOneWorkMomentReq + resp api.CreateOneWorkMomentResp reqPb pbOffice.CreateOneWorkMomentReq respPb *pbOffice.CreateOneWorkMomentResp ) @@ -36,7 +48,7 @@ func CreateOneWorkMoment(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } @@ -59,7 +71,7 @@ func CreateOneWorkMoment(c *gin.Context) { c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateOneWorkMoment rpc server failed" + err.Error()}) return } - resp.CommResp = apiStruct.CommResp{ + resp.CommResp = api.CommResp{ ErrCode: respPb.CommonResp.ErrCode, ErrMsg: respPb.CommonResp.ErrMsg, } @@ -67,10 +79,22 @@ func CreateOneWorkMoment(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 删除一条工作圈 +// @Description 根据用户工作圈ID删除一条工作圈 +// @Tags 工作圈 +// @ID DeleteOneWorkMoment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.DeleteOneWorkMomentReq true "请求" +// @Produce json +// @Success 0 {object} api.DeleteOneWorkMomentResp +// @Failure 500 {object} api.DeleteOneWorkMomentResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.DeleteOneWorkMomentResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/delete_one_work_moment [post] func DeleteOneWorkMoment(c *gin.Context) { var ( - req apiStruct.DeleteOneWorkMomentReq - resp apiStruct.DeleteOneWorkMomentResp + req api.DeleteOneWorkMomentReq + resp api.DeleteOneWorkMomentResp reqPb pbOffice.DeleteOneWorkMomentReq respPb *pbOffice.DeleteOneWorkMomentResp ) @@ -88,7 +112,7 @@ func DeleteOneWorkMoment(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } @@ -118,10 +142,22 @@ func DeleteOneWorkMoment(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 点赞一条工作圈 +// @Description 工作圈ID点赞一条工作圈 +// @Tags 工作圈 +// @ID LikeOneWorkMoment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.LikeOneWorkMomentReq true "请求" +// @Produce json +// @Success 0 {object} api.LikeOneWorkMomentResp +// @Failure 500 {object} api.LikeOneWorkMomentResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.LikeOneWorkMomentResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/like_one_work_moment [post] func LikeOneWorkMoment(c *gin.Context) { var ( - req apiStruct.LikeOneWorkMomentReq - resp apiStruct.LikeOneWorkMomentResp + req api.LikeOneWorkMomentReq + resp api.LikeOneWorkMomentResp reqPb pbOffice.LikeOneWorkMomentReq respPb *pbOffice.LikeOneWorkMomentResp ) @@ -168,10 +204,22 @@ func LikeOneWorkMoment(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 评论一条工作圈 +// @Description 评论一条工作圈 +// @Tags 工作圈 +// @ID CommentOneWorkMoment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.CommentOneWorkMomentReq true "请求" +// @Produce json +// @Success 0 {object} api.CommentOneWorkMomentResp +// @Failure 500 {object} api.CommentOneWorkMomentResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.CommentOneWorkMomentResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/comment_one_work_moment [post] func CommentOneWorkMoment(c *gin.Context) { var ( - req apiStruct.CommentOneWorkMomentReq - resp apiStruct.CommentOneWorkMomentResp + req api.CommentOneWorkMomentReq + resp api.CommentOneWorkMomentResp reqPb pbOffice.CommentOneWorkMomentReq respPb *pbOffice.CommentOneWorkMomentResp ) @@ -218,10 +266,22 @@ func CommentOneWorkMoment(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 删除一条评论 +// @Description 删除一条评论 +// @Tags 工作圈 +// @ID DeleteComment +// @Accept json +// @Param token header string true "im token" +// @Param req body api.DeleteCommentReq true "请求" +// @Produce json +// @Success 0 {object} api.DeleteCommentResp +// @Failure 500 {object} api.DeleteCommentResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.DeleteCommentResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/delete_comment [post] func DeleteComment(c *gin.Context) { var ( - req apiStruct.DeleteCommentReq - resp apiStruct.DeleteCommentResp + req api.DeleteCommentReq + resp api.DeleteCommentResp reqPb pbOffice.DeleteCommentReq respPb *pbOffice.DeleteCommentResp ) @@ -266,10 +326,22 @@ func DeleteComment(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 通过ID获取工作圈 +// @Description 通过ID获取工作圈 +// @Tags 工作圈 +// @ID GetWorkMomentByID +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetWorkMomentByIDReq true "请求" +// @Produce json +// @Success 0 {object} api.GetWorkMomentByIDResp +// @Failure 500 {object} api.GetWorkMomentByIDResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetWorkMomentByIDResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/get_work_moment_by_id [post] func GetWorkMomentByID(c *gin.Context) { var ( - req apiStruct.GetWorkMomentByIDReq - resp apiStruct.GetWorkMomentByIDResp + req api.GetWorkMomentByIDReq + resp api.GetWorkMomentByIDResp reqPb pbOffice.GetWorkMomentByIDReq respPb *pbOffice.GetWorkMomentByIDResp ) @@ -311,8 +383,8 @@ func GetWorkMomentByID(c *gin.Context) { if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - resp.Data.WorkMoment = &apiStruct.WorkMoment{LikeUserList: []*apiStruct.WorkMomentUser{}, Comments: []*apiStruct.Comment{}, - AtUserList: []*apiStruct.WorkMomentUser{}, PermissionUserList: []*apiStruct.WorkMomentUser{}} + resp.Data.WorkMoment = &api.WorkMoment{LikeUserList: []*api.WorkMomentUser{}, Comments: []*api.Comment{}, + AtUserList: []*api.WorkMomentUser{}, PermissionUserList: []*api.WorkMomentUser{}} if err := utils.CopyStructFields(&resp.Data.WorkMoment, respPb.WorkMoment); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } @@ -320,10 +392,22 @@ func GetWorkMomentByID(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 查询用户工作圈 +// @Description 查询用户工作圈 +// @Tags 工作圈 +// @ID GetUserWorkMoments +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetUserWorkMomentsReq true "请求" +// @Produce json +// @Success 0 {object} api.GetUserWorkMomentsResp +// @Failure 500 {object} api.GetUserWorkMomentsResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetUserWorkMomentsResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/get_user_work_moments [post] func GetUserWorkMoments(c *gin.Context) { var ( - req apiStruct.GetUserWorkMomentsReq - resp apiStruct.GetUserWorkMomentsResp + req api.GetUserWorkMomentsReq + resp api.GetUserWorkMomentsResp reqPb pbOffice.GetUserWorkMomentsReq respPb *pbOffice.GetUserWorkMomentsResp ) @@ -366,29 +450,26 @@ func GetUserWorkMoments(c *gin.Context) { c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserWorkMoments rpc server failed" + err.Error()}) return } - resp.Data.WorkMoments = []*apiStruct.WorkMoment{} + resp.Data.WorkMoments = []*api.WorkMoment{} if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - //if err := utils.CopyStructFields(&resp.Data.WorkMoments, respPb.WorkMoments); err != nil { - // log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) - //} for _, v := range respPb.WorkMoments { - workMoment := apiStruct.WorkMoment{ + workMoment := api.WorkMoment{ WorkMomentID: v.WorkMomentID, UserID: v.UserID, Content: v.Content, FaceURL: v.FaceURL, UserName: v.UserName, CreateTime: v.CreateTime, - Comments: make([]*apiStruct.Comment, len(v.Comments)), - LikeUserList: make([]*apiStruct.WorkMomentUser, len(v.LikeUserList)), - AtUserList: make([]*apiStruct.WorkMomentUser, len(v.AtUserList)), - PermissionUserList: make([]*apiStruct.WorkMomentUser, len(v.PermissionUserList)), + Comments: make([]*api.Comment, len(v.Comments)), + LikeUserList: make([]*api.WorkMomentUser, len(v.LikeUserList)), + AtUserList: make([]*api.WorkMomentUser, len(v.AtUserList)), + PermissionUserList: make([]*api.WorkMomentUser, len(v.PermissionUserList)), Permission: v.Permission, } for i, comment := range v.Comments { - workMoment.Comments[i] = &apiStruct.Comment{ + workMoment.Comments[i] = &api.Comment{ UserID: comment.UserID, UserName: comment.UserName, ReplyUserID: comment.ReplyUserID, @@ -399,19 +480,19 @@ func GetUserWorkMoments(c *gin.Context) { } } for i, likeUser := range v.LikeUserList { - workMoment.LikeUserList[i] = &apiStruct.WorkMomentUser{ + workMoment.LikeUserList[i] = &api.WorkMomentUser{ UserID: likeUser.UserID, UserName: likeUser.UserName, } } for i, atUser := range v.AtUserList { - workMoment.AtUserList[i] = &apiStruct.WorkMomentUser{ + workMoment.AtUserList[i] = &api.WorkMomentUser{ UserID: atUser.UserID, UserName: atUser.UserName, } } for i, permissionUser := range v.PermissionUserList { - workMoment.PermissionUserList[i] = &apiStruct.WorkMomentUser{ + workMoment.PermissionUserList[i] = &api.WorkMomentUser{ UserID: permissionUser.UserID, UserName: permissionUser.UserName, } @@ -424,10 +505,22 @@ func GetUserWorkMoments(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 查询自己大工作圈页面 +// @Description 查询用户工作圈页面 +// @Tags 工作圈 +// @ID GetUserFriendWorkMoments +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetUserFriendWorkMomentsReq true "请求" +// @Produce json +// @Success 0 {object} api.GetUserFriendWorkMomentsResp +// @Failure 500 {object} api.GetUserFriendWorkMomentsResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetUserFriendWorkMomentsResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /office/get_user_friend_work_moments [post] func GetUserFriendWorkMoments(c *gin.Context) { var ( - req apiStruct.GetUserFriendWorkMomentsReq - resp apiStruct.GetUserFriendWorkMomentsResp + req api.GetUserFriendWorkMomentsReq + resp api.GetUserFriendWorkMomentsResp reqPb pbOffice.GetUserFriendWorkMomentsReq respPb *pbOffice.GetUserFriendWorkMomentsResp ) @@ -475,23 +568,23 @@ func GetUserFriendWorkMoments(c *gin.Context) { //if err := utils.CopyStructFields(&resp.Data.WorkMoments, respPb.WorkMoments); err != nil { // log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) //} - resp.Data.WorkMoments = []*apiStruct.WorkMoment{} + resp.Data.WorkMoments = []*api.WorkMoment{} for _, v := range respPb.WorkMoments { - workMoment := apiStruct.WorkMoment{ + workMoment := api.WorkMoment{ WorkMomentID: v.WorkMomentID, UserID: v.UserID, Content: v.Content, FaceURL: v.FaceURL, UserName: v.UserName, CreateTime: v.CreateTime, - Comments: make([]*apiStruct.Comment, len(v.Comments)), - LikeUserList: make([]*apiStruct.WorkMomentUser, len(v.LikeUserList)), - AtUserList: make([]*apiStruct.WorkMomentUser, len(v.AtUserList)), - PermissionUserList: make([]*apiStruct.WorkMomentUser, len(v.PermissionUserList)), + Comments: make([]*api.Comment, len(v.Comments)), + LikeUserList: make([]*api.WorkMomentUser, len(v.LikeUserList)), + AtUserList: make([]*api.WorkMomentUser, len(v.AtUserList)), + PermissionUserList: make([]*api.WorkMomentUser, len(v.PermissionUserList)), Permission: v.Permission, } for i, comment := range v.Comments { - workMoment.Comments[i] = &apiStruct.Comment{ + workMoment.Comments[i] = &api.Comment{ UserID: comment.UserID, UserName: comment.UserName, ReplyUserID: comment.ReplyUserID, @@ -502,19 +595,19 @@ func GetUserFriendWorkMoments(c *gin.Context) { } } for i, likeUser := range v.LikeUserList { - workMoment.LikeUserList[i] = &apiStruct.WorkMomentUser{ + workMoment.LikeUserList[i] = &api.WorkMomentUser{ UserID: likeUser.UserID, UserName: likeUser.UserName, } } for i, atUser := range v.AtUserList { - workMoment.AtUserList[i] = &apiStruct.WorkMomentUser{ + workMoment.AtUserList[i] = &api.WorkMomentUser{ UserID: atUser.UserID, UserName: atUser.UserName, } } for i, permissionUser := range v.PermissionUserList { - workMoment.PermissionUserList[i] = &apiStruct.WorkMomentUser{ + workMoment.PermissionUserList[i] = &api.WorkMomentUser{ UserID: permissionUser.UserID, UserName: permissionUser.UserName, } @@ -529,8 +622,8 @@ func GetUserFriendWorkMoments(c *gin.Context) { func SetUserWorkMomentsLevel(c *gin.Context) { var ( - req apiStruct.SetUserWorkMomentsLevelReq - resp apiStruct.SetUserWorkMomentsLevelResp + req api.SetUserWorkMomentsLevelReq + resp api.SetUserWorkMomentsLevelResp reqPb pbOffice.SetUserWorkMomentsLevelReq respPb *pbOffice.SetUserWorkMomentsLevelResp ) diff --git a/internal/api/user/user.go b/internal/api/user/user.go index 8ce38b809..d195c4b96 100644 --- a/internal/api/user/user.go +++ b/internal/api/user/user.go @@ -35,7 +35,7 @@ func GetUsersInfoFromCache(c *gin.Context) { if !ok { errMsg := "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) @@ -147,6 +147,18 @@ func GetBlackIDListFromCache(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 获取用户信息 +// @Description 根据用户列表批量获取用户信息 +// @Tags 用户相关 +// @ID GetUsersInfo +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetUsersInfoReq true "请求体" +// @Produce json +// @Success 0 {object} api.GetUsersInfoResp +// @Failure 500 {object} api.GetUsersInfoResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetUsersInfoResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /user/get_users_info [post] func GetUsersInfo(c *gin.Context) { params := api.GetUsersInfoReq{} if err := c.BindJSON(¶ms); err != nil { @@ -163,7 +175,7 @@ func GetUsersInfo(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } @@ -197,11 +209,11 @@ func GetUsersInfo(c *gin.Context) { // @Summary 修改用户信息 // @Description 修改用户信息 userID faceURL等 -// @Tags 用户信息 +// @Tags 用户相关 // @ID UpdateUserInfo // @Accept json // @Param token header string true "im token" -// @Param req body api.UpdateSelfUserInfoReq true "请求" +// @Param req body api.UpdateSelfUserInfoReq true "请求体" // @Produce json // @Success 0 {object} api.UpdateUserInfoResp // @Failure 500 {object} api.UpdateUserInfoResp "errCode为500 一般为服务器内部错误" @@ -223,7 +235,7 @@ func UpdateUserInfo(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(params.OperationID, "UpdateUserInfo args ", req.String()) @@ -246,6 +258,18 @@ func UpdateUserInfo(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 设置全局免打扰 +// @Description 设置全局免打扰 +// @Tags 用户相关 +// @ID SetGlobalRecvMessageOpt +// @Accept json +// @Param token header string true "im token" +// @Param req body api.SetGlobalRecvMessageOptReq true "请求体" +// @Produce json +// @Success 0 {object} api.SetGlobalRecvMessageOptResp +// @Failure 500 {object} api.SetGlobalRecvMessageOptResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.SetGlobalRecvMessageOptResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /user/set_global_msg_recv_opt [post] func SetGlobalRecvMessageOpt(c *gin.Context) { params := api.SetGlobalRecvMessageOptReq{} if err := c.BindJSON(¶ms); err != nil { @@ -262,7 +286,7 @@ func SetGlobalRecvMessageOpt(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } log.NewInfo(params.OperationID, "SetGlobalRecvMessageOpt args ", req.String()) @@ -285,6 +309,18 @@ func SetGlobalRecvMessageOpt(c *gin.Context) { c.JSON(http.StatusOK, resp) } +// @Summary 获取自己的信息 +// @Description 传入ID获取自己的信息 +// @Tags 用户相关 +// @ID GetSelfUserInfo +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetSelfUserInfoReq true "请求体" +// @Produce json +// @Success 0 {object} api.GetSelfUserInfoResp +// @Failure 500 {object} api.GetSelfUserInfoResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetSelfUserInfoResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /user/get_self_user_info [post] func GetSelfUserInfo(c *gin.Context) { params := api.GetSelfUserInfoReq{} if err := c.BindJSON(¶ms); err != nil { @@ -302,7 +338,7 @@ func GetSelfUserInfo(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } @@ -336,6 +372,18 @@ func GetSelfUserInfo(c *gin.Context) { } +// @Summary 获取用户在线状态 +// @Description 获取用户在线状态 +// @Tags 用户相关 +// @ID GetUsersOnlineStatus +// @Accept json +// @Param token header string true "im token" +// @Param req body api.GetUsersOnlineStatusReq true "请求体" +// @Produce json +// @Success 0 {object} api.GetUsersOnlineStatusResp +// @Failure 500 {object} api.GetUsersOnlineStatusResp "errCode为500 一般为服务器内部错误" +// @Failure 400 {object} api.GetUsersOnlineStatusResp "errCode为400 一般为参数输入错误, token未带上等" +// @Router /user/get_users_online_status [post] func GetUsersOnlineStatus(c *gin.Context) { params := api.GetUsersOnlineStatusReq{} if err := c.BindJSON(¶ms); err != nil { @@ -351,7 +399,7 @@ func GetUsersOnlineStatus(c *gin.Context) { if !ok { errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return } diff --git a/pkg/base_info/office_struct.go b/pkg/base_info/office_struct.go index e4dca230d..1e8e174bd 100644 --- a/pkg/base_info/office_struct.go +++ b/pkg/base_info/office_struct.go @@ -16,8 +16,8 @@ type GetUserTagsResp struct { } type CreateTagReq struct { - TagName string `json:"tagName" binding:"required"` - UserIDList []string `json:"userIDList" binding:"required"` + TagName string `json:"tagName" binding:"required"` // tag名称 + UserIDList []string `json:"userIDList" binding:"required"` // 用户ID列表 OperationID string `json:"operationID" binding:"required"` } diff --git a/pkg/base_info/public_struct.go b/pkg/base_info/public_struct.go index 2950dbea8..824f58043 100644 --- a/pkg/base_info/public_struct.go +++ b/pkg/base_info/public_struct.go @@ -6,8 +6,8 @@ import ( ) type ApiUserInfo struct { - UserID string `json:"userID" binding:"required,min=1,max=64"` - Nickname string `json:"nickname" binding:"omitempty,min=1,max=64"` + UserID string `json:"userID" binding:"required,min=1,max=64" swaggo:"true,用户ID,"` + Nickname string `json:"nickname" binding:"omitempty,min=1,max=64" swaggo:"true,my id,19"` FaceURL string `json:"faceURL" binding:"omitempty,max=1024"` Gender int32 `json:"gender" binding:"omitempty,oneof=0 1 2"` PhoneNumber string `json:"phoneNumber" binding:"omitempty,max=32"` diff --git a/pkg/base_info/work_moments_struct.go b/pkg/base_info/work_moments_struct.go index 34f2df8bd..7ff8c6f7d 100644 --- a/pkg/base_info/work_moments_struct.go +++ b/pkg/base_info/work_moments_struct.go @@ -12,7 +12,8 @@ type CreateOneWorkMomentResp struct { } type DeleteOneWorkMomentReq struct { - office.DeleteOneWorkMomentReq + WorkMomentID string `json:"workMomentID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` } type DeleteOneWorkMomentResp struct { @@ -21,7 +22,8 @@ type DeleteOneWorkMomentResp struct { } type LikeOneWorkMomentReq struct { - office.LikeOneWorkMomentReq + WorkMomentID string `json:"workMomentID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` } type LikeOneWorkMomentResp struct { @@ -30,7 +32,10 @@ type LikeOneWorkMomentResp struct { } type CommentOneWorkMomentReq struct { - office.CommentOneWorkMomentReq + WorkMomentID string `json:"workMomentID" binding:"required"` + ReplyUserID string `json:"replyUserID" binding:"required"` + Content string `json:"content" binding:"required"` + OperationID string `json:"operationID" binding:"required"` } type CommentOneWorkMomentResp struct { @@ -39,7 +44,9 @@ type CommentOneWorkMomentResp struct { } type DeleteCommentReq struct { - office.DeleteCommentReq + WorkMomentID string `json:"workMomentID" binding:"required"` + ContentID string `json:"contentID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` } type DeleteCommentResp struct { @@ -54,7 +61,8 @@ type WorkMomentsUserCommonReq struct { } type GetWorkMomentByIDReq struct { - office.GetWorkMomentByIDReq + WorkMomentID string `json:"workMomentID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` } type WorkMoment struct { From 20f78d214f30e01569544bfa45f5606c12055038 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 28 Jun 2022 10:36:27 +0800 Subject: [PATCH 7/8] swagger --- pkg/base_info/work_moments_struct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/base_info/work_moments_struct.go b/pkg/base_info/work_moments_struct.go index 7ff8c6f7d..1e09d849f 100644 --- a/pkg/base_info/work_moments_struct.go +++ b/pkg/base_info/work_moments_struct.go @@ -33,7 +33,7 @@ type LikeOneWorkMomentResp struct { type CommentOneWorkMomentReq struct { WorkMomentID string `json:"workMomentID" binding:"required"` - ReplyUserID string `json:"replyUserID" binding:"required"` + ReplyUserID string `json:"replyUserID"` Content string `json:"content" binding:"required"` OperationID string `json:"operationID" binding:"required"` } From 5213860919f5745ad7f3d644e3ad137feae1bd02 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 28 Jun 2022 10:38:33 +0800 Subject: [PATCH 8/8] docker-compose --- docker-compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index e3af24080..f9d48b922 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -29,8 +29,8 @@ services: - TZ=Asia/Shanghai # cache - wiredTigerCacheSizeGB=1 -# - MONGO_INITDB_ROOT_USERNAME=openIM -# - MONGO_INITDB_ROOT_PASSWORD=openIM + - MONGO_INITDB_ROOT_USERNAME=openIM + - MONGO_INITDB_ROOT_PASSWORD=openIM #TZ: Asia/Shanghai restart: always