refactor: 更新 Bootstrap 注册,移除旧分配服务,接入系列授权
Types、Services、Handlers 三个文件同步:删除 ShopSeriesAllocation 和 ShopPackageAllocation 的 Handler/Service 字段及初始化逻辑,注册新的 ShopSeriesGrant Handler 和 Service。 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -42,10 +42,9 @@ func initHandlers(svc *services, deps *Dependencies) *Handlers {
|
|||||||
Package: admin.NewPackageHandler(svc.Package),
|
Package: admin.NewPackageHandler(svc.Package),
|
||||||
PackageUsage: admin.NewPackageUsageHandler(svc.PackageDailyRecord),
|
PackageUsage: admin.NewPackageUsageHandler(svc.PackageDailyRecord),
|
||||||
H5PackageUsage: h5.NewPackageUsageHandler(deps.DB, svc.PackageCustomerView),
|
H5PackageUsage: h5.NewPackageUsageHandler(deps.DB, svc.PackageCustomerView),
|
||||||
ShopSeriesAllocation: admin.NewShopSeriesAllocationHandler(svc.ShopSeriesAllocation),
|
|
||||||
ShopPackageAllocation: admin.NewShopPackageAllocationHandler(svc.ShopPackageAllocation),
|
|
||||||
ShopPackageBatchAllocation: admin.NewShopPackageBatchAllocationHandler(svc.ShopPackageBatchAllocation),
|
ShopPackageBatchAllocation: admin.NewShopPackageBatchAllocationHandler(svc.ShopPackageBatchAllocation),
|
||||||
ShopPackageBatchPricing: admin.NewShopPackageBatchPricingHandler(svc.ShopPackageBatchPricing),
|
ShopPackageBatchPricing: admin.NewShopPackageBatchPricingHandler(svc.ShopPackageBatchPricing),
|
||||||
|
ShopSeriesGrant: admin.NewShopSeriesGrantHandler(svc.ShopSeriesGrant),
|
||||||
AdminOrder: admin.NewOrderHandler(svc.Order, validate),
|
AdminOrder: admin.NewOrderHandler(svc.Order, validate),
|
||||||
H5Order: h5.NewOrderHandler(svc.Order),
|
H5Order: h5.NewOrderHandler(svc.Order),
|
||||||
H5Recharge: h5.NewRechargeHandler(svc.Recharge),
|
H5Recharge: h5.NewRechargeHandler(svc.Recharge),
|
||||||
|
|||||||
@@ -32,10 +32,9 @@ import (
|
|||||||
|
|
||||||
pollingSvc "github.com/break/junhong_cmp_fiber/internal/service/polling"
|
pollingSvc "github.com/break/junhong_cmp_fiber/internal/service/polling"
|
||||||
shopCommissionSvc "github.com/break/junhong_cmp_fiber/internal/service/shop_commission"
|
shopCommissionSvc "github.com/break/junhong_cmp_fiber/internal/service/shop_commission"
|
||||||
shopPackageAllocationSvc "github.com/break/junhong_cmp_fiber/internal/service/shop_package_allocation"
|
|
||||||
shopPackageBatchAllocationSvc "github.com/break/junhong_cmp_fiber/internal/service/shop_package_batch_allocation"
|
shopPackageBatchAllocationSvc "github.com/break/junhong_cmp_fiber/internal/service/shop_package_batch_allocation"
|
||||||
shopPackageBatchPricingSvc "github.com/break/junhong_cmp_fiber/internal/service/shop_package_batch_pricing"
|
shopPackageBatchPricingSvc "github.com/break/junhong_cmp_fiber/internal/service/shop_package_batch_pricing"
|
||||||
shopSeriesAllocationSvc "github.com/break/junhong_cmp_fiber/internal/service/shop_series_allocation"
|
shopSeriesGrantSvc "github.com/break/junhong_cmp_fiber/internal/service/shop_series_grant"
|
||||||
)
|
)
|
||||||
|
|
||||||
type services struct {
|
type services struct {
|
||||||
@@ -65,10 +64,9 @@ type services struct {
|
|||||||
Package *packageSvc.Service
|
Package *packageSvc.Service
|
||||||
PackageDailyRecord *packageSvc.DailyRecordService
|
PackageDailyRecord *packageSvc.DailyRecordService
|
||||||
PackageCustomerView *packageSvc.CustomerViewService
|
PackageCustomerView *packageSvc.CustomerViewService
|
||||||
ShopSeriesAllocation *shopSeriesAllocationSvc.Service
|
|
||||||
ShopPackageAllocation *shopPackageAllocationSvc.Service
|
|
||||||
ShopPackageBatchAllocation *shopPackageBatchAllocationSvc.Service
|
ShopPackageBatchAllocation *shopPackageBatchAllocationSvc.Service
|
||||||
ShopPackageBatchPricing *shopPackageBatchPricingSvc.Service
|
ShopPackageBatchPricing *shopPackageBatchPricingSvc.Service
|
||||||
|
ShopSeriesGrant *shopSeriesGrantSvc.Service
|
||||||
CommissionStats *commissionStatsSvc.Service
|
CommissionStats *commissionStatsSvc.Service
|
||||||
PurchaseValidation *purchaseValidationSvc.Service
|
PurchaseValidation *purchaseValidationSvc.Service
|
||||||
Order *orderSvc.Service
|
Order *orderSvc.Service
|
||||||
@@ -134,10 +132,9 @@ func initServices(s *stores, deps *Dependencies) *services {
|
|||||||
Package: packageSvc.New(s.Package, s.PackageSeries, s.ShopPackageAllocation, s.ShopSeriesAllocation),
|
Package: packageSvc.New(s.Package, s.PackageSeries, s.ShopPackageAllocation, s.ShopSeriesAllocation),
|
||||||
PackageDailyRecord: packageSvc.NewDailyRecordService(deps.DB, deps.Redis, s.PackageUsageDailyRecord, deps.Logger),
|
PackageDailyRecord: packageSvc.NewDailyRecordService(deps.DB, deps.Redis, s.PackageUsageDailyRecord, deps.Logger),
|
||||||
PackageCustomerView: packageSvc.NewCustomerViewService(deps.DB, deps.Redis, s.PackageUsage, deps.Logger),
|
PackageCustomerView: packageSvc.NewCustomerViewService(deps.DB, deps.Redis, s.PackageUsage, deps.Logger),
|
||||||
ShopSeriesAllocation: shopSeriesAllocationSvc.New(s.ShopSeriesAllocation, s.ShopPackageAllocation, s.Shop, s.PackageSeries),
|
|
||||||
ShopPackageAllocation: shopPackageAllocationSvc.New(s.ShopPackageAllocation, s.ShopSeriesAllocation, s.ShopPackageAllocationPriceHistory, s.Shop, s.Package, s.PackageSeries),
|
|
||||||
ShopPackageBatchAllocation: shopPackageBatchAllocationSvc.New(deps.DB, s.Package, s.ShopPackageAllocation, s.ShopSeriesAllocation, s.Shop),
|
ShopPackageBatchAllocation: shopPackageBatchAllocationSvc.New(deps.DB, s.Package, s.ShopPackageAllocation, s.ShopSeriesAllocation, s.Shop),
|
||||||
ShopPackageBatchPricing: shopPackageBatchPricingSvc.New(deps.DB, s.ShopPackageAllocation, s.ShopPackageAllocationPriceHistory, s.Shop),
|
ShopPackageBatchPricing: shopPackageBatchPricingSvc.New(deps.DB, s.ShopPackageAllocation, s.ShopPackageAllocationPriceHistory, s.Shop),
|
||||||
|
ShopSeriesGrant: shopSeriesGrantSvc.New(deps.DB, s.ShopSeriesAllocation, s.ShopPackageAllocation, s.ShopPackageAllocationPriceHistory, s.Shop, s.Package, s.PackageSeries, deps.Logger),
|
||||||
CommissionStats: commissionStatsSvc.New(s.ShopSeriesCommissionStats),
|
CommissionStats: commissionStatsSvc.New(s.ShopSeriesCommissionStats),
|
||||||
PurchaseValidation: purchaseValidation,
|
PurchaseValidation: purchaseValidation,
|
||||||
Order: orderSvc.New(deps.DB, deps.Redis, s.Order, s.OrderItem, s.AgentWallet, s.CardWallet, purchaseValidation, s.ShopPackageAllocation, s.ShopSeriesAllocation, s.IotCard, s.Device, s.PackageSeries, s.PackageUsage, s.Package, deps.WechatPayment, deps.QueueClient, deps.Logger),
|
Order: orderSvc.New(deps.DB, deps.Redis, s.Order, s.OrderItem, s.AgentWallet, s.CardWallet, purchaseValidation, s.ShopPackageAllocation, s.ShopSeriesAllocation, s.IotCard, s.Device, s.PackageSeries, s.PackageUsage, s.Package, deps.WechatPayment, deps.QueueClient, deps.Logger),
|
||||||
|
|||||||
@@ -40,10 +40,9 @@ type Handlers struct {
|
|||||||
Package *admin.PackageHandler
|
Package *admin.PackageHandler
|
||||||
PackageUsage *admin.PackageUsageHandler
|
PackageUsage *admin.PackageUsageHandler
|
||||||
H5PackageUsage *h5.PackageUsageHandler
|
H5PackageUsage *h5.PackageUsageHandler
|
||||||
ShopSeriesAllocation *admin.ShopSeriesAllocationHandler
|
|
||||||
ShopPackageAllocation *admin.ShopPackageAllocationHandler
|
|
||||||
ShopPackageBatchAllocation *admin.ShopPackageBatchAllocationHandler
|
ShopPackageBatchAllocation *admin.ShopPackageBatchAllocationHandler
|
||||||
ShopPackageBatchPricing *admin.ShopPackageBatchPricingHandler
|
ShopPackageBatchPricing *admin.ShopPackageBatchPricingHandler
|
||||||
|
ShopSeriesGrant *admin.ShopSeriesGrantHandler
|
||||||
AdminOrder *admin.OrderHandler
|
AdminOrder *admin.OrderHandler
|
||||||
H5Order *h5.OrderHandler
|
H5Order *h5.OrderHandler
|
||||||
H5Recharge *h5.RechargeHandler
|
H5Recharge *h5.RechargeHandler
|
||||||
|
|||||||
Reference in New Issue
Block a user