This commit is contained in:
2026-01-14 16:37:52 +08:00
parent e4665b9f6e
commit 857d592ee7
17 changed files with 313 additions and 162 deletions

View File

@@ -1,12 +1,12 @@
package svc
import (
"time"
"bdqr-server/app/main/api/internal/config"
"bdqr-server/app/main/api/internal/middleware"
"bdqr-server/app/main/api/internal/service"
tianyuanapi "bdqr-server/app/main/api/internal/service/tianyuanapi_sdk"
"bdqr-server/app/main/model"
"time"
"github.com/hibiken/asynq"
"github.com/zeromicro/go-zero/core/logx"
@@ -90,6 +90,7 @@ type ServiceContext struct {
DictService *service.DictService
ImageService *service.ImageService
AuthorizationService *service.AuthorizationService
TencentCloudService *service.TencentCloudService
}
// NewServiceContext 创建服务上下文
@@ -170,7 +171,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
// ============================== 业务服务初始化 ==============================
alipayService := service.NewAliPayService(c)
wechatPayService := service.NewWechatPayService(c, userAuthModel, service.InitTypeWxPayPubKey)
wechatPayService := service.NewWechatPayService(c, userAuthModel, service.InitTypeWxPayPubKeyPure)
applePayService := service.NewApplePayService(c)
apiRequestService := service.NewApiRequestService(c, featureModel, productFeatureModel, tianyuanapi)
verificationService := service.NewVerificationService(c, tianyuanapi, apiRequestService)
@@ -183,7 +184,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
dictService := service.NewDictService(adminDictTypeModel, adminDictDataModel)
imageService := service.NewImageService()
authorizationService := service.NewAuthorizationService(c, authorizationDocumentModel)
tencentCloudService := service.NewTencentCloudService(c)
// ============================== 异步任务服务 ==============================
asynqServer := asynq.NewServer(
asynq.RedisClientOpt{Addr: c.CacheRedis[0].Host, Password: c.CacheRedis[0].Pass},
@@ -270,6 +271,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
DictService: dictService,
ImageService: imageService,
AuthorizationService: authorizationService,
TencentCloudService: tencentCloudService,
}
}