tenant: admin order export csv
This commit is contained in:
@@ -1102,6 +1102,157 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/t/{tenantCode}/v1/admin/orders/export": {
|
||||
"get": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Tenant"
|
||||
],
|
||||
"summary": "订单导出(租户管理)",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Tenant Code",
|
||||
"name": "tenantCode",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "AmountPaidMax 实付金额上限(可选):amount_paid \u003c= 该值(单位分)。",
|
||||
"name": "amount_paid_max",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "AmountPaidMin 实付金额下限(可选):amount_paid \u003e= 该值(单位分)。",
|
||||
"name": "amount_paid_min",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Asc specifies comma-separated field names to sort ascending by.",
|
||||
"name": "asc",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "ContentID 内容ID(可选):通过 order_items 关联过滤。",
|
||||
"name": "content_id",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。",
|
||||
"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": "string",
|
||||
"description": "Desc specifies comma-separated field names to sort descending by.",
|
||||
"name": "desc",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.",
|
||||
"name": "page",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "PaidAtFrom 支付时间起(可选):paid_at \u003e= 该时间(用于按支付时间筛选)。",
|
||||
"name": "paid_at_from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "PaidAtTo 支付时间止(可选):paid_at \u003c= 该时间(用于按支付时间筛选)。",
|
||||
"name": "paid_at_to",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"created",
|
||||
"paid",
|
||||
"refunding",
|
||||
"refunded",
|
||||
"canceled",
|
||||
"failed"
|
||||
],
|
||||
"type": "string",
|
||||
"x-enum-varnames": [
|
||||
"OrderStatusCreated",
|
||||
"OrderStatusPaid",
|
||||
"OrderStatusRefunding",
|
||||
"OrderStatusRefunded",
|
||||
"OrderStatusCanceled",
|
||||
"OrderStatusFailed"
|
||||
],
|
||||
"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 下单用户ID(可选):按买家用户ID精确过滤。",
|
||||
"name": "user_id",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。",
|
||||
"name": "username",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.AdminOrderExportResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/t/{tenantCode}/v1/admin/orders/{orderID}": {
|
||||
"get": {
|
||||
"consumes": [
|
||||
@@ -2251,6 +2402,23 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.AdminOrderExportResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"content_type": {
|
||||
"description": "ContentType 内容类型:当前固定为 text/csv。",
|
||||
"type": "string"
|
||||
},
|
||||
"csv": {
|
||||
"description": "CSV CSV 文本内容:UTF-8 编码,包含表头与数据行;前端可直接下载为文件。",
|
||||
"type": "string"
|
||||
},
|
||||
"filename": {
|
||||
"description": "Filename 建议文件名:前端可用于下载时的默认文件名。",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.AdminOrderRefundForm": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -1096,6 +1096,157 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/t/{tenantCode}/v1/admin/orders/export": {
|
||||
"get": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Tenant"
|
||||
],
|
||||
"summary": "订单导出(租户管理)",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Tenant Code",
|
||||
"name": "tenantCode",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "AmountPaidMax 实付金额上限(可选):amount_paid \u003c= 该值(单位分)。",
|
||||
"name": "amount_paid_max",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "AmountPaidMin 实付金额下限(可选):amount_paid \u003e= 该值(单位分)。",
|
||||
"name": "amount_paid_min",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Asc specifies comma-separated field names to sort ascending by.",
|
||||
"name": "asc",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "ContentID 内容ID(可选):通过 order_items 关联过滤。",
|
||||
"name": "content_id",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。",
|
||||
"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": "string",
|
||||
"description": "Desc specifies comma-separated field names to sort descending by.",
|
||||
"name": "desc",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.",
|
||||
"name": "page",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "PaidAtFrom 支付时间起(可选):paid_at \u003e= 该时间(用于按支付时间筛选)。",
|
||||
"name": "paid_at_from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "PaidAtTo 支付时间止(可选):paid_at \u003c= 该时间(用于按支付时间筛选)。",
|
||||
"name": "paid_at_to",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"created",
|
||||
"paid",
|
||||
"refunding",
|
||||
"refunded",
|
||||
"canceled",
|
||||
"failed"
|
||||
],
|
||||
"type": "string",
|
||||
"x-enum-varnames": [
|
||||
"OrderStatusCreated",
|
||||
"OrderStatusPaid",
|
||||
"OrderStatusRefunding",
|
||||
"OrderStatusRefunded",
|
||||
"OrderStatusCanceled",
|
||||
"OrderStatusFailed"
|
||||
],
|
||||
"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 下单用户ID(可选):按买家用户ID精确过滤。",
|
||||
"name": "user_id",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。",
|
||||
"name": "username",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.AdminOrderExportResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/t/{tenantCode}/v1/admin/orders/{orderID}": {
|
||||
"get": {
|
||||
"consumes": [
|
||||
@@ -2245,6 +2396,23 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.AdminOrderExportResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"content_type": {
|
||||
"description": "ContentType 内容类型:当前固定为 text/csv。",
|
||||
"type": "string"
|
||||
},
|
||||
"csv": {
|
||||
"description": "CSV CSV 文本内容:UTF-8 编码,包含表头与数据行;前端可直接下载为文件。",
|
||||
"type": "string"
|
||||
},
|
||||
"filename": {
|
||||
"description": "Filename 建议文件名:前端可用于下载时的默认文件名。",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.AdminOrderRefundForm": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -187,6 +187,18 @@ definitions:
|
||||
- $ref: '#/definitions/models.Order'
|
||||
description: Order is the order with items preloaded.
|
||||
type: object
|
||||
dto.AdminOrderExportResponse:
|
||||
properties:
|
||||
content_type:
|
||||
description: ContentType 内容类型:当前固定为 text/csv。
|
||||
type: string
|
||||
csv:
|
||||
description: CSV CSV 文本内容:UTF-8 编码,包含表头与数据行;前端可直接下载为文件。
|
||||
type: string
|
||||
filename:
|
||||
description: Filename 建议文件名:前端可用于下载时的默认文件名。
|
||||
type: string
|
||||
type: object
|
||||
dto.AdminOrderRefundForm:
|
||||
properties:
|
||||
force:
|
||||
@@ -1926,6 +1938,112 @@ paths:
|
||||
summary: 订单退款(租户管理)
|
||||
tags:
|
||||
- Tenant
|
||||
/t/{tenantCode}/v1/admin/orders/export:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- description: Tenant Code
|
||||
in: path
|
||||
name: tenantCode
|
||||
required: true
|
||||
type: string
|
||||
- description: AmountPaidMax 实付金额上限(可选):amount_paid <= 该值(单位分)。
|
||||
in: query
|
||||
name: amount_paid_max
|
||||
type: integer
|
||||
- description: AmountPaidMin 实付金额下限(可选):amount_paid >= 该值(单位分)。
|
||||
in: query
|
||||
name: amount_paid_min
|
||||
type: integer
|
||||
- description: Asc specifies comma-separated field names to sort ascending by.
|
||||
in: query
|
||||
name: asc
|
||||
type: string
|
||||
- description: ContentID 内容ID(可选):通过 order_items 关联过滤。
|
||||
in: query
|
||||
name: content_id
|
||||
type: integer
|
||||
- description: ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。
|
||||
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: Desc specifies comma-separated field names to sort descending
|
||||
by.
|
||||
in: query
|
||||
name: desc
|
||||
type: string
|
||||
- description: Limit is page size; only values in {10,20,50,100} are accepted
|
||||
(otherwise defaults to 10).
|
||||
in: query
|
||||
name: limit
|
||||
type: integer
|
||||
- description: Page is 1-based page index; values <= 0 are normalized to 1.
|
||||
in: query
|
||||
name: page
|
||||
type: integer
|
||||
- description: PaidAtFrom 支付时间起(可选):paid_at >= 该时间(用于按支付时间筛选)。
|
||||
in: query
|
||||
name: paid_at_from
|
||||
type: string
|
||||
- description: PaidAtTo 支付时间止(可选):paid_at <= 该时间(用于按支付时间筛选)。
|
||||
in: query
|
||||
name: paid_at_to
|
||||
type: string
|
||||
- description: Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。
|
||||
enum:
|
||||
- created
|
||||
- paid
|
||||
- refunding
|
||||
- refunded
|
||||
- canceled
|
||||
- failed
|
||||
in: query
|
||||
name: status
|
||||
type: string
|
||||
x-enum-varnames:
|
||||
- OrderStatusCreated
|
||||
- OrderStatusPaid
|
||||
- OrderStatusRefunding
|
||||
- OrderStatusRefunded
|
||||
- OrderStatusCanceled
|
||||
- OrderStatusFailed
|
||||
- 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.username(like)。
|
||||
in: query
|
||||
name: username
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/dto.AdminOrderExportResponse'
|
||||
summary: 订单导出(租户管理)
|
||||
tags:
|
||||
- Tenant
|
||||
/t/{tenantCode}/v1/admin/users:
|
||||
get:
|
||||
consumes:
|
||||
|
||||
Reference in New Issue
Block a user