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

@@ -43,6 +43,14 @@ func registerShopRoutes(router fiber.Router, handler *admin.ShopHandler, doc *op
Output: nil,
Auth: true,
})
Register(shops, doc, groupPath, "GET", "/cascade", handler.Cascade, RouteSpec{
Summary: "店铺联级查询",
Tags: []string{"店铺管理"},
Input: new(dto.ShopCascadeRequest),
Output: new([]dto.ShopCascadeItem),
Auth: true,
})
}
func registerShopRoleRoutes(router fiber.Router, handler *admin.ShopRoleHandler, doc *openapi.Generator, basePath string) {