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" ) // registerShopSeriesAllocationRoutes 注册套餐系列分配相关路由 func registerShopSeriesAllocationRoutes(router fiber.Router, handler *admin.ShopSeriesAllocationHandler, doc *openapi.Generator, basePath string) { allocations := router.Group("/shop-series-allocations") groupPath := basePath + "/shop-series-allocations" Register(allocations, doc, groupPath, "GET", "", handler.List, RouteSpec{ Summary: "套餐系列分配列表", Tags: []string{"套餐系列分配"}, Input: new(dto.ShopSeriesAllocationListRequest), Output: new(dto.ShopSeriesAllocationPageResult), Auth: true, }) Register(allocations, doc, groupPath, "POST", "", handler.Create, RouteSpec{ Summary: "创建套餐系列分配", Tags: []string{"套餐系列分配"}, Input: new(dto.CreateShopSeriesAllocationRequest), Output: new(dto.ShopSeriesAllocationResponse), Auth: true, }) Register(allocations, doc, groupPath, "GET", "/:id", handler.Get, RouteSpec{ Summary: "获取套餐系列分配详情", Tags: []string{"套餐系列分配"}, Input: new(dto.IDReq), Output: new(dto.ShopSeriesAllocationResponse), Auth: true, }) Register(allocations, doc, groupPath, "PUT", "/:id", handler.Update, RouteSpec{ Summary: "更新套餐系列分配", Tags: []string{"套餐系列分配"}, Input: new(dto.UpdateShopSeriesAllocationParams), Output: new(dto.ShopSeriesAllocationResponse), Auth: true, }) Register(allocations, doc, groupPath, "DELETE", "/:id", handler.Delete, RouteSpec{ Summary: "删除套餐系列分配", Tags: []string{"套餐系列分配"}, Input: new(dto.IDReq), Output: nil, Auth: true, }) Register(allocations, doc, groupPath, "PUT", "/:id/status", handler.UpdateStatus, RouteSpec{ Summary: "更新套餐系列分配状态", Tags: []string{"套餐系列分配"}, Input: new(dto.UpdateStatusParams), Output: nil, Auth: true, }) Register(allocations, doc, groupPath, "GET", "/:id/tiers", handler.ListTiers, RouteSpec{ Summary: "获取梯度佣金列表", Tags: []string{"套餐系列分配"}, Input: new(dto.IDReq), Output: new(dto.CommissionTierListResult), Auth: true, }) Register(allocations, doc, groupPath, "POST", "/:id/tiers", handler.AddTier, RouteSpec{ Summary: "添加梯度佣金配置", Tags: []string{"套餐系列分配"}, Input: new(dto.CreateCommissionTierParams), Output: new(dto.CommissionTierResponse), Auth: true, }) Register(allocations, doc, groupPath, "PUT", "/:id/tiers/:tier_id", handler.UpdateTier, RouteSpec{ Summary: "更新梯度佣金配置", Tags: []string{"套餐系列分配"}, Input: new(dto.UpdateCommissionTierParams), Output: new(dto.CommissionTierResponse), Auth: true, }) Register(allocations, doc, groupPath, "DELETE", "/:id/tiers/:tier_id", handler.DeleteTier, RouteSpec{ Summary: "删除梯度佣金配置", Tags: []string{"套餐系列分配"}, Input: new(dto.TierIDParams), Output: nil, Auth: true, }) }