docs: 重新生成 swagger 接口文档

This commit is contained in:
zetaloop
2026-05-03 19:03:09 +08:00
parent 164f98cf33
commit 44c73e787f
13 changed files with 5963 additions and 5237 deletions
File diff suppressed because it is too large Load Diff
+485
View File
@@ -0,0 +1,485 @@
{
"swagger": "2.0",
"info": {
"title": "",
"version": ""
},
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/api/v1/disputes": {
"get": {
"summary": "获取争议列表",
"operationId": "ListDisputes",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/DisputeListResp"
}
}
},
"parameters": [
{
"name": "offset",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "0"
},
{
"name": "limit",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "20"
},
{
"name": "status",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"dispute"
],
"consumes": [
"multipart/form-data"
]
}
},
"/api/v1/disputes/{id}/appeal": {
"post": {
"summary": "申诉",
"operationId": "AppealDispute",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/EmptyResp"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AppealReq"
}
}
],
"tags": [
"dispute"
]
}
},
"/api/v1/disputes/{id}/response": {
"post": {
"summary": "回应争议",
"operationId": "RespondDispute",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/EmptyResp"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/DisputeResponseReq"
}
}
],
"tags": [
"dispute"
]
}
},
"/api/v1/orders/{id}/dispute": {
"get": {
"summary": "获取订单争议",
"operationId": "GetOrderDispute",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/Dispute"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"dispute"
]
},
"post": {
"summary": "发起争议",
"operationId": "CreateDispute",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/EmptyResp"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/CreateDisputeReq"
}
}
],
"tags": [
"dispute"
]
}
}
},
"definitions": {
"AppealReq": {
"type": "object",
"properties": {
"reason": {
"type": "string"
}
},
"title": "AppealReq",
"required": [
"reason"
]
},
"CreateDisputeReq": {
"type": "object",
"properties": {
"reason": {
"type": "string"
},
"evidence": {
"type": "array",
"items": {
"type": "string"
}
}
},
"title": "CreateDisputeReq",
"required": [
"reason",
"evidence"
]
},
"Dispute": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"orderId": {
"type": "integer",
"format": "int64"
},
"initiatorId": {
"type": "integer",
"format": "int64"
},
"initiatorName": {
"type": "string"
},
"respondentId": {
"type": "integer",
"format": "int64"
},
"reason": {
"type": "string"
},
"evidence": {
"type": "array",
"items": {
"type": "string"
}
},
"status": {
"type": "string"
},
"result": {
"type": "string"
},
"respondentReason": {
"type": "string"
},
"respondentEvidence": {
"type": "array",
"items": {
"type": "string"
}
},
"appealReason": {
"type": "string"
},
"appealedAt": {
"type": "string"
},
"resolvedBy": {
"type": "integer",
"format": "int64"
},
"resolvedAt": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
},
"title": "Dispute",
"required": [
"id",
"orderId",
"initiatorId",
"initiatorName",
"respondentId",
"reason",
"evidence",
"status",
"respondentEvidence",
"createdAt",
"updatedAt"
]
},
"DisputeListReq": {
"type": "object",
"properties": {
"offset": {
"type": "integer",
"format": "int64",
"default": "0"
},
"limit": {
"type": "integer",
"format": "int64",
"default": "20"
},
"status": {
"type": "string"
}
},
"title": "DisputeListReq"
},
"DisputeListResp": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/Dispute"
}
},
"meta": {
"$ref": "#/definitions/PageMeta"
}
},
"title": "DisputeListResp",
"required": [
"items",
"meta"
]
},
"DisputePathId": {
"type": "object",
"title": "DisputePathId"
},
"DisputeResponseReq": {
"type": "object",
"properties": {
"reason": {
"type": "string"
},
"evidence": {
"type": "array",
"items": {
"type": "string"
}
}
},
"title": "DisputeResponseReq",
"required": [
"reason",
"evidence"
]
},
"EmptyResp": {
"type": "object",
"title": "EmptyResp"
},
"PageMeta": {
"type": "object",
"properties": {
"total": {
"type": "integer",
"format": "int64"
},
"offset": {
"type": "integer",
"format": "int64"
},
"limit": {
"type": "integer",
"format": "int64"
}
},
"title": "PageMeta",
"required": [
"total",
"offset",
"limit"
]
},
"PageReq": {
"type": "object",
"properties": {
"offset": {
"type": "integer",
"format": "int64",
"default": "0"
},
"limit": {
"type": "integer",
"format": "int64",
"default": "20"
}
},
"title": "PageReq",
"required": [
"offset",
"limit"
]
},
"SimpleUser": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"nickname": {
"type": "string"
},
"avatar": {
"type": "string"
}
},
"title": "SimpleUser",
"required": [
"id",
"nickname",
"avatar"
]
},
"UserProfile": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"username": {
"type": "string"
},
"nickname": {
"type": "string"
},
"avatar": {
"type": "string"
},
"role": {
"type": "string",
"description": " consumer, player, owner, admin"
},
"verifiedRoles": {
"type": "array",
"items": {
"type": "string"
}
},
"verificationStatus": {
"type": "object"
},
"phone": {
"type": "string"
},
"bio": {
"type": "string"
},
"createdAt": {
"type": "string"
}
},
"title": "UserProfile",
"required": [
"id",
"username",
"nickname",
"avatar",
"role",
"verifiedRoles",
"verificationStatus",
"createdAt"
]
}
},
"securityDefinitions": {
"apiKey": {
"type": "apiKey",
"description": "Enter JWT Bearer token **_only_**",
"name": "Authorization",
"in": "header"
}
}
}
+100 -83
View File
@@ -1,121 +1,138 @@
{ {
"swagger": "2.0",
"info": {
"title": "",
"version": "1.0"
},
"schemes": [
"http",
"https"
],
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
"produces": [ "produces": [
"application/json" "application/json"
], ],
"schemes": [
"https"
],
"swagger": "2.0",
"info": {
"version": "1.0"
},
"basePath": "/",
"paths": { "paths": {
"/api/v1/auth/forgot-password/send": { "/api/v1/auth/forgot-password/send": {
"post": { "post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"https"
],
"summary": "忘记密码-发送验证码", "summary": "忘记密码-发送验证码",
"operationId": "emailForgotPassword", "operationId": "ForgotPassword",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/EmptyResp"
}
}
},
"parameters": [ "parameters": [
{ {
"name": "body", "name": "body",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"type": "object", "$ref": "#/definitions/ForgotPasswordReq"
"required": [
"email"
],
"properties": {
"email": {
"type": "string"
}
}
} }
} }
], ],
"responses": { "tags": [
"200": { "email"
"description": "", ]
"schema": {
"type": "object"
}
}
}
} }
}, },
"/api/v1/email/verification-code/send": { "/api/v1/email/verification-code/send": {
"post": { "post": {
"description": "向用户邮箱发送验证码,支持注册、登录、重置密码、绑定邮箱等场景",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"https"
],
"summary": "发送邮箱验证码", "summary": "发送邮箱验证码",
"operationId": "emailSendVerificationCode", "description": "向用户邮箱发送验证码,支持注册、登录、重置密码、绑定邮箱等场景",
"operationId": "SendVerificationCode",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/SendVerificationCodeResp"
}
}
},
"parameters": [ "parameters": [
{ {
"name": "body", "name": "body",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"type": "object", "$ref": "#/definitions/SendVerificationCodeReq"
"required": [
"email",
"scene"
],
"properties": {
"email": {
"type": "string"
},
"scene": {
"type": "string"
}
}
} }
} }
], ],
"responses": { "tags": [
"200": { "email"
"description": "", ]
"schema": {
"type": "object",
"properties": {
"expireInSec": {
"type": "integer"
},
"message": {
"type": "string"
},
"requestId": {
"type": "string"
}
}
}
}
}
} }
} }
}, },
"x-date": "2026-04-22 22:30:26", "definitions": {
"x-description": "This is a goctl generated swagger file.", "EmptyResp": {
"x-github": "https://github.com/zeromicro/go-zero", "type": "object",
"x-go-zero-doc": "https://go-zero.dev/", "title": "EmptyResp"
"x-goctl-version": "1.10.1" },
"ForgotPasswordReq": {
"type": "object",
"properties": {
"email": {
"type": "string"
}
},
"title": "ForgotPasswordReq",
"required": [
"email"
]
},
"SendVerificationCodeReq": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"scene": {
"type": "string"
}
},
"title": "SendVerificationCodeReq",
"required": [
"email",
"required",
"scene"
]
},
"SendVerificationCodeResp": {
"type": "object",
"properties": {
"requestId": {
"type": "string"
},
"expireInSec": {
"type": "integer",
"format": "int64"
},
"message": {
"type": "string"
}
},
"title": "SendVerificationCodeResp",
"required": [
"requestId",
"expireInSec",
"message"
]
}
},
"securityDefinitions": {
"apiKey": {
"type": "apiKey",
"description": "Enter JWT Bearer token **_only_**",
"name": "Authorization",
"in": "header"
}
}
} }
+240 -172
View File
@@ -1,213 +1,281 @@
{ {
"swagger": "2.0",
"info": {
"title": "",
"version": ""
},
"schemes": [
"http",
"https"
],
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
"produces": [ "produces": [
"application/json" "application/json"
], ],
"schemes": [
"https"
],
"swagger": "2.0",
"info": {
"version": "1.0"
},
"basePath": "/",
"paths": { "paths": {
"/api/v1/games": { "/api/v1/games/": {
"get": { "get": {
"produces": [
"application/json"
],
"schemes": [
"https"
],
"summary": "获取游戏列表", "summary": "获取游戏列表",
"operationId": "gameListGames", "operationId": "ListGames",
"parameters": [
{
"type": "integer",
"default": 0,
"example": 0,
"name": "offset",
"in": "query",
"required": true
},
{
"type": "integer",
"default": 20,
"example": 20,
"name": "limit",
"in": "query",
"required": true
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "A successful response.",
"schema": { "schema": {
"type": "object", "$ref": "#/definitions/GameListResp"
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"icon",
"category"
],
"properties": {
"category": {
"type": "string"
},
"icon": {
"type": "string"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
}
},
"meta": {
"type": "object",
"required": [
"total",
"offset",
"limit"
],
"properties": {
"limit": {
"type": "integer"
},
"offset": {
"type": "integer"
},
"total": {
"type": "integer"
}
}
}
}
} }
} }
} },
"parameters": [
{
"name": "offset",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "0"
},
{
"name": "limit",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "20"
}
],
"tags": [
"game"
],
"consumes": [
"multipart/form-data"
]
}, },
"post": { "post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"https"
],
"summary": "创建游戏", "summary": "创建游戏",
"operationId": "gameCreateGame", "operationId": "CreateGame",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/Game"
}
}
},
"parameters": [ "parameters": [
{ {
"name": "body", "name": "body",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"type": "object", "$ref": "#/definitions/Game"
"required": [
"name",
"icon",
"category"
],
"properties": {
"category": {
"type": "string"
},
"icon": {
"type": "string"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
} }
} }
], ],
"responses": { "tags": [
"200": { "game"
"description": "", ]
"schema": {
"type": "object",
"properties": {
"category": {
"type": "string"
},
"icon": {
"type": "string"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
}
}
}
} }
}, },
"/api/v1/games/{id}": { "/api/v1/games/{id}": {
"get": { "get": {
"produces": [
"application/json"
],
"schemes": [
"https"
],
"summary": "获取游戏详情", "summary": "获取游戏详情",
"operationId": "gameGetGame", "operationId": "GetGame",
"parameters": [
{
"type": "integer",
"name": "id",
"in": "path",
"required": true
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "A successful response.",
"schema": { "schema": {
"type": "object", "$ref": "#/definitions/Game"
"properties": {
"category": {
"type": "string"
},
"icon": {
"type": "string"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
} }
} }
} },
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"game"
]
} }
} }
}, },
"x-date": "2026-04-22 22:30:23", "definitions": {
"x-description": "This is a goctl generated swagger file.", "EmptyResp": {
"x-github": "https://github.com/zeromicro/go-zero", "type": "object",
"x-go-zero-doc": "https://go-zero.dev/", "title": "EmptyResp"
"x-goctl-version": "1.10.1" },
"Game": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
},
"icon": {
"type": "string"
},
"category": {
"type": "string"
}
},
"title": "Game",
"required": [
"name",
"icon",
"category"
]
},
"GameListResp": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/Game"
}
},
"meta": {
"$ref": "#/definitions/PageMeta"
}
},
"title": "GameListResp",
"required": [
"items",
"meta"
]
},
"GetGameReq": {
"type": "object",
"title": "GetGameReq"
},
"PageMeta": {
"type": "object",
"properties": {
"total": {
"type": "integer",
"format": "int64"
},
"offset": {
"type": "integer",
"format": "int64"
},
"limit": {
"type": "integer",
"format": "int64"
}
},
"title": "PageMeta",
"required": [
"total",
"offset",
"limit"
]
},
"PageReq": {
"type": "object",
"properties": {
"offset": {
"type": "integer",
"format": "int64",
"default": "0"
},
"limit": {
"type": "integer",
"format": "int64",
"default": "20"
}
},
"title": "PageReq",
"required": [
"offset",
"limit"
]
},
"SimpleUser": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"nickname": {
"type": "string"
},
"avatar": {
"type": "string"
}
},
"title": "SimpleUser",
"required": [
"id",
"nickname",
"avatar"
]
},
"UserProfile": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"username": {
"type": "string"
},
"nickname": {
"type": "string"
},
"avatar": {
"type": "string"
},
"role": {
"type": "string",
"description": " consumer, player, owner, admin"
},
"verifiedRoles": {
"type": "array",
"items": {
"type": "string"
}
},
"verificationStatus": {
"type": "object"
},
"phone": {
"type": "string"
},
"bio": {
"type": "string"
},
"createdAt": {
"type": "string"
}
},
"title": "UserProfile",
"required": [
"id",
"username",
"nickname",
"avatar",
"role",
"verifiedRoles",
"verificationStatus",
"createdAt"
]
}
},
"securityDefinitions": {
"apiKey": {
"type": "apiKey",
"description": "Enter JWT Bearer token **_only_**",
"name": "Authorization",
"in": "header"
}
}
} }
+305
View File
@@ -0,0 +1,305 @@
{
"swagger": "2.0",
"info": {
"title": "",
"version": ""
},
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/api/v1/notifications": {
"get": {
"summary": "获取通知列表",
"operationId": "ListNotifications",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/NotificationListResp"
}
}
},
"parameters": [
{
"name": "offset",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "0"
},
{
"name": "limit",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "20"
}
],
"tags": [
"notification"
],
"consumes": [
"multipart/form-data"
]
}
},
"/api/v1/notifications/read-all": {
"put": {
"summary": "全部已读",
"operationId": "ReadAllNotifications",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/EmptyResp"
}
}
},
"parameters": [
{
"name": "body",
"description": " 空响应",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/EmptyResp"
}
}
],
"tags": [
"notification"
]
}
},
"/api/v1/notifications/{id}/read": {
"put": {
"summary": "标记已读",
"operationId": "ReadNotification",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/EmptyResp"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/PathId"
}
}
],
"tags": [
"notification"
]
}
}
},
"definitions": {
"EmptyResp": {
"type": "object",
"title": "EmptyResp"
},
"Notification": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"type": {
"type": "string"
},
"title": {
"type": "string"
},
"content": {
"type": "string"
},
"read": {
"type": "boolean",
"format": "boolean"
},
"link": {
"type": "string"
},
"createdAt": {
"type": "string"
}
},
"title": "Notification",
"required": [
"id",
"type",
"title",
"content",
"read",
"createdAt"
]
},
"NotificationListResp": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/Notification"
}
},
"meta": {
"$ref": "#/definitions/PageMeta"
}
},
"title": "NotificationListResp",
"required": [
"items",
"meta"
]
},
"PageMeta": {
"type": "object",
"properties": {
"total": {
"type": "integer",
"format": "int64"
},
"offset": {
"type": "integer",
"format": "int64"
},
"limit": {
"type": "integer",
"format": "int64"
}
},
"title": "PageMeta",
"required": [
"total",
"offset",
"limit"
]
},
"PageReq": {
"type": "object",
"properties": {
"offset": {
"type": "integer",
"format": "int64",
"default": "0"
},
"limit": {
"type": "integer",
"format": "int64",
"default": "20"
}
},
"title": "PageReq",
"required": [
"offset",
"limit"
]
},
"PathId": {
"type": "object",
"title": "PathId"
},
"SimpleUser": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"nickname": {
"type": "string"
},
"avatar": {
"type": "string"
}
},
"title": "SimpleUser",
"required": [
"id",
"nickname",
"avatar"
]
},
"UserProfile": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"username": {
"type": "string"
},
"nickname": {
"type": "string"
},
"avatar": {
"type": "string"
},
"role": {
"type": "string",
"description": " consumer, player, owner, admin"
},
"verifiedRoles": {
"type": "array",
"items": {
"type": "string"
}
},
"verificationStatus": {
"type": "object"
},
"phone": {
"type": "string"
},
"bio": {
"type": "string"
},
"createdAt": {
"type": "string"
}
},
"title": "UserProfile",
"required": [
"id",
"username",
"nickname",
"avatar",
"role",
"verifiedRoles",
"verificationStatus",
"createdAt"
]
}
},
"securityDefinitions": {
"apiKey": {
"type": "apiKey",
"description": "Enter JWT Bearer token **_only_**",
"name": "Authorization",
"in": "header"
}
}
}
+103 -66
View File
@@ -1,95 +1,132 @@
{ {
"swagger": "2.0",
"info": {
"title": "文件服务",
"description": "处理文件上传与获取",
"version": "v1"
},
"schemes": [
"http",
"https"
],
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
"produces": [ "produces": [
"application/json" "application/json"
], ],
"schemes": [
"https"
],
"swagger": "2.0",
"info": {
"title": "文件服务",
"version": "v1"
},
"basePath": "/",
"paths": { "paths": {
"/api/v1/files": { "/api/v1/files": {
"get": { "get": {
"produces": [
"application/json"
],
"schemes": [
"https"
],
"summary": "文件获取接口 (如果是私有文件,通过此接口获取或重定向)", "summary": "文件获取接口 (如果是私有文件,通过此接口获取或重定向)",
"operationId": "fileGetFile", "operationId": "GetFile",
"parameters": [
{
"type": "string",
"name": "key",
"in": "query",
"required": true
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "A successful response.",
"schema": {} "schema": {}
} }
} },
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"type": "string"
}
],
"tags": [
"file"
],
"consumes": [
"multipart/form-data"
]
} }
}, },
"/api/v1/upload": { "/api/v1/upload": {
"post": { "post": {
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"schemes": [
"https"
],
"summary": "文件上传接口", "summary": "文件上传接口",
"operationId": "fileUpload", "operationId": "Upload",
"parameters": [
{
"enum": [
"avatar",
"chat",
"post",
"verification",
"dispute"
],
"type": "string",
"description": "文件类型限制",
"name": "type",
"in": "formData",
"required": true
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "A successful response.",
"schema": { "schema": {
"type": "object", "$ref": "#/definitions/UploadResp"
"properties": {
"url": {
"description": "返回 CDN 地址或访问地址",
"type": "string"
}
}
} }
} }
} },
"parameters": [
{
"name": "body",
"description": " 上传请求参数(File文件流在Handler中通过 r.FormFile 获取)",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/UploadReq"
}
}
],
"tags": [
"file"
],
"consumes": [
"multipart/form-data"
]
} }
} }
}, },
"x-date": "2026-04-22 22:30:27", "definitions": {
"x-description": "This is a goctl generated swagger file.", "GetFileReq": {
"x-github": "https://github.com/zeromicro/go-zero", "type": "object",
"x-go-zero-doc": "https://go-zero.dev/", "properties": {
"x-goctl-version": "1.10.1" "key": {
"type": "string"
}
},
"title": "GetFileReq",
"required": [
"key"
]
},
"UploadReq": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"avatar",
"chat",
"post",
"verification",
"dispute"
],
"description": " 文件类型限制"
}
},
"title": "UploadReq",
"required": [
"type"
]
},
"UploadResp": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": " 返回 CDN 地址或访问地址"
}
},
"title": "UploadResp",
"required": [
"url"
]
}
},
"securityDefinitions": {
"apiKey": {
"type": "apiKey",
"description": "Enter JWT Bearer token **_only_**",
"name": "Authorization",
"in": "header"
}
}
} }
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+401
View File
@@ -0,0 +1,401 @@
{
"swagger": "2.0",
"info": {
"title": "",
"version": ""
},
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/api/v1/orders/{id}/review": {
"post": {
"summary": "提交评价",
"operationId": "SubmitReview",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/EmptyResp"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/SubmitReviewReq"
}
}
],
"tags": [
"review"
]
}
},
"/api/v1/orders/{id}/reviews": {
"get": {
"summary": "获取订单评价",
"operationId": "GetOrderReviews",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/ReviewListResp"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "id",
"in": "query",
"required": true,
"type": "integer",
"format": "int64"
}
],
"tags": [
"review"
]
}
},
"/api/v1/reviews": {
"get": {
"summary": "获取公开评价列表",
"operationId": "ListReviews",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/ReviewListResp"
}
}
},
"parameters": [
{
"name": "offset",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "0"
},
{
"name": "limit",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "20"
}
],
"tags": [
"review"
],
"consumes": [
"multipart/form-data"
]
}
},
"/api/v1/users/{id}/reviews": {
"get": {
"summary": "获取用户收到的评价",
"operationId": "ListUserReviews",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/ReviewListResp"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "id",
"in": "query",
"required": true,
"type": "integer",
"format": "int64"
},
{
"name": "offset",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "0"
},
{
"name": "limit",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "20"
}
],
"tags": [
"review"
]
}
}
},
"definitions": {
"EmptyResp": {
"type": "object",
"title": "EmptyResp"
},
"GetOrderReviewsReq": {
"type": "object",
"title": "GetOrderReviewsReq"
},
"ListUserReviewsReq": {
"type": "object",
"properties": {
"offset": {
"type": "integer",
"format": "int64",
"default": "0"
},
"limit": {
"type": "integer",
"format": "int64",
"default": "20"
}
},
"title": "ListUserReviewsReq"
},
"PageMeta": {
"type": "object",
"properties": {
"total": {
"type": "integer",
"format": "int64"
},
"offset": {
"type": "integer",
"format": "int64"
},
"limit": {
"type": "integer",
"format": "int64"
}
},
"title": "PageMeta",
"required": [
"total",
"offset",
"limit"
]
},
"PageReq": {
"type": "object",
"properties": {
"offset": {
"type": "integer",
"format": "int64",
"default": "0"
},
"limit": {
"type": "integer",
"format": "int64",
"default": "20"
}
},
"title": "PageReq",
"required": [
"offset",
"limit"
]
},
"Review": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"orderId": {
"type": "integer",
"format": "int64"
},
"fromUserId": {
"type": "integer",
"format": "int64"
},
"fromUserName": {
"type": "string"
},
"rating": {
"type": "integer",
"format": "int32"
},
"content": {
"type": "string"
},
"sealed": {
"type": "boolean",
"format": "boolean"
},
"createdAt": {
"type": "string"
}
},
"title": "Review",
"required": [
"id",
"orderId",
"fromUserId",
"fromUserName",
"rating",
"content",
"sealed",
"createdAt"
]
},
"ReviewListResp": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/Review"
}
},
"meta": {
"$ref": "#/definitions/PageMeta"
}
},
"title": "ReviewListResp",
"required": [
"items",
"meta"
]
},
"ReviewPathId": {
"type": "object",
"title": "ReviewPathId"
},
"SimpleUser": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"nickname": {
"type": "string"
},
"avatar": {
"type": "string"
}
},
"title": "SimpleUser",
"required": [
"id",
"nickname",
"avatar"
]
},
"SubmitReviewReq": {
"type": "object",
"properties": {
"rating": {
"type": "integer",
"format": "int32"
},
"content": {
"type": "string"
}
},
"title": "SubmitReviewReq",
"required": [
"rating"
]
},
"UserProfile": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"username": {
"type": "string"
},
"nickname": {
"type": "string"
},
"avatar": {
"type": "string"
},
"role": {
"type": "string",
"description": " consumer, player, owner, admin"
},
"verifiedRoles": {
"type": "array",
"items": {
"type": "string"
}
},
"verificationStatus": {
"type": "object"
},
"phone": {
"type": "string"
},
"bio": {
"type": "string"
},
"createdAt": {
"type": "string"
}
},
"title": "UserProfile",
"required": [
"id",
"username",
"nickname",
"avatar",
"role",
"verifiedRoles",
"verificationStatus",
"createdAt"
]
}
},
"securityDefinitions": {
"apiKey": {
"type": "apiKey",
"description": "Enter JWT Bearer token **_only_**",
"name": "Authorization",
"in": "header"
}
}
}
+549
View File
@@ -0,0 +1,549 @@
{
"swagger": "2.0",
"info": {
"title": "",
"version": ""
},
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/api/v1/favorites": {
"get": {
"summary": "获取收藏列表",
"operationId": "ListFavorites",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/FavoriteListResp"
}
}
},
"parameters": [
{
"name": "offset",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "0"
},
{
"name": "limit",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "20"
}
],
"tags": [
"favorites"
],
"consumes": [
"multipart/form-data"
]
},
"post": {
"summary": "添加收藏",
"operationId": "AddFavorite",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/EmptyResp"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/FavoriteReq"
}
}
],
"tags": [
"favorites"
]
}
},
"/api/v1/favorites/{id}": {
"delete": {
"summary": "取消收藏",
"operationId": "RemoveFavorite",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/EmptyResp"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/PathIDReq"
}
}
],
"tags": [
"favorites"
]
}
},
"/api/v1/recommendations/home": {
"get": {
"summary": "首页推荐",
"operationId": "Recommendations",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/SearchResp"
}
}
},
"parameters": [
{
"name": "offset",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "0"
},
{
"name": "limit",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "20"
}
],
"tags": [
"search"
],
"consumes": [
"multipart/form-data"
]
}
},
"/api/v1/search": {
"get": {
"summary": "统一搜索",
"operationId": "Search",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/SearchResp"
}
}
},
"parameters": [
{
"name": "offset",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "0"
},
{
"name": "limit",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "20"
},
{
"name": "q",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "min",
"in": "query",
"required": false,
"type": "number",
"format": "double"
},
{
"name": "max",
"in": "query",
"required": false,
"type": "number",
"format": "double"
},
{
"name": "onlyOnline",
"in": "query",
"required": false,
"type": "boolean",
"format": "boolean"
},
{
"name": "sort",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"search"
],
"consumes": [
"multipart/form-data"
]
}
},
"/api/v1/users/{id}/favorites/check": {
"get": {
"summary": "检查收藏状态",
"operationId": "CheckFavorite",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/FavoriteCheckResp"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "id",
"in": "query",
"required": true,
"type": "integer",
"format": "int64"
},
{
"name": "targetType",
"in": "query",
"required": true,
"type": "string"
},
{
"name": "targetId",
"in": "query",
"required": true,
"type": "string"
}
],
"tags": [
"favorites"
],
"consumes": [
"multipart/form-data"
]
}
}
},
"definitions": {
"EmptyResp": {
"type": "object",
"title": "EmptyResp"
},
"Favorite": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"userId": {
"type": "string"
},
"targetType": {
"type": "string"
},
"targetId": {
"type": "string"
},
"createdAt": {
"type": "string"
}
},
"title": "Favorite",
"required": [
"id",
"userId",
"targetType",
"targetId",
"createdAt"
]
},
"FavoriteCheckReq": {
"type": "object",
"properties": {
"targetType": {
"type": "string"
},
"targetId": {
"type": "string"
}
},
"title": "FavoriteCheckReq",
"required": [
"targetType",
"targetId"
]
},
"FavoriteCheckResp": {
"type": "object",
"properties": {
"favorited": {
"type": "boolean",
"format": "boolean"
}
},
"title": "FavoriteCheckResp",
"required": [
"favorited"
]
},
"FavoriteListResp": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/Favorite"
}
},
"meta": {
"$ref": "#/definitions/PageMeta"
}
},
"title": "FavoriteListResp",
"required": [
"items",
"meta"
]
},
"FavoriteReq": {
"type": "object",
"properties": {
"targetType": {
"type": "string",
"description": " player, shop"
},
"targetId": {
"type": "string"
}
},
"title": "FavoriteReq",
"required": [
"targetType",
"targetId"
]
},
"PageMeta": {
"type": "object",
"properties": {
"total": {
"type": "integer",
"format": "int64"
},
"offset": {
"type": "integer",
"format": "int64"
},
"limit": {
"type": "integer",
"format": "int64"
}
},
"title": "PageMeta",
"required": [
"total",
"offset",
"limit"
]
},
"PageReq": {
"type": "object",
"properties": {
"offset": {
"type": "integer",
"format": "int64",
"default": "0"
},
"limit": {
"type": "integer",
"format": "int64",
"default": "20"
}
},
"title": "PageReq",
"required": [
"offset",
"limit"
]
},
"PathIDReq": {
"type": "object",
"title": "PathIDReq"
},
"SearchReq": {
"type": "object",
"properties": {
"offset": {
"type": "integer",
"format": "int64",
"default": "0"
},
"limit": {
"type": "integer",
"format": "int64",
"default": "20"
},
"q": {
"type": "string"
},
"min": {
"type": "number",
"format": "double"
},
"max": {
"type": "number",
"format": "double"
},
"onlyOnline": {
"type": "boolean",
"format": "boolean"
},
"sort": {
"type": "string"
}
},
"title": "SearchReq"
},
"SearchResp": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object"
},
"description": " Mixed items"
},
"meta": {
"$ref": "#/definitions/PageMeta"
}
},
"title": "SearchResp",
"required": [
"items",
"meta"
]
},
"SimpleUser": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"nickname": {
"type": "string"
},
"avatar": {
"type": "string"
}
},
"title": "SimpleUser",
"required": [
"id",
"nickname",
"avatar"
]
},
"UserProfile": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"username": {
"type": "string"
},
"nickname": {
"type": "string"
},
"avatar": {
"type": "string"
},
"role": {
"type": "string",
"description": " consumer, player, owner, admin"
},
"verifiedRoles": {
"type": "array",
"items": {
"type": "string"
}
},
"verificationStatus": {
"type": "object"
},
"phone": {
"type": "string"
},
"bio": {
"type": "string"
},
"createdAt": {
"type": "string"
}
},
"title": "UserProfile",
"required": [
"id",
"username",
"nickname",
"avatar",
"role",
"verifiedRoles",
"verificationStatus",
"createdAt"
]
}
},
"securityDefinitions": {
"apiKey": {
"type": "apiKey",
"description": "Enter JWT Bearer token **_only_**",
"name": "Authorization",
"in": "header"
}
}
}
File diff suppressed because it is too large Load Diff
+864 -1013
View File
File diff suppressed because it is too large Load Diff
+281 -176
View File
@@ -1,234 +1,339 @@
{ {
"swagger": "2.0",
"info": {
"title": "钱包服务",
"description": "处理钱包充值相关",
"version": "1.0"
},
"schemes": [
"http",
"https"
],
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
"produces": [ "produces": [
"application/json" "application/json"
], ],
"schemes": [
"https"
],
"swagger": "2.0",
"info": {
"title": "钱包服务",
"version": "1.0"
},
"basePath": "/",
"paths": { "paths": {
"/api/v1/wallet/balance": { "/api/v1/wallet/balance": {
"get": { "get": {
"produces": [
"application/json"
],
"schemes": [
"https"
],
"summary": "获取余额", "summary": "获取余额",
"operationId": "walletGetBalance", "operationId": "GetBalance",
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "A successful response.",
"schema": { "schema": {
"type": "object", "$ref": "#/definitions/WalletBalance"
"properties": {
"balance": {
"type": "string"
},
"frozenBalance": {
"type": "string"
}
}
} }
} }
} },
"tags": [
"wallet"
]
} }
}, },
"/api/v1/wallet/topup": { "/api/v1/wallet/topup": {
"post": { "post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"https"
],
"summary": "充值", "summary": "充值",
"operationId": "walletTopup", "operationId": "Topup",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/EmptyResp"
}
}
},
"parameters": [ "parameters": [
{ {
"name": "body", "name": "body",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"type": "object", "$ref": "#/definitions/TopupReq"
"required": [
"amount",
"method"
],
"properties": {
"amount": {
"type": "string"
},
"method": {
"type": "string"
}
}
} }
} }
], ],
"responses": { "tags": [
"200": { "wallet"
"description": "", ]
"schema": {
"type": "object"
}
}
}
} }
}, },
"/api/v1/wallet/transactions": { "/api/v1/wallet/transactions": {
"get": { "get": {
"produces": [
"application/json"
],
"schemes": [
"https"
],
"summary": "获取流水", "summary": "获取流水",
"operationId": "walletListTransactions", "operationId": "ListTransactions",
"parameters": [
{
"type": "integer",
"default": 0,
"example": 0,
"name": "offset",
"in": "query",
"required": true
},
{
"type": "integer",
"default": 20,
"example": 20,
"name": "limit",
"in": "query",
"required": true
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "A successful response.",
"schema": { "schema": {
"type": "object", "$ref": "#/definitions/TransactionListResp"
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"type",
"amount",
"description",
"createdAt"
],
"properties": {
"amount": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"description": {
"type": "string"
},
"id": {
"type": "integer"
},
"orderId": {
"type": "string"
},
"type": {
"type": "string"
}
}
}
},
"meta": {
"type": "object",
"required": [
"total",
"offset",
"limit"
],
"properties": {
"limit": {
"type": "integer"
},
"offset": {
"type": "integer"
},
"total": {
"type": "integer"
}
}
}
}
} }
} }
} },
"parameters": [
{
"name": "offset",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "0"
},
{
"name": "limit",
"in": "query",
"required": true,
"type": "integer",
"format": "int64",
"default": "20"
}
],
"tags": [
"wallet"
],
"consumes": [
"multipart/form-data"
]
} }
}, },
"/api/v1/wallet/withdraw": { "/api/v1/wallet/withdraw": {
"post": { "post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"https"
],
"summary": "提现", "summary": "提现",
"operationId": "walletWithdraw", "operationId": "Withdraw",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/EmptyResp"
}
}
},
"parameters": [ "parameters": [
{ {
"name": "body", "name": "body",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"type": "object", "$ref": "#/definitions/TopupReq"
"required": [
"amount",
"method"
],
"properties": {
"amount": {
"type": "string"
},
"method": {
"type": "string"
}
}
} }
} }
], ],
"responses": { "tags": [
"200": { "wallet"
"description": "", ]
"schema": {
"type": "object"
}
}
}
} }
} }
}, },
"x-date": "2026-04-22 22:30:25", "definitions": {
"x-description": "This is a goctl generated swagger file.", "EmptyResp": {
"x-github": "https://github.com/zeromicro/go-zero", "type": "object",
"x-go-zero-doc": "https://go-zero.dev/", "title": "EmptyResp"
"x-goctl-version": "1.10.1" },
"PageMeta": {
"type": "object",
"properties": {
"total": {
"type": "integer",
"format": "int64"
},
"offset": {
"type": "integer",
"format": "int64"
},
"limit": {
"type": "integer",
"format": "int64"
}
},
"title": "PageMeta",
"required": [
"total",
"offset",
"limit"
]
},
"PageReq": {
"type": "object",
"properties": {
"offset": {
"type": "integer",
"format": "int64",
"default": "0"
},
"limit": {
"type": "integer",
"format": "int64",
"default": "20"
}
},
"title": "PageReq",
"required": [
"offset",
"limit"
]
},
"SimpleUser": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"nickname": {
"type": "string"
},
"avatar": {
"type": "string"
}
},
"title": "SimpleUser",
"required": [
"id",
"nickname",
"avatar"
]
},
"TopupReq": {
"type": "object",
"properties": {
"amount": {
"type": "string"
},
"method": {
"type": "string"
}
},
"title": "TopupReq",
"required": [
"amount",
"method"
]
},
"Transaction": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"type": {
"type": "string"
},
"amount": {
"type": "string"
},
"description": {
"type": "string"
},
"orderId": {
"type": "string"
},
"createdAt": {
"type": "string"
}
},
"title": "Transaction",
"required": [
"id",
"type",
"amount",
"description",
"createdAt"
]
},
"TransactionListResp": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/Transaction"
}
},
"meta": {
"$ref": "#/definitions/PageMeta"
}
},
"title": "TransactionListResp",
"required": [
"items",
"meta"
]
},
"UserProfile": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"username": {
"type": "string"
},
"nickname": {
"type": "string"
},
"avatar": {
"type": "string"
},
"role": {
"type": "string",
"description": " consumer, player, owner, admin"
},
"verifiedRoles": {
"type": "array",
"items": {
"type": "string"
}
},
"verificationStatus": {
"type": "object"
},
"phone": {
"type": "string"
},
"bio": {
"type": "string"
},
"createdAt": {
"type": "string"
}
},
"title": "UserProfile",
"required": [
"id",
"username",
"nickname",
"avatar",
"role",
"verifiedRoles",
"verificationStatus",
"createdAt"
]
},
"WalletBalance": {
"type": "object",
"properties": {
"balance": {
"type": "string"
},
"frozenBalance": {
"type": "string"
}
},
"title": "WalletBalance",
"required": [
"balance",
"frozenBalance"
]
}
},
"securityDefinitions": {
"apiKey": {
"type": "apiKey",
"description": "Enter JWT Bearer token **_only_**",
"name": "Authorization",
"in": "header"
}
}
} }