From 769f6b8709c589fb1e31d8fad9c89f6aa57bd095 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 4 Mar 2026 11:36:39 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E6=80=BB=E7=BA=BF=E5=92=8C=20OpenAPI=20=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit admin.go 删除 registerShopSeriesAllocationRoutes、registerShopPackageAllocationRoutes 两处调用,注册 registerShopSeriesGrantRoutes。OpenAPI handlers.go 同步移除旧 Handler 引用,注册 ShopSeriesGrant Handler 供文档生成器使用。 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- internal/routes/admin.go | 9 +++------ pkg/openapi/handlers.go | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/internal/routes/admin.go b/internal/routes/admin.go index c911220..f832bb8 100644 --- a/internal/routes/admin.go +++ b/internal/routes/admin.go @@ -77,18 +77,15 @@ func RegisterAdminRoutes(router fiber.Router, handlers *bootstrap.Handlers, midd if handlers.PackageUsage != nil { registerPackageUsageRoutes(authGroup, handlers.PackageUsage, doc, basePath) } - if handlers.ShopSeriesAllocation != nil { - registerShopSeriesAllocationRoutes(authGroup, handlers.ShopSeriesAllocation, doc, basePath) - } - if handlers.ShopPackageAllocation != nil { - registerShopPackageAllocationRoutes(authGroup, handlers.ShopPackageAllocation, doc, basePath) - } if handlers.ShopPackageBatchAllocation != nil { registerShopPackageBatchAllocationRoutes(authGroup, handlers.ShopPackageBatchAllocation, doc, basePath) } if handlers.ShopPackageBatchPricing != nil { registerShopPackageBatchPricingRoutes(authGroup, handlers.ShopPackageBatchPricing, doc, basePath) } + if handlers.ShopSeriesGrant != nil { + registerShopSeriesGrantRoutes(authGroup, handlers.ShopSeriesGrant, doc, basePath) + } if handlers.AdminOrder != nil { registerAdminOrderRoutes(authGroup, handlers.AdminOrder, doc, basePath) } diff --git a/pkg/openapi/handlers.go b/pkg/openapi/handlers.go index 1d45044..5a4d8c1 100644 --- a/pkg/openapi/handlers.go +++ b/pkg/openapi/handlers.go @@ -39,10 +39,9 @@ func BuildDocHandlers() *bootstrap.Handlers { Package: admin.NewPackageHandler(nil), PackageUsage: admin.NewPackageUsageHandler(nil), H5PackageUsage: h5.NewPackageUsageHandler(nil, nil), - ShopSeriesAllocation: admin.NewShopSeriesAllocationHandler(nil), - ShopPackageAllocation: admin.NewShopPackageAllocationHandler(nil), ShopPackageBatchAllocation: admin.NewShopPackageBatchAllocationHandler(nil), ShopPackageBatchPricing: admin.NewShopPackageBatchPricingHandler(nil), + ShopSeriesGrant: admin.NewShopSeriesGrantHandler(nil), AdminOrder: admin.NewOrderHandler(nil, nil), H5Order: h5.NewOrderHandler(nil), H5Recharge: h5.NewRechargeHandler(nil),