feat: 后台订单按平台、代理商、在线支付拆分列表与导出
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m34s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m34s
- 新增 GET /orders/platform、/orders/agent、/orders/online,类别由路径固定,参数、响应、权限同原订单列表 - 新增导出场景 order_platform、order_agent、order_online,筛选与表头同 order - 类别按钱从哪来划分:客户端下单为在线支付;后台代理钱包扣款(含平台代扣)为代理商;其余后台订单为平台 - 列表与导出共用 internal/query/ordercategory 的类别条件 - 企业账号访问订单列表、详情、购买预检改为无权限,修复其可看到全部订单的问题 - 原订单列表与 order 导出场景保留不变 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,8 +14,9 @@ func registerExportTaskRoutes(router fiber.Router, handler *admin.ExportTaskHand
|
||||
|
||||
Register(exportTasks, doc, groupPath, "POST", "", handler.Create, RouteSpec{
|
||||
Summary: "创建导出任务",
|
||||
Description: "创建统一导出任务,支持场景 scene=device/iot_card/order/package/agent_wallet_transaction/agent_recharge/refund/exchange/commission_record/package_traffic_alert/expiring_asset/operations_activation/operations_renewal/stop_resume_rule_dry_run/polling_pause/polling_stop_refused_alert 和格式 format=xlsx/csv。" +
|
||||
Description: "创建统一导出任务,支持场景 scene=device/iot_card/order/order_platform/order_agent/order_online/package/agent_wallet_transaction/agent_recharge/refund/exchange/commission_record/package_traffic_alert/expiring_asset/operations_activation/operations_renewal/stop_resume_rule_dry_run/polling_pause/polling_stop_refused_alert 和格式 format=xlsx/csv。" +
|
||||
"polling_pause 的 query.filters 同 GET /card-polling-pauses(asset_type、carrier_id、source、status、identifier、operator_id、start_time、end_time);polling_stop_refused_alert 的 query.filters 为 carrier_id、status、iccid、start_time、end_time;两者仅超级管理员与平台账号可导出。device、iot_card 场景支持 enable_polling 筛选,导出最后一列为「是否轮询」。" +
|
||||
"order_platform、order_agent、order_online 分别导出平台订单、代理商订单、在线支付订单(与 GET /orders/platform、/orders/agent、/orders/online 一一对应),query.filters、表头与数据范围同 order,不接收类别参数。" +
|
||||
"受影响场景的时间筛选固定为 query.filters.start_time 与 query.filters.end_time,取值必须为带显式时区的 RFC3339 秒级时间,创建时规范化为 UTC 秒级字符串后冻结。",
|
||||
Tags: []string{"导出任务"},
|
||||
Input: new(dto.CreateExportTaskRequest),
|
||||
|
||||
@@ -20,19 +20,49 @@ func registerAdminOrderRoutes(router fiber.Router, handler *admin.OrderHandler,
|
||||
})
|
||||
|
||||
Register(router, doc, basePath, "GET", "/orders", handler.List, RouteSpec{
|
||||
Summary: "获取订单列表",
|
||||
Tags: []string{"订单管理"},
|
||||
Input: new(dto.OrderListRequest),
|
||||
Output: new(dto.OrderListResponse),
|
||||
Auth: true,
|
||||
Summary: "获取订单列表",
|
||||
Description: "平台订单、代理商订单、在线支付订单全部返回;按类别查看请用 `/orders/platform`、`/orders/agent`、`/orders/online`。代理账号只看到买家是本店铺的订单。企业账号无权访问。",
|
||||
Tags: []string{"订单管理"},
|
||||
Input: new(dto.OrderListRequest),
|
||||
Output: new(dto.OrderListResponse),
|
||||
Auth: true,
|
||||
})
|
||||
|
||||
// 按类别拆分的列表是静态路径,必须注册在 /orders/:id 之前,否则会被当作订单 ID 解析。
|
||||
Register(router, doc, basePath, "GET", "/orders/platform", handler.ListPlatform, RouteSpec{
|
||||
Summary: "获取平台订单列表",
|
||||
Description: "平台订单:后台下单且不走代理钱包(线下支付),含平台自营、赠送、平台代购代理名下的卡。查询参数、分页、响应结构、权限与数据范围与 `GET /orders` 相同,只额外固定订单类别,不接收类别参数。代理账号只看到买家是本店铺的订单。企业账号无权访问。",
|
||||
Tags: []string{"订单管理"},
|
||||
Input: new(dto.OrderListRequest),
|
||||
Output: new(dto.OrderListResponse),
|
||||
Auth: true,
|
||||
})
|
||||
|
||||
Register(router, doc, basePath, "GET", "/orders/agent", handler.ListAgent, RouteSpec{
|
||||
Summary: "获取代理商订单列表",
|
||||
Description: "代理商订单:后台下单且从代理钱包扣款,含代理自购、代理给下级购买、平台代扣代理钱包、代理 OpenAPI 下单。查询参数、分页、响应结构、权限与数据范围与 `GET /orders` 相同,只额外固定订单类别,不接收类别参数。代理账号只看到买家是本店铺的订单。企业账号无权访问。",
|
||||
Tags: []string{"订单管理"},
|
||||
Input: new(dto.OrderListRequest),
|
||||
Output: new(dto.OrderListResponse),
|
||||
Auth: true,
|
||||
})
|
||||
|
||||
Register(router, doc, basePath, "GET", "/orders/online", handler.ListOnline, RouteSpec{
|
||||
Summary: "获取在线支付订单列表",
|
||||
Description: "在线支付订单:个人客户在客户端下的全部订单,含微信、支付宝、卡钱包支付、自动续费、自动购买与待支付订单。查询参数、分页、响应结构、权限与数据范围与 `GET /orders` 相同,只额外固定订单类别,不接收类别参数。代理账号只看到买家是本店铺的订单。企业账号无权访问。在线支付订单的买家是个人客户,代理账号调用结果为空。",
|
||||
Tags: []string{"订单管理"},
|
||||
Input: new(dto.OrderListRequest),
|
||||
Output: new(dto.OrderListResponse),
|
||||
Auth: true,
|
||||
})
|
||||
|
||||
Register(router, doc, basePath, "GET", "/orders/:id", handler.Get, RouteSpec{
|
||||
Summary: "获取订单详情",
|
||||
Tags: []string{"订单管理"},
|
||||
Input: new(dto.GetOrderRequest),
|
||||
Output: new(dto.OrderDetailResponse),
|
||||
Auth: true,
|
||||
Summary: "获取订单详情",
|
||||
Description: "企业账号无权访问。",
|
||||
Tags: []string{"订单管理"},
|
||||
Input: new(dto.GetOrderRequest),
|
||||
Output: new(dto.OrderDetailResponse),
|
||||
Auth: true,
|
||||
})
|
||||
|
||||
Register(router, doc, basePath, "POST", "/orders/:id/cancel", handler.Cancel, RouteSpec{
|
||||
@@ -44,11 +74,12 @@ func registerAdminOrderRoutes(router fiber.Router, handler *admin.OrderHandler,
|
||||
})
|
||||
|
||||
Register(router, doc, basePath, "POST", "/orders/purchase-check", handler.PurchaseCheck, RouteSpec{
|
||||
Summary: "套餐购买预检",
|
||||
Tags: []string{"订单管理"},
|
||||
Input: new(dto.PurchaseCheckRequest),
|
||||
Output: new(dto.PurchaseCheckResponse),
|
||||
Auth: true,
|
||||
Summary: "套餐购买预检",
|
||||
Description: "企业账号无权访问。",
|
||||
Tags: []string{"订单管理"},
|
||||
Input: new(dto.PurchaseCheckRequest),
|
||||
Output: new(dto.PurchaseCheckResponse),
|
||||
Auth: true,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user