Files
junhong_cmp_fiber/internal/routes/shop_series_grant.go
break f15a64395f
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m30s
修复反馈
2026-08-10 16:30:38 +08:00

72 lines
2.5 KiB
Go

package routes
import (
"github.com/gofiber/fiber/v2"
"github.com/break/junhong_cmp_fiber/internal/handler/admin"
"github.com/break/junhong_cmp_fiber/internal/model/dto"
"github.com/break/junhong_cmp_fiber/pkg/openapi"
)
func registerShopSeriesGrantRoutes(router fiber.Router, handler *admin.ShopSeriesGrantHandler, doc *openapi.Generator, basePath string) {
grants := router.Group("/shop-series-grants")
groupPath := basePath + "/shop-series-grants"
Register(grants, doc, groupPath, "GET", "", handler.List, RouteSpec{
Summary: "查询代理系列授权列表",
Tags: []string{"代理系列授权"},
Input: new(dto.ShopSeriesGrantListRequest),
Output: new(dto.ShopSeriesGrantPageResult),
Auth: true,
})
Register(grants, doc, groupPath, "GET", "/package-options", handler.ListPackageOptions, RouteSpec{
Summary: "查询代理系列授权套餐候选项",
Description: "返回指定店铺和套餐系列下当前操作者可分配的非赠送套餐,以及目标店铺的已授权状态。",
Tags: []string{"代理系列授权"},
Input: new(dto.ShopSeriesGrantPackageOptionRequest),
Output: new(dto.ShopSeriesGrantPackageOptionResult),
Auth: true,
})
Register(grants, doc, groupPath, "POST", "", handler.Create, RouteSpec{
Summary: "创建代理系列授权",
Tags: []string{"代理系列授权"},
Input: new(dto.CreateShopSeriesGrantRequest),
Output: new(dto.ShopSeriesGrantResponse),
Auth: true,
})
Register(grants, doc, groupPath, "GET", "/:id", handler.Get, RouteSpec{
Summary: "查询代理系列授权详情",
Tags: []string{"代理系列授权"},
Input: new(dto.IDReq),
Output: new(dto.ShopSeriesGrantResponse),
Auth: true,
})
Register(grants, doc, groupPath, "PUT", "/:id", handler.Update, RouteSpec{
Summary: "更新代理系列授权",
Tags: []string{"代理系列授权"},
Input: new(dto.UpdateShopSeriesGrantParams),
Output: new(dto.ShopSeriesGrantResponse),
Auth: true,
})
Register(grants, doc, groupPath, "DELETE", "/:id", handler.Delete, RouteSpec{
Summary: "删除代理系列授权",
Tags: []string{"代理系列授权"},
Input: new(dto.IDReq),
Output: nil,
Auth: true,
})
Register(grants, doc, groupPath, "PUT", "/:id/packages", handler.ManagePackages, RouteSpec{
Summary: "管理授权套餐(新增/更新/删除)",
Tags: []string{"代理系列授权"},
Input: new(dto.ManageGrantPackagesParams),
Output: new(dto.ShopSeriesGrantResponse),
Auth: true,
})
}