From bc2d00c628e4f39726c30348a80d63167fcc6844 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Thu, 19 Dec 2024 14:48:36 +0800 Subject: [PATCH] update --- app/hdl/hdl_add_friend.go | 6 +- app/md/md_add_friend.go | 4 +- docs/docs.go | 229 +++++++++++++++++++++++--------------- docs/swagger.json | 229 +++++++++++++++++++++++--------------- docs/swagger.yaml | 164 ++++++++++++++++----------- 5 files changed, 390 insertions(+), 242 deletions(-) diff --git a/app/hdl/hdl_add_friend.go b/app/hdl/hdl_add_friend.go index bbdb9c5..092fcf0 100644 --- a/app/hdl/hdl_add_friend.go +++ b/app/hdl/hdl_add_friend.go @@ -678,9 +678,11 @@ func MyFansUserList(c *gin.Context) { scheme, domain := svc.ImageBucket(db.Db) var data []md.OneLineUserNode + var activityUserNums int for _, v := range results { isOnline := false if userSignInMap[utils.AnyToInt64(v["uid"])] != nil { + activityUserNums++ isOnline = true } tempUrl := svc.ImageFormatWithBucket(scheme, domain, v["avatar"]) @@ -693,7 +695,9 @@ func MyFansUserList(c *gin.Context) { } resp := md.MyFansUserListResp{ - List: data, + InviteTotal: len(*userRelates), + ActivityUserNums: activityUserNums, + List: data, } e.OutSuc(c, resp, nil) diff --git a/app/md/md_add_friend.go b/app/md/md_add_friend.go index d6890ce..a3f631f 100644 --- a/app/md/md_add_friend.go +++ b/app/md/md_add_friend.go @@ -67,7 +67,9 @@ type OneLineUserNode struct { } type MyFansUserListResp struct { - List []OneLineUserNode `json:"list"` + List []OneLineUserNode `json:"list"` + InviteTotal int `json:"invite_total"` //邀请总人数 + ActivityUserNums int `json:"activity_user_nums"` //活跃用户人数 } type SpaceListNode struct { diff --git a/docs/docs.go b/docs/docs.go index 6640d06..f7c398d 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -539,9 +539,9 @@ const docTemplate = `{ } } }, - "/api/v1/circleFriends/CommentLike": { - "get": { - "description": "评论取消点赞", + "/api/v1/circleFriends/cancelLike": { + "post": { + "description": "取消点赞朋友圈", "consumes": [ "application/json" ], @@ -551,7 +551,7 @@ const docTemplate = `{ "tags": [ "朋友圈" ], - "summary": "朋友圈-评论取消点赞", + "summary": "朋友圈-取消点赞朋友圈", "parameters": [ { "type": "string", @@ -561,11 +561,13 @@ const docTemplate = `{ "required": true }, { - "type": "string", - "description": "评论文档记录", - "name": "comment_index_id", - "in": "query", - "required": true + "description": "请求参数", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend_circles.EggFriendCircleCancelLikeReq" + } } ], "responses": { @@ -584,9 +586,9 @@ const docTemplate = `{ } } }, - "/api/v1/circleFriends/cancelLike": { + "/api/v1/circleFriends/comment": { "post": { - "description": "取消点赞朋友圈", + "description": "是否可以评论", "consumes": [ "application/json" ], @@ -596,7 +598,7 @@ const docTemplate = `{ "tags": [ "朋友圈" ], - "summary": "朋友圈-取消点赞朋友圈", + "summary": "朋友圈-评论", "parameters": [ { "type": "string", @@ -604,16 +606,52 @@ const docTemplate = `{ "name": "Authorization", "in": "header", "required": true + } + ], + "responses": { + "200": { + "description": "许可链接", + "schema": { + "type": "string" + } }, - { - "description": "请求参数", - "name": "req", - "in": "body", - "required": true, + "400": { + "description": "具体错误", "schema": { - "$ref": "#/definitions/friend_circles.EggFriendCircleCancelLikeReq" + "$ref": "#/definitions/md.Response" } } + } + } + }, + "/api/v1/circleFriends/commentCancelLike": { + "get": { + "description": "评论取消点赞", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "朋友圈" + ], + "summary": "朋友圈-评论取消点赞", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "评论文档记录", + "name": "comment_index_id", + "in": "query", + "required": true + } ], "responses": { "200": { @@ -631,9 +669,9 @@ const docTemplate = `{ } } }, - "/api/v1/circleFriends/comment": { + "/api/v1/circleFriends/commentDetail": { "get": { - "description": "是否可以评论", + "description": "评论详情", "consumes": [ "application/json" ], @@ -643,7 +681,7 @@ const docTemplate = `{ "tags": [ "朋友圈" ], - "summary": "朋友圈-评论", + "summary": "朋友圈-评论详情", "parameters": [ { "type": "string", @@ -651,11 +689,18 @@ const docTemplate = `{ "name": "Authorization", "in": "header", "required": true + }, + { + "type": "string", + "description": "评论文档记录", + "name": "comment_index_id", + "in": "query", + "required": true } ], "responses": { "200": { - "description": "许可链接", + "description": "success", "schema": { "type": "string" } @@ -669,9 +714,9 @@ const docTemplate = `{ } } }, - "/api/v1/circleFriends/commentDetail": { + "/api/v1/circleFriends/commentLike": { "get": { - "description": "评论详情", + "description": "评论点赞", "consumes": [ "application/json" ], @@ -681,7 +726,7 @@ const docTemplate = `{ "tags": [ "朋友圈" ], - "summary": "朋友圈-评论详情", + "summary": "朋友圈-评论点赞", "parameters": [ { "type": "string", @@ -4198,6 +4243,68 @@ const docTemplate = `{ } } }, + "code_fnuoos_com_EggPlanet_egg_models_git_src_model.ImSendRedPackageOrd": { + "type": "object", + "properties": { + "amount": { + "type": "string" + }, + "create_time": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "im_data": { + "type": "string" + }, + "im_uid": { + "type": "integer" + }, + "ord_no": { + "type": "string" + }, + "received_im_user_ids": { + "type": "string" + }, + "received_times": { + "type": "string" + }, + "received_user_amount": { + "type": "string" + }, + "received_user_ids": { + "type": "string" + }, + "red_packet_balance_amount": { + "type": "string" + }, + "red_packet_balance_nums": { + "type": "integer" + }, + "red_packet_nums": { + "type": "integer" + }, + "red_packet_type": { + "type": "integer" + }, + "state": { + "type": "integer" + }, + "uid": { + "type": "integer" + }, + "update_time": { + "type": "string" + }, + "wait_draw_im_user_ids": { + "type": "string" + }, + "wait_draw_user_ids": { + "type": "string" + } + } + }, "comm.AccessRecordsReq": { "type": "object", "properties": { @@ -5605,6 +5712,14 @@ const docTemplate = `{ "md.MyFansUserListResp": { "type": "object", "properties": { + "activity_user_nums": { + "description": "活跃用户人数", + "type": "integer" + }, + "invite_total": { + "description": "邀请总人数", + "type": "integer" + }, "list": { "type": "array", "items": { @@ -5883,7 +5998,7 @@ const docTemplate = `{ "description": "红包详情信息", "allOf": [ { - "$ref": "#/definitions/model.ImSendRedPackageOrd" + "$ref": "#/definitions/code_fnuoos_com_EggPlanet_egg_models_git_src_model.ImSendRedPackageOrd" } ] }, @@ -6617,68 +6732,6 @@ const docTemplate = `{ } } }, - "model.ImSendRedPackageOrd": { - "type": "object", - "properties": { - "amount": { - "type": "string" - }, - "create_time": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "im_data": { - "type": "string" - }, - "im_uid": { - "type": "integer" - }, - "ord_no": { - "type": "string" - }, - "received_im_user_ids": { - "type": "string" - }, - "received_times": { - "type": "string" - }, - "received_user_amount": { - "type": "string" - }, - "received_user_ids": { - "type": "string" - }, - "red_packet_balance_amount": { - "type": "string" - }, - "red_packet_balance_nums": { - "type": "integer" - }, - "red_packet_nums": { - "type": "integer" - }, - "red_packet_type": { - "type": "integer" - }, - "state": { - "type": "integer" - }, - "uid": { - "type": "integer" - }, - "update_time": { - "type": "string" - }, - "wait_draw_im_user_ids": { - "type": "string" - }, - "wait_draw_user_ids": { - "type": "string" - } - } - }, "pb.SendRedPacketResp": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index aff9af2..ae61002 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -533,9 +533,9 @@ } } }, - "/api/v1/circleFriends/CommentLike": { - "get": { - "description": "评论取消点赞", + "/api/v1/circleFriends/cancelLike": { + "post": { + "description": "取消点赞朋友圈", "consumes": [ "application/json" ], @@ -545,7 +545,7 @@ "tags": [ "朋友圈" ], - "summary": "朋友圈-评论取消点赞", + "summary": "朋友圈-取消点赞朋友圈", "parameters": [ { "type": "string", @@ -555,11 +555,13 @@ "required": true }, { - "type": "string", - "description": "评论文档记录", - "name": "comment_index_id", - "in": "query", - "required": true + "description": "请求参数", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend_circles.EggFriendCircleCancelLikeReq" + } } ], "responses": { @@ -578,9 +580,9 @@ } } }, - "/api/v1/circleFriends/cancelLike": { + "/api/v1/circleFriends/comment": { "post": { - "description": "取消点赞朋友圈", + "description": "是否可以评论", "consumes": [ "application/json" ], @@ -590,7 +592,7 @@ "tags": [ "朋友圈" ], - "summary": "朋友圈-取消点赞朋友圈", + "summary": "朋友圈-评论", "parameters": [ { "type": "string", @@ -598,16 +600,52 @@ "name": "Authorization", "in": "header", "required": true + } + ], + "responses": { + "200": { + "description": "许可链接", + "schema": { + "type": "string" + } }, - { - "description": "请求参数", - "name": "req", - "in": "body", - "required": true, + "400": { + "description": "具体错误", "schema": { - "$ref": "#/definitions/friend_circles.EggFriendCircleCancelLikeReq" + "$ref": "#/definitions/md.Response" } } + } + } + }, + "/api/v1/circleFriends/commentCancelLike": { + "get": { + "description": "评论取消点赞", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "朋友圈" + ], + "summary": "朋友圈-评论取消点赞", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "评论文档记录", + "name": "comment_index_id", + "in": "query", + "required": true + } ], "responses": { "200": { @@ -625,9 +663,9 @@ } } }, - "/api/v1/circleFriends/comment": { + "/api/v1/circleFriends/commentDetail": { "get": { - "description": "是否可以评论", + "description": "评论详情", "consumes": [ "application/json" ], @@ -637,7 +675,7 @@ "tags": [ "朋友圈" ], - "summary": "朋友圈-评论", + "summary": "朋友圈-评论详情", "parameters": [ { "type": "string", @@ -645,11 +683,18 @@ "name": "Authorization", "in": "header", "required": true + }, + { + "type": "string", + "description": "评论文档记录", + "name": "comment_index_id", + "in": "query", + "required": true } ], "responses": { "200": { - "description": "许可链接", + "description": "success", "schema": { "type": "string" } @@ -663,9 +708,9 @@ } } }, - "/api/v1/circleFriends/commentDetail": { + "/api/v1/circleFriends/commentLike": { "get": { - "description": "评论详情", + "description": "评论点赞", "consumes": [ "application/json" ], @@ -675,7 +720,7 @@ "tags": [ "朋友圈" ], - "summary": "朋友圈-评论详情", + "summary": "朋友圈-评论点赞", "parameters": [ { "type": "string", @@ -4192,6 +4237,68 @@ } } }, + "code_fnuoos_com_EggPlanet_egg_models_git_src_model.ImSendRedPackageOrd": { + "type": "object", + "properties": { + "amount": { + "type": "string" + }, + "create_time": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "im_data": { + "type": "string" + }, + "im_uid": { + "type": "integer" + }, + "ord_no": { + "type": "string" + }, + "received_im_user_ids": { + "type": "string" + }, + "received_times": { + "type": "string" + }, + "received_user_amount": { + "type": "string" + }, + "received_user_ids": { + "type": "string" + }, + "red_packet_balance_amount": { + "type": "string" + }, + "red_packet_balance_nums": { + "type": "integer" + }, + "red_packet_nums": { + "type": "integer" + }, + "red_packet_type": { + "type": "integer" + }, + "state": { + "type": "integer" + }, + "uid": { + "type": "integer" + }, + "update_time": { + "type": "string" + }, + "wait_draw_im_user_ids": { + "type": "string" + }, + "wait_draw_user_ids": { + "type": "string" + } + } + }, "comm.AccessRecordsReq": { "type": "object", "properties": { @@ -5599,6 +5706,14 @@ "md.MyFansUserListResp": { "type": "object", "properties": { + "activity_user_nums": { + "description": "活跃用户人数", + "type": "integer" + }, + "invite_total": { + "description": "邀请总人数", + "type": "integer" + }, "list": { "type": "array", "items": { @@ -5877,7 +5992,7 @@ "description": "红包详情信息", "allOf": [ { - "$ref": "#/definitions/model.ImSendRedPackageOrd" + "$ref": "#/definitions/code_fnuoos_com_EggPlanet_egg_models_git_src_model.ImSendRedPackageOrd" } ] }, @@ -6611,68 +6726,6 @@ } } }, - "model.ImSendRedPackageOrd": { - "type": "object", - "properties": { - "amount": { - "type": "string" - }, - "create_time": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "im_data": { - "type": "string" - }, - "im_uid": { - "type": "integer" - }, - "ord_no": { - "type": "string" - }, - "received_im_user_ids": { - "type": "string" - }, - "received_times": { - "type": "string" - }, - "received_user_amount": { - "type": "string" - }, - "received_user_ids": { - "type": "string" - }, - "red_packet_balance_amount": { - "type": "string" - }, - "red_packet_balance_nums": { - "type": "integer" - }, - "red_packet_nums": { - "type": "integer" - }, - "red_packet_type": { - "type": "integer" - }, - "state": { - "type": "integer" - }, - "uid": { - "type": "integer" - }, - "update_time": { - "type": "string" - }, - "wait_draw_im_user_ids": { - "type": "string" - }, - "wait_draw_user_ids": { - "type": "string" - } - } - }, "pb.SendRedPacketResp": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index a32419c..59e07d9 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -12,6 +12,47 @@ definitions: description: 总数据量 type: integer type: object + code_fnuoos_com_EggPlanet_egg_models_git_src_model.ImSendRedPackageOrd: + properties: + amount: + type: string + create_time: + type: string + id: + type: integer + im_data: + type: string + im_uid: + type: integer + ord_no: + type: string + received_im_user_ids: + type: string + received_times: + type: string + received_user_amount: + type: string + received_user_ids: + type: string + red_packet_balance_amount: + type: string + red_packet_balance_nums: + type: integer + red_packet_nums: + type: integer + red_packet_type: + type: integer + state: + type: integer + uid: + type: integer + update_time: + type: string + wait_draw_im_user_ids: + type: string + wait_draw_user_ids: + type: string + type: object comm.AccessRecordsReq: properties: index: @@ -994,6 +1035,12 @@ definitions: type: object md.MyFansUserListResp: properties: + activity_user_nums: + description: 活跃用户人数 + type: integer + invite_total: + description: 邀请总人数 + type: integer list: items: $ref: '#/definitions/md.OneLineUserNode' @@ -1187,7 +1234,7 @@ definitions: properties: detail: allOf: - - $ref: '#/definitions/model.ImSendRedPackageOrd' + - $ref: '#/definitions/code_fnuoos_com_EggPlanet_egg_models_git_src_model.ImSendRedPackageOrd' description: 红包详情信息 list: description: 领取红包用户列表 @@ -1692,47 +1739,6 @@ definitions: description: 余额 type: string type: object - model.ImSendRedPackageOrd: - properties: - amount: - type: string - create_time: - type: string - id: - type: integer - im_data: - type: string - im_uid: - type: integer - ord_no: - type: string - received_im_user_ids: - type: string - received_times: - type: string - received_user_amount: - type: string - received_user_ids: - type: string - red_packet_balance_amount: - type: string - red_packet_balance_nums: - type: integer - red_packet_nums: - type: integer - red_packet_type: - type: integer - state: - type: integer - uid: - type: integer - update_time: - type: string - wait_draw_im_user_ids: - type: string - wait_draw_user_ids: - type: string - type: object pb.SendRedPacketResp: properties: seq: @@ -2093,22 +2099,23 @@ paths: summary: 朋友圈-删除评论 tags: - 朋友圈 - /api/v1/circleFriends/CommentLike: - get: + /api/v1/circleFriends/cancelLike: + post: consumes: - application/json - description: 评论取消点赞 + description: 取消点赞朋友圈 parameters: - description: 验证参数Bearer和token空格拼接 in: header name: Authorization required: true type: string - - description: 评论文档记录 - in: query - name: comment_index_id + - description: 请求参数 + in: body + name: req required: true - type: string + schema: + $ref: '#/definitions/friend_circles.EggFriendCircleCancelLikeReq' produces: - application/json responses: @@ -2120,63 +2127,62 @@ paths: description: 具体错误 schema: $ref: '#/definitions/md.Response' - summary: 朋友圈-评论取消点赞 + summary: 朋友圈-取消点赞朋友圈 tags: - 朋友圈 - /api/v1/circleFriends/cancelLike: + /api/v1/circleFriends/comment: post: consumes: - application/json - description: 取消点赞朋友圈 + description: 是否可以评论 parameters: - description: 验证参数Bearer和token空格拼接 in: header name: Authorization required: true type: string - - description: 请求参数 - in: body - name: req - required: true - schema: - $ref: '#/definitions/friend_circles.EggFriendCircleCancelLikeReq' produces: - application/json responses: "200": - description: success + description: 许可链接 schema: type: string "400": description: 具体错误 schema: $ref: '#/definitions/md.Response' - summary: 朋友圈-取消点赞朋友圈 + summary: 朋友圈-评论 tags: - 朋友圈 - /api/v1/circleFriends/comment: + /api/v1/circleFriends/commentCancelLike: get: consumes: - application/json - description: 是否可以评论 + description: 评论取消点赞 parameters: - description: 验证参数Bearer和token空格拼接 in: header name: Authorization required: true type: string + - description: 评论文档记录 + in: query + name: comment_index_id + required: true + type: string produces: - application/json responses: "200": - description: 许可链接 + description: success schema: type: string "400": description: 具体错误 schema: $ref: '#/definitions/md.Response' - summary: 朋友圈-评论 + summary: 朋友圈-评论取消点赞 tags: - 朋友圈 /api/v1/circleFriends/commentDetail: @@ -2209,6 +2215,36 @@ paths: summary: 朋友圈-评论详情 tags: - 朋友圈 + /api/v1/circleFriends/commentLike: + get: + consumes: + - application/json + description: 评论点赞 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 评论文档记录 + in: query + name: comment_index_id + required: true + type: string + produces: + - application/json + responses: + "200": + description: success + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 朋友圈-评论点赞 + tags: + - 朋友圈 /api/v1/circleFriends/commentList: post: consumes: