This commit is contained in:
2025-07-15 13:21:34 +08:00
parent 807004f78d
commit 83bf9aea7d
44 changed files with 9798 additions and 8 deletions

View File

@@ -68,6 +68,25 @@ definitions:
- role
- username
type: object
commands.CreateSubscriptionCommand:
properties:
api_limit:
type: integer
auto_renew:
type: boolean
duration:
type: string
price:
minimum: 0
type: number
product_id:
type: string
user_id:
type: string
required:
- product_id
- user_id
type: object
commands.CreateUserSecretsCommand:
properties:
expires_at:
@@ -156,6 +175,29 @@ definitions:
- password
- phone
type: object
commands.ResetPasswordCommand:
description: 重置用户密码请求参数(忘记密码时使用)
properties:
code:
example: "123456"
type: string
confirm_new_password:
example: newpassword123
type: string
new_password:
example: newpassword123
maxLength: 128
minLength: 6
type: string
phone:
example: "13800138000"
type: string
required:
- code
- confirm_new_password
- new_password
- phone
type: object
commands.SendCodeCommand:
description: 发送短信验证码请求参数
properties:
@@ -428,6 +470,52 @@ definitions:
total_operations:
type: integer
type: object
responses.CategoryInfoResponse:
properties:
children:
items:
$ref: '#/definitions/responses.CategoryInfoResponse'
type: array
code:
type: string
created_at:
type: string
description:
type: string
id:
type: string
is_enabled:
type: boolean
is_visible:
type: boolean
level:
type: integer
name:
type: string
parent:
allOf:
- $ref: '#/definitions/responses.CategoryInfoResponse'
description: 关联信息
parent_id:
type: string
sort:
type: integer
updated_at:
type: string
type: object
responses.CategoryListResponse:
properties:
items:
items:
$ref: '#/definitions/responses.CategoryInfoResponse'
type: array
page:
type: integer
size:
type: integer
total:
type: integer
type: object
responses.CertificationResponse:
properties:
completed_at:
@@ -496,6 +584,83 @@ definitions:
user:
$ref: '#/definitions/responses.UserProfileResponse'
type: object
responses.ProductInfoResponse:
properties:
category:
allOf:
- $ref: '#/definitions/responses.CategoryInfoResponse'
description: 关联信息
category_id:
type: string
code:
type: string
content:
type: string
created_at:
type: string
description:
type: string
id:
type: string
is_enabled:
type: boolean
is_package:
type: boolean
is_visible:
type: boolean
name:
type: string
price:
type: number
seo_description:
type: string
seo_keywords:
type: string
seo_title:
description: SEO信息
type: string
updated_at:
type: string
type: object
responses.ProductListResponse:
properties:
items:
items:
$ref: '#/definitions/responses.ProductInfoResponse'
type: array
page:
type: integer
size:
type: integer
total:
type: integer
type: object
responses.ProductSimpleResponse:
properties:
code:
type: string
description:
type: string
id:
type: string
is_package:
type: boolean
name:
type: string
price:
type: number
type: object
responses.ProductStatsResponse:
properties:
enabled_products:
type: integer
package_products:
type: integer
total_products:
type: integer
visible_products:
type: integer
type: object
responses.RegisterUserResponse:
description: 用户注册成功响应
properties:
@@ -506,6 +671,56 @@ definitions:
example: "13800138000"
type: string
type: object
responses.SubscriptionInfoResponse:
properties:
api_used:
type: integer
created_at:
type: string
id:
type: string
price:
type: number
product:
allOf:
- $ref: '#/definitions/responses.ProductSimpleResponse'
description: 关联信息
product_id:
type: string
updated_at:
type: string
user_id:
type: string
type: object
responses.SubscriptionListResponse:
properties:
items:
items:
$ref: '#/definitions/responses.SubscriptionInfoResponse'
type: array
page:
type: integer
size:
type: integer
total:
type: integer
type: object
responses.SubscriptionStatsResponse:
properties:
total_revenue:
type: number
total_subscriptions:
type: integer
type: object
responses.SubscriptionUsageResponse:
properties:
api_used:
type: integer
id:
type: string
product_id:
type: string
type: object
responses.TransactionResponse:
properties:
amount:
@@ -558,6 +773,9 @@ definitions:
id:
example: 123e4567-e89b-12d3-a456-426614174000
type: string
is_certified:
example: false
type: boolean
phone:
example: "13800138000"
type: string
@@ -905,7 +1123,7 @@ paths:
type: object
summary: 管理员登录
tags:
- 管理员认证
- 管理员管理
/api/v1/admin/change-password:
post:
consumes:
@@ -973,6 +1191,71 @@ paths:
summary: 获取管理员统计信息
tags:
- 管理员管理
/api/v1/categories:
get:
consumes:
- application/json
description: 获取产品分类列表,支持层级筛选
parameters:
- description: 父级分类ID
in: query
name: parent_id
type: string
- description: 分类层级
in: query
name: level
type: integer
produces:
- application/json
responses:
"200":
description: 获取分类列表成功
schema:
$ref: '#/definitions/responses.CategoryListResponse'
"500":
description: 服务器内部错误
schema:
additionalProperties: true
type: object
summary: 获取分类列表
tags:
- 数据大厅
/api/v1/categories/{id}:
get:
consumes:
- application/json
description: 根据分类ID获取分类详细信息
parameters:
- description: 分类ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: 获取分类详情成功
schema:
$ref: '#/definitions/responses.CategoryInfoResponse'
"400":
description: 请求参数错误
schema:
additionalProperties: true
type: object
"404":
description: 分类不存在
schema:
additionalProperties: true
type: object
"500":
description: 服务器内部错误
schema:
additionalProperties: true
type: object
summary: 获取分类详情
tags:
- 数据大厅
/api/v1/certification:
post:
consumes:
@@ -1364,7 +1647,7 @@ paths:
- Bearer: []
summary: 上传营业执照并同步OCR识别
tags:
- 认证管理
- 企业认证
/api/v1/finance/secrets:
get:
consumes:
@@ -1756,6 +2039,358 @@ paths:
summary: 钱包提现
tags:
- 钱包管理
/api/v1/my/subscriptions:
get:
consumes:
- application/json
description: 获取当前用户的订阅列表
parameters:
- default: 1
description: 页码
in: query
name: page
type: integer
- default: 10
description: 每页数量
in: query
name: page_size
type: integer
- description: 订阅状态
in: query
name: status
type: string
- description: 排序字段
in: query
name: sort_by
type: string
- description: 排序方向
enum:
- asc
- desc
in: query
name: sort_order
type: string
produces:
- application/json
responses:
"200":
description: 获取订阅列表成功
schema:
$ref: '#/definitions/responses.SubscriptionListResponse'
"400":
description: 请求参数错误
schema:
additionalProperties: true
type: object
"401":
description: 未认证
schema:
additionalProperties: true
type: object
"500":
description: 服务器内部错误
schema:
additionalProperties: true
type: object
security:
- Bearer: []
summary: 获取我的订阅列表
tags:
- 我的订阅
/api/v1/my/subscriptions/{id}:
get:
consumes:
- application/json
description: 获取指定订阅的详细信息
parameters:
- description: 订阅ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: 获取订阅详情成功
schema:
$ref: '#/definitions/responses.SubscriptionInfoResponse'
"400":
description: 请求参数错误
schema:
additionalProperties: true
type: object
"401":
description: 未认证
schema:
additionalProperties: true
type: object
"404":
description: 订阅不存在
schema:
additionalProperties: true
type: object
"500":
description: 服务器内部错误
schema:
additionalProperties: true
type: object
security:
- Bearer: []
summary: 获取我的订阅详情
tags:
- 我的订阅
/api/v1/my/subscriptions/{id}/usage:
get:
consumes:
- application/json
description: 获取指定订阅的使用情况统计
parameters:
- description: 订阅ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: 获取使用情况成功
schema:
$ref: '#/definitions/responses.SubscriptionUsageResponse'
"400":
description: 请求参数错误
schema:
additionalProperties: true
type: object
"401":
description: 未认证
schema:
additionalProperties: true
type: object
"404":
description: 订阅不存在
schema:
additionalProperties: true
type: object
"500":
description: 服务器内部错误
schema:
additionalProperties: true
type: object
security:
- Bearer: []
summary: 获取我的订阅使用情况
tags:
- 我的订阅
/api/v1/my/subscriptions/stats:
get:
consumes:
- application/json
description: 获取当前用户的订阅统计信息
produces:
- application/json
responses:
"200":
description: 获取订阅统计成功
schema:
$ref: '#/definitions/responses.SubscriptionStatsResponse'
"401":
description: 未认证
schema:
additionalProperties: true
type: object
"500":
description: 服务器内部错误
schema:
additionalProperties: true
type: object
security:
- Bearer: []
summary: 获取我的订阅统计
tags:
- 我的订阅
/api/v1/products:
get:
consumes:
- application/json
description: 分页获取可用的产品列表,支持筛选
parameters:
- default: 1
description: 页码
in: query
name: page
type: integer
- default: 10
description: 每页数量
in: query
name: page_size
type: integer
- description: 搜索关键词
in: query
name: keyword
type: string
- description: 分类ID
in: query
name: category_id
type: string
- description: 最低价格
in: query
name: min_price
type: number
- description: 最高价格
in: query
name: max_price
type: number
- description: 是否启用
in: query
name: is_enabled
type: boolean
- description: 是否可见
in: query
name: is_visible
type: boolean
- description: 是否组合包
in: query
name: is_package
type: boolean
- description: 排序字段
in: query
name: sort_by
type: string
- description: 排序方向
enum:
- asc
- desc
in: query
name: sort_order
type: string
produces:
- application/json
responses:
"200":
description: 获取产品列表成功
schema:
$ref: '#/definitions/responses.ProductListResponse'
"400":
description: 请求参数错误
schema:
additionalProperties: true
type: object
"500":
description: 服务器内部错误
schema:
additionalProperties: true
type: object
summary: 获取产品列表
tags:
- 数据大厅
/api/v1/products/{id}:
get:
consumes:
- application/json
description: 根据产品ID获取产品详细信息
parameters:
- description: 产品ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: 获取产品详情成功
schema:
$ref: '#/definitions/responses.ProductInfoResponse'
"400":
description: 请求参数错误
schema:
additionalProperties: true
type: object
"404":
description: 产品不存在
schema:
additionalProperties: true
type: object
"500":
description: 服务器内部错误
schema:
additionalProperties: true
type: object
summary: 获取产品详情
tags:
- 数据大厅
/api/v1/products/{id}/subscribe:
post:
consumes:
- application/json
description: 用户订阅指定产品
parameters:
- description: 产品ID
in: path
name: id
required: true
type: string
- description: 订阅请求
in: body
name: request
required: true
schema:
$ref: '#/definitions/commands.CreateSubscriptionCommand'
produces:
- application/json
responses:
"200":
description: 订阅成功
schema:
additionalProperties: true
type: object
"400":
description: 请求参数错误
schema:
additionalProperties: true
type: object
"401":
description: 未认证
schema:
additionalProperties: true
type: object
"404":
description: 产品不存在
schema:
additionalProperties: true
type: object
"500":
description: 服务器内部错误
schema:
additionalProperties: true
type: object
security:
- Bearer: []
summary: 订阅产品
tags:
- 数据大厅
/api/v1/products/stats:
get:
consumes:
- application/json
description: 获取产品相关的统计信息
produces:
- application/json
responses:
"200":
description: 获取统计信息成功
schema:
$ref: '#/definitions/responses.ProductStatsResponse'
"500":
description: 服务器内部错误
schema:
additionalProperties: true
type: object
summary: 获取产品统计
tags:
- 数据大厅
/api/v1/users/login-password:
post:
consumes:
@@ -1939,6 +2574,44 @@ paths:
summary: 用户注册
tags:
- 用户认证
/api/v1/users/reset-password:
post:
consumes:
- application/json
description: 使用手机号、验证码和新密码重置用户密码(忘记密码时使用)
parameters:
- description: 重置密码请求
in: body
name: request
required: true
schema:
$ref: '#/definitions/commands.ResetPasswordCommand'
produces:
- application/json
responses:
"200":
description: 密码重置成功
schema:
additionalProperties: true
type: object
"400":
description: 请求参数错误或验证码无效
schema:
additionalProperties: true
type: object
"404":
description: 用户不存在
schema:
additionalProperties: true
type: object
"500":
description: 服务器内部错误
schema:
additionalProperties: true
type: object
summary: 重置密码
tags:
- 用户认证
/api/v1/users/send-code:
post:
consumes: