解决合并后出现的问题,为swagger提供禁用选项,暂时移除wiki
This commit is contained in:
@@ -22,6 +22,7 @@ type Container struct {
|
||||
Redis *redis.Client
|
||||
Logger *zap.Logger
|
||||
JWT *auth.JWTService
|
||||
Casbin *auth.CasbinService
|
||||
Storage *storage.StorageClient
|
||||
CacheManager *database.CacheManager
|
||||
|
||||
@@ -30,7 +31,6 @@ type Container struct {
|
||||
ProfileRepo repository.ProfileRepository
|
||||
TextureRepo repository.TextureRepository
|
||||
ClientRepo repository.ClientRepository
|
||||
ConfigRepo repository.SystemConfigRepository
|
||||
YggdrasilRepo repository.YggdrasilRepository
|
||||
|
||||
// Service层
|
||||
@@ -40,7 +40,6 @@ type Container struct {
|
||||
TokenService service.TokenService
|
||||
YggdrasilService service.YggdrasilService
|
||||
VerificationService service.VerificationService
|
||||
UploadService service.UploadService
|
||||
SecurityService service.SecurityService
|
||||
CaptchaService service.CaptchaService
|
||||
SignatureService *service.SignatureService
|
||||
@@ -52,6 +51,7 @@ func NewContainer(
|
||||
redisClient *redis.Client,
|
||||
logger *zap.Logger,
|
||||
jwtService *auth.JWTService,
|
||||
casbinService *auth.CasbinService,
|
||||
storageClient *storage.StorageClient,
|
||||
emailService interface{}, // 接受 email.Service 但使用 interface{} 避免循环依赖
|
||||
) *Container {
|
||||
@@ -75,6 +75,7 @@ func NewContainer(
|
||||
Redis: redisClient,
|
||||
Logger: logger,
|
||||
JWT: jwtService,
|
||||
Casbin: casbinService,
|
||||
Storage: storageClient,
|
||||
CacheManager: cacheManager,
|
||||
}
|
||||
@@ -84,7 +85,6 @@ func NewContainer(
|
||||
c.ProfileRepo = repository.NewProfileRepository(db)
|
||||
c.TextureRepo = repository.NewTextureRepository(db)
|
||||
c.ClientRepo = repository.NewClientRepository(db)
|
||||
c.ConfigRepo = repository.NewSystemConfigRepository(db)
|
||||
c.YggdrasilRepo = repository.NewYggdrasilRepository(db)
|
||||
|
||||
// 初始化SignatureService(作为依赖注入,避免在容器中创建并立即调用)
|
||||
@@ -92,7 +92,7 @@ func NewContainer(
|
||||
c.SignatureService = service.NewSignatureService(c.ProfileRepo, redisClient, logger)
|
||||
|
||||
// 初始化Service(注入缓存管理器)
|
||||
c.UserService = service.NewUserService(c.UserRepo, c.ConfigRepo, jwtService, redisClient, cacheManager, logger)
|
||||
c.UserService = service.NewUserService(c.UserRepo, jwtService, redisClient, cacheManager, storageClient, logger)
|
||||
c.ProfileService = service.NewProfileService(c.ProfileRepo, c.UserRepo, cacheManager, logger)
|
||||
c.TextureService = service.NewTextureService(c.TextureRepo, c.UserRepo, storageClient, cacheManager, logger)
|
||||
|
||||
@@ -125,7 +125,6 @@ func NewContainer(
|
||||
|
||||
// 初始化其他服务
|
||||
c.SecurityService = service.NewSecurityService(redisClient)
|
||||
c.UploadService = service.NewUploadService(storageClient)
|
||||
c.CaptchaService = service.NewCaptchaService(redisClient, logger)
|
||||
|
||||
// 初始化VerificationService(需要email.Service)
|
||||
@@ -206,13 +205,6 @@ func WithTextureRepo(repo repository.TextureRepository) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// WithConfigRepo 设置系统配置仓储
|
||||
func WithConfigRepo(repo repository.SystemConfigRepository) Option {
|
||||
return func(c *Container) {
|
||||
c.ConfigRepo = repo
|
||||
}
|
||||
}
|
||||
|
||||
// WithUserService 设置用户服务
|
||||
func WithUserService(svc service.UserService) Option {
|
||||
return func(c *Container) {
|
||||
@@ -262,13 +254,6 @@ func WithVerificationService(svc service.VerificationService) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// WithUploadService 设置上传服务
|
||||
func WithUploadService(svc service.UploadService) Option {
|
||||
return func(c *Container) {
|
||||
c.UploadService = svc
|
||||
}
|
||||
}
|
||||
|
||||
// WithSecurityService 设置安全服务
|
||||
func WithSecurityService(svc service.SecurityService) Option {
|
||||
return func(c *Container) {
|
||||
|
||||
Reference in New Issue
Block a user