tenant: extend admin order filters

This commit is contained in:
2025-12-18 23:22:37 +08:00
parent ec4506fd2d
commit 71bd15024e
9 changed files with 502 additions and 46 deletions

View File

@@ -961,22 +961,40 @@ const docTemplate = `{
},
{
"type": "integer",
"description": "AmountPaidMax filters orders by amount_paid \u003c= this amount (cents).",
"description": "AmountPaidMax 实付金额上限(可选):amount_paid \u003c= 该值(单位分)。",
"name": "amount_paid_max",
"in": "query"
},
{
"type": "integer",
"description": "AmountPaidMin filters orders by amount_paid \u003e= this amount (cents).",
"description": "AmountPaidMin 实付金额下限(可选):amount_paid \u003e= 该值(单位分)。",
"name": "amount_paid_min",
"in": "query"
},
{
"type": "integer",
"description": "ContentID filters orders by purchased content id (via order_items join).",
"description": "ContentID 内容ID可选通过 order_items 关联过滤。",
"name": "content_id",
"in": "query"
},
{
"type": "string",
"description": "ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.titlelike。",
"name": "content_title",
"in": "query"
},
{
"type": "string",
"description": "CreatedAtFrom 创建时间起可选created_at \u003e= 该时间(用于按创建时间筛选)。",
"name": "created_at_from",
"in": "query"
},
{
"type": "string",
"description": "CreatedAtTo 创建时间止可选created_at \u003c= 该时间(用于按创建时间筛选)。",
"name": "created_at_to",
"in": "query"
},
{
"type": "integer",
"description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).",
@@ -991,13 +1009,13 @@ const docTemplate = `{
},
{
"type": "string",
"description": "PaidAtFrom filters orders by paid_at \u003e= this time.",
"description": "PaidAtFrom 支付时间起(可选):paid_at \u003e= 该时间(用于按支付时间筛选)。",
"name": "paid_at_from",
"in": "query"
},
{
"type": "string",
"description": "PaidAtTo filters orders by paid_at \u003c= this time.",
"description": "PaidAtTo 支付时间止(可选):paid_at \u003c= 该时间(用于按支付时间筛选)。",
"name": "paid_at_to",
"in": "query"
},
@@ -1019,15 +1037,35 @@ const docTemplate = `{
"OrderStatusCanceled",
"OrderStatusFailed"
],
"description": "Status filters orders by order status.",
"description": "Status 订单状态可选created/paid/refunding/refunded/canceled/failed。",
"name": "status",
"in": "query"
},
{
"enum": [
"content_purchase",
"topup"
],
"type": "string",
"x-enum-varnames": [
"OrderTypeContentPurchase",
"OrderTypeTopup"
],
"description": "Type 订单类型可选content_purchase/topup 等。",
"name": "type",
"in": "query"
},
{
"type": "integer",
"description": "UserID filters orders by buyer user id.",
"description": "UserID 下单用户ID可选按买家用户ID精确过滤。",
"name": "user_id",
"in": "query"
},
{
"type": "string",
"description": "Username 下单用户用户名关键字(可选):模糊匹配 users.usernamelike。",
"name": "username",
"in": "query"
}
],
"responses": {

View File

@@ -955,22 +955,40 @@
},
{
"type": "integer",
"description": "AmountPaidMax filters orders by amount_paid \u003c= this amount (cents).",
"description": "AmountPaidMax 实付金额上限(可选):amount_paid \u003c= 该值(单位分)。",
"name": "amount_paid_max",
"in": "query"
},
{
"type": "integer",
"description": "AmountPaidMin filters orders by amount_paid \u003e= this amount (cents).",
"description": "AmountPaidMin 实付金额下限(可选):amount_paid \u003e= 该值(单位分)。",
"name": "amount_paid_min",
"in": "query"
},
{
"type": "integer",
"description": "ContentID filters orders by purchased content id (via order_items join).",
"description": "ContentID 内容ID可选通过 order_items 关联过滤。",
"name": "content_id",
"in": "query"
},
{
"type": "string",
"description": "ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.titlelike。",
"name": "content_title",
"in": "query"
},
{
"type": "string",
"description": "CreatedAtFrom 创建时间起可选created_at \u003e= 该时间(用于按创建时间筛选)。",
"name": "created_at_from",
"in": "query"
},
{
"type": "string",
"description": "CreatedAtTo 创建时间止可选created_at \u003c= 该时间(用于按创建时间筛选)。",
"name": "created_at_to",
"in": "query"
},
{
"type": "integer",
"description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).",
@@ -985,13 +1003,13 @@
},
{
"type": "string",
"description": "PaidAtFrom filters orders by paid_at \u003e= this time.",
"description": "PaidAtFrom 支付时间起(可选):paid_at \u003e= 该时间(用于按支付时间筛选)。",
"name": "paid_at_from",
"in": "query"
},
{
"type": "string",
"description": "PaidAtTo filters orders by paid_at \u003c= this time.",
"description": "PaidAtTo 支付时间止(可选):paid_at \u003c= 该时间(用于按支付时间筛选)。",
"name": "paid_at_to",
"in": "query"
},
@@ -1013,15 +1031,35 @@
"OrderStatusCanceled",
"OrderStatusFailed"
],
"description": "Status filters orders by order status.",
"description": "Status 订单状态可选created/paid/refunding/refunded/canceled/failed。",
"name": "status",
"in": "query"
},
{
"enum": [
"content_purchase",
"topup"
],
"type": "string",
"x-enum-varnames": [
"OrderTypeContentPurchase",
"OrderTypeTopup"
],
"description": "Type 订单类型可选content_purchase/topup 等。",
"name": "type",
"in": "query"
},
{
"type": "integer",
"description": "UserID filters orders by buyer user id.",
"description": "UserID 下单用户ID可选按买家用户ID精确过滤。",
"name": "user_id",
"in": "query"
},
{
"type": "string",
"description": "Username 下单用户用户名关键字(可选):模糊匹配 users.usernamelike。",
"name": "username",
"in": "query"
}
],
"responses": {

View File

@@ -1767,19 +1767,30 @@ paths:
name: tenantCode
required: true
type: string
- description: AmountPaidMax filters orders by amount_paid <= this amount (cents).
- description: AmountPaidMax 实付金额上限可选amount_paid <= 该值(单位分)。
in: query
name: amount_paid_max
type: integer
- description: AmountPaidMin filters orders by amount_paid >= this amount (cents).
- description: AmountPaidMin 实付金额下限可选amount_paid >= 该值(单位分)。
in: query
name: amount_paid_min
type: integer
- description: ContentID filters orders by purchased content id (via order_items
join).
- description: ContentID 内容ID可选通过 order_items 关联过滤。
in: query
name: content_id
type: integer
- description: ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.titlelike
in: query
name: content_title
type: string
- description: CreatedAtFrom 创建时间起可选created_at >= 该时间(用于按创建时间筛选)。
in: query
name: created_at_from
type: string
- description: CreatedAtTo 创建时间止可选created_at <= 该时间(用于按创建时间筛选)。
in: query
name: created_at_to
type: string
- description: Limit is page size; only values in {10,20,50,100} are accepted
(otherwise defaults to 10).
in: query
@@ -1789,15 +1800,15 @@ paths:
in: query
name: page
type: integer
- description: PaidAtFrom filters orders by paid_at >= this time.
- description: PaidAtFrom 支付时间起可选paid_at >= 该时间(用于按支付时间筛选)。
in: query
name: paid_at_from
type: string
- description: PaidAtTo filters orders by paid_at <= this time.
- description: PaidAtTo 支付时间止可选paid_at <= 该时间(用于按支付时间筛选)。
in: query
name: paid_at_to
type: string
- description: Status filters orders by order status.
- description: Status 订单状态可选created/paid/refunding/refunded/canceled/failed。
enum:
- created
- paid
@@ -1815,10 +1826,24 @@ paths:
- OrderStatusRefunded
- OrderStatusCanceled
- OrderStatusFailed
- description: UserID filters orders by buyer user id.
- description: Type 订单类型可选content_purchase/topup 等。
enum:
- content_purchase
- topup
in: query
name: type
type: string
x-enum-varnames:
- OrderTypeContentPurchase
- OrderTypeTopup
- description: UserID 下单用户ID可选按买家用户ID精确过滤。
in: query
name: user_id
type: integer
- description: Username 下单用户用户名关键字(可选):模糊匹配 users.usernamelike
in: query
name: username
type: string
produces:
- application/json
responses: