feat: 实现订单支付功能模块
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 5m36s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 5m36s
- 新增订单管理、支付回调、购买验证等核心服务 - 实现订单、订单项目的数据存储层和 API 接口 - 添加订单数据库迁移和 DTO 定义 - 更新 API 文档和路由配置 - 同步 3 个新规范到主规范库(订单管理、订单支付、套餐购买验证) - 完成 OpenSpec 变更归档 Ultraworked with Sisyphus
This commit is contained in:
@@ -923,6 +923,34 @@ components:
|
||||
description: 提现单号
|
||||
type: string
|
||||
type: object
|
||||
DtoCreateOrderRequest:
|
||||
properties:
|
||||
device_id:
|
||||
description: 设备ID(设备购买时必填)
|
||||
minimum: 0
|
||||
nullable: true
|
||||
type: integer
|
||||
iot_card_id:
|
||||
description: IoT卡ID(单卡购买时必填)
|
||||
minimum: 0
|
||||
nullable: true
|
||||
type: integer
|
||||
order_type:
|
||||
description: 订单类型 (single_card:单卡购买, device:设备购买)
|
||||
type: string
|
||||
package_ids:
|
||||
description: 套餐ID列表
|
||||
items:
|
||||
minimum: 0
|
||||
type: integer
|
||||
maxItems: 10
|
||||
minItems: 1
|
||||
nullable: true
|
||||
type: array
|
||||
required:
|
||||
- order_type
|
||||
- package_ids
|
||||
type: object
|
||||
DtoCreatePackageRequest:
|
||||
properties:
|
||||
data_amount_mb:
|
||||
@@ -2226,6 +2254,117 @@ components:
|
||||
description: 已提现佣金(分)
|
||||
type: integer
|
||||
type: object
|
||||
DtoOrderItemResponse:
|
||||
properties:
|
||||
amount:
|
||||
description: 小计金额(分)
|
||||
type: integer
|
||||
id:
|
||||
description: 明细ID
|
||||
minimum: 0
|
||||
type: integer
|
||||
package_id:
|
||||
description: 套餐ID
|
||||
minimum: 0
|
||||
type: integer
|
||||
package_name:
|
||||
description: 套餐名称
|
||||
type: string
|
||||
quantity:
|
||||
description: 数量
|
||||
type: integer
|
||||
unit_price:
|
||||
description: 单价(分)
|
||||
type: integer
|
||||
type: object
|
||||
DtoOrderListResponse:
|
||||
properties:
|
||||
list:
|
||||
description: 订单列表
|
||||
items:
|
||||
$ref: '#/components/schemas/DtoOrderResponse'
|
||||
nullable: true
|
||||
type: array
|
||||
page:
|
||||
description: 当前页码
|
||||
type: integer
|
||||
page_size:
|
||||
description: 每页数量
|
||||
type: integer
|
||||
total:
|
||||
description: 总数
|
||||
type: integer
|
||||
total_pages:
|
||||
description: 总页数
|
||||
type: integer
|
||||
type: object
|
||||
DtoOrderResponse:
|
||||
properties:
|
||||
buyer_id:
|
||||
description: 买家ID
|
||||
minimum: 0
|
||||
type: integer
|
||||
buyer_type:
|
||||
description: 买家类型 (personal:个人客户, agent:代理商)
|
||||
type: string
|
||||
commission_config_version:
|
||||
description: 佣金配置版本
|
||||
type: integer
|
||||
commission_status:
|
||||
description: 佣金状态 (1:待计算, 2:已计算)
|
||||
type: integer
|
||||
created_at:
|
||||
description: 创建时间
|
||||
format: date-time
|
||||
type: string
|
||||
device_id:
|
||||
description: 设备ID
|
||||
minimum: 0
|
||||
nullable: true
|
||||
type: integer
|
||||
id:
|
||||
description: 订单ID
|
||||
minimum: 0
|
||||
type: integer
|
||||
iot_card_id:
|
||||
description: IoT卡ID
|
||||
minimum: 0
|
||||
nullable: true
|
||||
type: integer
|
||||
items:
|
||||
description: 订单明细列表
|
||||
items:
|
||||
$ref: '#/components/schemas/DtoOrderItemResponse'
|
||||
nullable: true
|
||||
type: array
|
||||
order_no:
|
||||
description: 订单号
|
||||
type: string
|
||||
order_type:
|
||||
description: 订单类型 (single_card:单卡购买, device:设备购买)
|
||||
type: string
|
||||
paid_at:
|
||||
description: 支付时间
|
||||
format: date-time
|
||||
nullable: true
|
||||
type: string
|
||||
payment_method:
|
||||
description: 支付方式 (wallet:钱包支付, wechat:微信支付, alipay:支付宝支付)
|
||||
type: string
|
||||
payment_status:
|
||||
description: 支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)
|
||||
type: integer
|
||||
payment_status_text:
|
||||
description: 支付状态文本
|
||||
type: string
|
||||
total_amount:
|
||||
description: 订单总金额(分)
|
||||
type: integer
|
||||
updated_at:
|
||||
description: 更新时间
|
||||
format: date-time
|
||||
type: string
|
||||
type: object
|
||||
DtoPackagePageResult:
|
||||
properties:
|
||||
list:
|
||||
@@ -7860,6 +7999,228 @@ paths:
|
||||
summary: 发起提现申请
|
||||
tags:
|
||||
- 我的佣金
|
||||
/api/admin/orders:
|
||||
get:
|
||||
parameters:
|
||||
- description: 页码
|
||||
in: query
|
||||
name: page
|
||||
schema:
|
||||
description: 页码
|
||||
minimum: 1
|
||||
type: integer
|
||||
- description: 每页数量
|
||||
in: query
|
||||
name: page_size
|
||||
schema:
|
||||
description: 每页数量
|
||||
maximum: 100
|
||||
minimum: 1
|
||||
type: integer
|
||||
- description: 支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)
|
||||
in: query
|
||||
name: payment_status
|
||||
schema:
|
||||
description: 支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)
|
||||
maximum: 4
|
||||
minimum: 1
|
||||
nullable: true
|
||||
type: integer
|
||||
- description: 订单类型 (single_card:单卡购买, device:设备购买)
|
||||
in: query
|
||||
name: order_type
|
||||
schema:
|
||||
description: 订单类型 (single_card:单卡购买, device:设备购买)
|
||||
type: string
|
||||
- description: 订单号(精确查询)
|
||||
in: query
|
||||
name: order_no
|
||||
schema:
|
||||
description: 订单号(精确查询)
|
||||
maxLength: 30
|
||||
type: string
|
||||
- description: 创建时间起始
|
||||
in: query
|
||||
name: start_time
|
||||
schema:
|
||||
description: 创建时间起始
|
||||
format: date-time
|
||||
nullable: true
|
||||
type: string
|
||||
- description: 创建时间结束
|
||||
in: query
|
||||
name: end_time
|
||||
schema:
|
||||
description: 创建时间结束
|
||||
format: date-time
|
||||
nullable: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DtoOrderListResponse'
|
||||
description: OK
|
||||
"400":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 请求参数错误
|
||||
"401":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 未认证或认证已过期
|
||||
"403":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 无权访问
|
||||
"500":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 服务器内部错误
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 获取订单列表
|
||||
tags:
|
||||
- 订单管理
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DtoCreateOrderRequest'
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DtoOrderResponse'
|
||||
description: OK
|
||||
"400":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 请求参数错误
|
||||
"401":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 未认证或认证已过期
|
||||
"403":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 无权访问
|
||||
"500":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 服务器内部错误
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 创建订单
|
||||
tags:
|
||||
- 订单管理
|
||||
/api/admin/orders/{id}:
|
||||
get:
|
||||
parameters:
|
||||
- description: 订单ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
schema:
|
||||
description: 订单ID
|
||||
minimum: 0
|
||||
type: integer
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DtoOrderResponse'
|
||||
description: OK
|
||||
"400":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 请求参数错误
|
||||
"401":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 未认证或认证已过期
|
||||
"403":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 无权访问
|
||||
"500":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 服务器内部错误
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 获取订单详情
|
||||
tags:
|
||||
- 订单管理
|
||||
/api/admin/orders/{id}/cancel:
|
||||
post:
|
||||
parameters:
|
||||
- description: 订单ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
schema:
|
||||
description: 订单ID
|
||||
minimum: 0
|
||||
type: integer
|
||||
responses:
|
||||
"400":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 请求参数错误
|
||||
"401":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 未认证或认证已过期
|
||||
"403":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 无权访问
|
||||
"500":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 服务器内部错误
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 取消订单
|
||||
tags:
|
||||
- 订单管理
|
||||
/api/admin/package-series:
|
||||
get:
|
||||
parameters:
|
||||
@@ -11380,6 +11741,42 @@ paths:
|
||||
summary: 查询任务状态
|
||||
tags:
|
||||
- 任务管理
|
||||
/api/callback/alipay:
|
||||
post:
|
||||
responses:
|
||||
"400":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 请求参数错误
|
||||
"500":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 服务器内部错误
|
||||
summary: 支付宝回调
|
||||
tags:
|
||||
- 支付回调
|
||||
/api/callback/wechat-pay:
|
||||
post:
|
||||
responses:
|
||||
"400":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 请求参数错误
|
||||
"500":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 服务器内部错误
|
||||
summary: 微信支付回调
|
||||
tags:
|
||||
- 支付回调
|
||||
/api/h5/login:
|
||||
post:
|
||||
requestBody:
|
||||
@@ -11479,6 +11876,228 @@ paths:
|
||||
summary: 获取当前用户信息
|
||||
tags:
|
||||
- H5 认证
|
||||
/api/h5/orders:
|
||||
get:
|
||||
parameters:
|
||||
- description: 页码
|
||||
in: query
|
||||
name: page
|
||||
schema:
|
||||
description: 页码
|
||||
minimum: 1
|
||||
type: integer
|
||||
- description: 每页数量
|
||||
in: query
|
||||
name: page_size
|
||||
schema:
|
||||
description: 每页数量
|
||||
maximum: 100
|
||||
minimum: 1
|
||||
type: integer
|
||||
- description: 支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)
|
||||
in: query
|
||||
name: payment_status
|
||||
schema:
|
||||
description: 支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)
|
||||
maximum: 4
|
||||
minimum: 1
|
||||
nullable: true
|
||||
type: integer
|
||||
- description: 订单类型 (single_card:单卡购买, device:设备购买)
|
||||
in: query
|
||||
name: order_type
|
||||
schema:
|
||||
description: 订单类型 (single_card:单卡购买, device:设备购买)
|
||||
type: string
|
||||
- description: 订单号(精确查询)
|
||||
in: query
|
||||
name: order_no
|
||||
schema:
|
||||
description: 订单号(精确查询)
|
||||
maxLength: 30
|
||||
type: string
|
||||
- description: 创建时间起始
|
||||
in: query
|
||||
name: start_time
|
||||
schema:
|
||||
description: 创建时间起始
|
||||
format: date-time
|
||||
nullable: true
|
||||
type: string
|
||||
- description: 创建时间结束
|
||||
in: query
|
||||
name: end_time
|
||||
schema:
|
||||
description: 创建时间结束
|
||||
format: date-time
|
||||
nullable: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DtoOrderListResponse'
|
||||
description: OK
|
||||
"400":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 请求参数错误
|
||||
"401":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 未认证或认证已过期
|
||||
"403":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 无权访问
|
||||
"500":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 服务器内部错误
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 获取订单列表
|
||||
tags:
|
||||
- H5 订单
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DtoCreateOrderRequest'
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DtoOrderResponse'
|
||||
description: OK
|
||||
"400":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 请求参数错误
|
||||
"401":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 未认证或认证已过期
|
||||
"403":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 无权访问
|
||||
"500":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 服务器内部错误
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 创建订单
|
||||
tags:
|
||||
- H5 订单
|
||||
/api/h5/orders/{id}:
|
||||
get:
|
||||
parameters:
|
||||
- description: 订单ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
schema:
|
||||
description: 订单ID
|
||||
minimum: 0
|
||||
type: integer
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DtoOrderResponse'
|
||||
description: OK
|
||||
"400":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 请求参数错误
|
||||
"401":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 未认证或认证已过期
|
||||
"403":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 无权访问
|
||||
"500":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 服务器内部错误
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 获取订单详情
|
||||
tags:
|
||||
- H5 订单
|
||||
/api/h5/orders/{id}/wallet-pay:
|
||||
post:
|
||||
parameters:
|
||||
- description: 订单ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
schema:
|
||||
description: 订单ID
|
||||
minimum: 0
|
||||
type: integer
|
||||
responses:
|
||||
"400":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 请求参数错误
|
||||
"401":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 未认证或认证已过期
|
||||
"403":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 无权访问
|
||||
"500":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
description: 服务器内部错误
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 钱包支付
|
||||
tags:
|
||||
- H5 订单
|
||||
/api/h5/password:
|
||||
put:
|
||||
requestBody:
|
||||
|
||||
Reference in New Issue
Block a user