This commit is contained in:
2025-12-31 16:54:17 +08:00
parent 4a48add783
commit a30d77845d
12 changed files with 688 additions and 20 deletions

View File

@@ -74,6 +74,7 @@ type ServiceContext struct {
AlipayService *service.AliPayService
WechatPayService *service.WechatPayService
ApplePayService *service.ApplePayService
EasyPayService *service.EasyPayService
ApiRequestService *service.ApiRequestService
AsynqServer *asynq.Server
AsynqService *service.AsynqService
@@ -181,6 +182,15 @@ func NewServiceContext(c config.Config) *ServiceContext {
} else {
logx.Info("Apple支付服务已禁用")
}
// 根据配置决定是否初始化易支付服务
var easyPayService *service.EasyPayService
if c.EasyPay.Enabled {
easyPayService = service.NewEasyPayService(c)
logx.Info("易支付服务已启用")
} else {
logx.Info("易支付服务已禁用")
}
apiRequestService := service.NewApiRequestService(c, featureModel, productFeatureModel, tianyuanapi)
verificationService := service.NewVerificationService(c, tianyuanapi, apiRequestService)
asynqService := service.NewAsynqService(c)
@@ -261,6 +271,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
AlipayService: alipayService,
WechatPayService: wechatPayService,
ApplePayService: applePayService,
EasyPayService: easyPayService,
ApiRequestService: apiRequestService,
AsynqServer: asynqServer,
AsynqService: asynqService,