This commit is contained in:
2026-01-16 03:33:02 +08:00
parent 3090cd62c8
commit 23ad0477b2
16 changed files with 1943 additions and 56 deletions

View File

@@ -41,6 +41,7 @@ type ServiceContext struct {
QueryCleanupLogModel model.QueryCleanupLogModel
QueryCleanupDetailModel model.QueryCleanupDetailModel
QueryCleanupConfigModel model.QueryCleanupConfigModel
YunyinSignPayOrderModel model.YunyinSignPayOrderModel
// 代理相关模型(新系统)
AgentModel model.AgentModel
@@ -75,6 +76,7 @@ type ServiceContext struct {
WechatPayService *service.WechatPayService
ApplePayService *service.ApplePayService
EasyPayService *service.EasyPayService
YunYinSignPayService *service.YunYinSignPayService
ApiRequestService *service.ApiRequestService
AsynqServer *asynq.Server
AsynqService *service.AsynqService
@@ -116,6 +118,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
queryCleanupLogModel := model.NewQueryCleanupLogModel(db, cacheConf)
queryCleanupDetailModel := model.NewQueryCleanupDetailModel(db, cacheConf)
queryCleanupConfigModel := model.NewQueryCleanupConfigModel(db, cacheConf)
yunyinSignPayOrderModel := model.NewYunyinSignPayOrderModel(db, cacheConf)
// ============================== 代理相关模型(新系统) ==============================
agentModel := model.NewAgentModel(db, cacheConf)
@@ -191,6 +194,16 @@ func NewServiceContext(c config.Config) *ServiceContext {
} else {
logx.Info("易支付服务已禁用")
}
// 根据配置决定是否初始化云印签支付服务
var yunYinSignPayService *service.YunYinSignPayService
if c.YunYinSignPay.Enabled {
yunYinSignPayService = service.NewYunYinSignPayService(c, redisClient)
logx.Info("云印签支付服务已启用")
} else {
logx.Info("云印签支付服务已禁用")
}
apiRequestService := service.NewApiRequestService(c, featureModel, productFeatureModel, tianyuanapi)
verificationService := service.NewVerificationService(c, tianyuanapi, apiRequestService)
asynqService := service.NewAsynqService(c)
@@ -238,6 +251,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
QueryCleanupLogModel: queryCleanupLogModel,
QueryCleanupDetailModel: queryCleanupDetailModel,
QueryCleanupConfigModel: queryCleanupConfigModel,
YunyinSignPayOrderModel: yunyinSignPayOrderModel,
// 代理相关模型(简化版 - 移除团队关系、返佣、升级、提现、实名认证、邀请码)
AgentModel: agentModel,
@@ -272,6 +286,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
WechatPayService: wechatPayService,
ApplePayService: applePayService,
EasyPayService: easyPayService,
YunYinSignPayService: yunYinSignPayService,
ApiRequestService: apiRequestService,
AsynqServer: asynqServer,
AsynqService: asynqService,