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 registerShopPackageAllocationRoutes(router fiber.Router, handler *admin.ShopPackageAllocationHandler, doc *openapi.Generator, basePath string) { allocations := router.Group("/shop-package-allocations") groupPath := basePath + "/shop-package-allocations" Register(allocations, doc, groupPath, "GET", "", handler.List, RouteSpec{ Summary: "单套餐分配列表", Tags: []string{"单套餐分配"}, Input: new(dto.ShopPackageAllocationListRequest), Output: new(dto.ShopPackageAllocationPageResult), Auth: true, }) Register(allocations, doc, groupPath, "POST", "", handler.Create, RouteSpec{ Summary: "创建单套餐分配", Tags: []string{"单套餐分配"}, Input: new(dto.CreateShopPackageAllocationRequest), Output: new(dto.ShopPackageAllocationResponse), Auth: true, }) Register(allocations, doc, groupPath, "GET", "/:id", handler.Get, RouteSpec{ Summary: "获取单套餐分配详情", Tags: []string{"单套餐分配"}, Input: new(dto.IDReq), Output: new(dto.ShopPackageAllocationResponse), Auth: true, }) Register(allocations, doc, groupPath, "PUT", "/:id", handler.Update, RouteSpec{ Summary: "更新单套餐分配", Tags: []string{"单套餐分配"}, Input: new(dto.UpdateShopPackageAllocationParams), Output: new(dto.ShopPackageAllocationResponse), 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, "PUT", "/:id/cost-price", handler.UpdateCostPrice, RouteSpec{ Summary: "更新单套餐分配成本价", Tags: []string{"单套餐分配"}, Input: new(dto.IDReq), Output: new(dto.ShopPackageAllocationResponse), Auth: true, }) }