This commit is contained in:
2026-06-19 12:53:33 +08:00
parent 69d6377bc6
commit b9819b913b
19 changed files with 1243 additions and 5 deletions

View File

@@ -85,6 +85,7 @@ type ServiceContext struct {
ExampleModel model.ExampleModel
GlobalNotificationsModel model.GlobalNotificationsModel
AuthorizationDocumentModel model.AuthorizationDocumentModel
QueryWhitelistOpLogModel model.QueryWhitelistOpLogModel
// 服务
AlipayService *service.AliPayService
@@ -100,6 +101,7 @@ type ServiceContext struct {
AdminPromotionLinkStatsService *service.AdminPromotionLinkStatsService
ImageService *service.ImageService
AuthorizationService *service.AuthorizationService
TianyuanapiClient *tianyuanapi.Client
}
// NewServiceContext 创建服务上下文
@@ -175,6 +177,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
exampleModel := model.NewExampleModel(db, cacheConf)
globalNotificationsModel := model.NewGlobalNotificationsModel(db, cacheConf)
authorizationDocumentModel := model.NewAuthorizationDocumentModel(db, cacheConf)
queryWhitelistOpLogModel := model.NewQueryWhitelistOpLogModel(db, cacheConf)
// ============================== 第三方服务初始化 ==============================
tianyuanapi, err := tianyuanapi.NewClient(tianyuanapi.Config{
@@ -287,6 +290,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
ExampleModel: exampleModel,
GlobalNotificationsModel: globalNotificationsModel,
AuthorizationDocumentModel: authorizationDocumentModel,
QueryWhitelistOpLogModel: queryWhitelistOpLogModel,
// 服务
AlipayService: alipayService,
@@ -302,6 +306,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
AdminPromotionLinkStatsService: adminPromotionLinkStatsService,
ImageService: imageService,
AuthorizationService: authorizationService,
TianyuanapiClient: tianyuanapi,
}
}