fix 价格

This commit is contained in:
2025-12-26 14:43:22 +08:00
parent 9a578b4dc3
commit 55ab2e8018
11 changed files with 97 additions and 85 deletions

View File

@@ -21,9 +21,9 @@ type ServiceContext struct {
Redis *redis.Redis
// 中间件
AuthInterceptor rest.Middleware
UserAuthInterceptor rest.Middleware
AdminAuthInterceptor rest.Middleware
AuthInterceptor rest.Middleware
UserAuthInterceptor rest.Middleware
AdminAuthInterceptor rest.Middleware
// 用户相关模型
UserModel model.UserModel
@@ -80,8 +80,8 @@ type ServiceContext struct {
AdminPromotionOrderModel model.AdminPromotionOrderModel
// 其他模型
ExampleModel model.ExampleModel
GlobalNotificationsModel model.GlobalNotificationsModel
ExampleModel model.ExampleModel
GlobalNotificationsModel model.GlobalNotificationsModel
AuthorizationDocumentModel model.AuthorizationDocumentModel
// 服务
@@ -98,7 +98,6 @@ type ServiceContext struct {
AdminPromotionLinkStatsService *service.AdminPromotionLinkStatsService
ImageService *service.ImageService
AuthorizationService *service.AuthorizationService
}
// NewServiceContext 创建服务上下文
@@ -173,7 +172,6 @@ func NewServiceContext(c config.Config) *ServiceContext {
globalNotificationsModel := model.NewGlobalNotificationsModel(db, cacheConf)
authorizationDocumentModel := model.NewAuthorizationDocumentModel(db, cacheConf)
// ============================== 第三方服务初始化 ==============================
tianyuanapi, err := tianyuanapi.NewClient(tianyuanapi.Config{
AccessID: c.Tianyuanapi.AccessID,
@@ -220,9 +218,9 @@ func NewServiceContext(c config.Config) *ServiceContext {
return &ServiceContext{
Config: c,
Redis: redisClient,
AuthInterceptor: middleware.NewAuthInterceptorMiddleware(c).Handle,
UserAuthInterceptor: middleware.NewUserAuthInterceptorMiddleware().Handle,
AdminAuthInterceptor: middleware.NewAdminAuthInterceptorMiddleware(c,
AuthInterceptor: middleware.NewAuthInterceptorMiddleware(c).Handle,
UserAuthInterceptor: middleware.NewUserAuthInterceptorMiddleware().Handle,
AdminAuthInterceptor: middleware.NewAdminAuthInterceptorMiddleware(c,
adminUserModel, adminUserRoleModel, adminRoleModel, adminApiModel, adminRoleApiModel).Handle,
// 用户相关模型
@@ -280,8 +278,8 @@ func NewServiceContext(c config.Config) *ServiceContext {
AdminPromotionOrderModel: adminPromotionOrderModel,
// 其他模型
ExampleModel: exampleModel,
GlobalNotificationsModel: globalNotificationsModel,
ExampleModel: exampleModel,
GlobalNotificationsModel: globalNotificationsModel,
AuthorizationDocumentModel: authorizationDocumentModel,
// 服务
@@ -298,7 +296,6 @@ func NewServiceContext(c config.Config) *ServiceContext {
AdminPromotionLinkStatsService: adminPromotionLinkStatsService,
ImageService: imageService,
AuthorizationService: authorizationService,
}
}