update add openapi api

This commit is contained in:
xiongxiao
2026-01-16 13:03:57 +08:00
parent a8f2cb14a7
commit 7787337f13
32 changed files with 39023 additions and 43 deletions

View File

@@ -0,0 +1,147 @@
{
"swagger": "2.0",
"info": {
"title": "CNB OPENAPI",
"contact": {
"name": "Open API Support",
"url": "https://docs.cnb.cool/",
"email": "cnb@tencent.com"
},
"version": "1.0"
},
"paths": {
"/users/{username}/followers": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Followers"
],
"summary": "获取指定用户的粉丝列表。Get the followers list of specified user.",
"operationId": "GetFollowersByUserID",
"parameters": [
{
"type": "string",
"description": "Username",
"name": "username",
"in": "path",
"required": true
},
{
"type": "integer",
"default": 1,
"description": "Pagination page number",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 10,
"description": "Pagination page size",
"name": "page_size",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.UserFollowResult"
}
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \naccount-engage:r"
}
},
"/users/{username}/following": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Followers"
],
"summary": "获取指定用户的关注人列表。Get the list of users that the specified user is following.",
"operationId": "GetFollowingByUserID",
"parameters": [
{
"type": "string",
"description": "Username",
"name": "username",
"in": "path",
"required": true
},
{
"type": "integer",
"default": 1,
"description": "Pagination page number",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 10,
"description": "Pagination page size",
"name": "page_size",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.UserFollowResult"
}
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \naccount-engage:r"
}
}
},
"definitions": {
"dto.UserFollowResult": {
"type": "object",
"properties": {
"freeze": {
"type": "boolean"
},
"is_following": {
"description": "查询人是否follow了此用户",
"type": "boolean"
},
"locked": {
"type": "boolean"
},
"nickname": {
"type": "string"
},
"username": {
"type": "string"
}
}
}
}
}