feat: 新增店铺联级查询接口
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m3s

- 新增 GET /api/admin/shops/cascade 接口,支持按店铺名模糊查询和上级ID过滤
- Store 层新增 ListForCascade(支持数据权限过滤)和 GetParentIDsWithChildren 方法
- Service 层新增 ListCascade,批量判断 has_children 避免 N+1 查询
- 返回格式:[{id, shop_name, has_children}]

💘 Generated with Crush

Assisted-by: Claude Sonnet 4.6 via Crush <crush@charm.land>
This commit is contained in:
2026-04-09 11:43:37 +08:00
parent 384a54164b
commit 81ba84cf05
6 changed files with 201 additions and 0 deletions

View File

@@ -6134,6 +6134,19 @@ components:
- card_no
- ssid
type: object
DtoShopCascadeItem:
properties:
has_children:
description: 是否有下级店铺
type: boolean
id:
description: 店铺ID
minimum: 0
type: integer
shop_name:
description: 店铺名称
type: string
type: object
DtoShopCommissionRecordItem:
properties:
amount:
@@ -20811,6 +20824,82 @@ paths:
summary: 代理商提现记录
tags:
- 代理商佣金管理
/api/admin/shops/cascade:
get:
parameters:
- description: 店铺名称(模糊查询)
in: query
name: shop_name
schema:
description: 店铺名称(模糊查询)
maxLength: 100
type: string
- description: 上级店铺ID不传则查询顶级店铺
in: query
name: parent_id
schema:
description: 上级店铺ID不传则查询顶级店铺
minimum: 1
nullable: true
type: integer
responses:
"200":
content:
application/json:
schema:
properties:
code:
description: 响应码
example: 0
type: integer
data:
items:
$ref: '#/components/schemas/DtoShopCascadeItem'
type: array
msg:
description: 响应消息
example: success
type: string
timestamp:
description: 时间戳
format: date-time
type: string
required:
- code
- msg
- data
- timestamp
type: object
description: 成功
"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/shops/commission-summary:
get:
parameters: