refactor: remove Gorse integration and implement HotRank feature
- Removed Gorse-related configurations, handlers, and dependencies from the codebase. - Introduced HotRank feature with configuration options for ranking posts based on recent activity. - Updated application structure to support HotRank processing, including new caching mechanisms and database interactions. - Cleaned up related DTOs and repository methods to reflect the removal of Gorse and the addition of HotRank functionality.
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"carrot_bbs/internal/config"
|
||||
"carrot_bbs/internal/grpc/runner"
|
||||
"carrot_bbs/internal/pkg/email"
|
||||
"carrot_bbs/internal/pkg/gorse"
|
||||
"carrot_bbs/internal/pkg/hook"
|
||||
"carrot_bbs/internal/pkg/openai"
|
||||
"carrot_bbs/internal/pkg/redis"
|
||||
@@ -53,6 +52,7 @@ var ServiceSet = wire.NewSet(
|
||||
ProvideAdminGroupService,
|
||||
ProvideAdminDashboardService,
|
||||
ProvideQRCodeLoginService,
|
||||
ProvideHotRankWorker,
|
||||
|
||||
// 日志服务
|
||||
ProvideAsyncLogManager,
|
||||
@@ -106,7 +106,6 @@ func ProvideSystemMessageService(
|
||||
func ProvidePostService(
|
||||
postRepo *repository.PostRepository,
|
||||
systemMessageService service.SystemMessageService,
|
||||
gorseClient gorse.Client,
|
||||
postAIService *service.PostAIService,
|
||||
cacheBackend cache.Cache,
|
||||
txManager repository.TransactionManager,
|
||||
@@ -114,19 +113,18 @@ func ProvidePostService(
|
||||
_ *hook.ModerationHooks,
|
||||
_ *hook.BuiltinHooks,
|
||||
) service.PostService {
|
||||
return service.NewPostService(postRepo, systemMessageService, gorseClient, postAIService, cacheBackend, txManager, hookManager)
|
||||
return service.NewPostService(postRepo, systemMessageService, postAIService, cacheBackend, txManager, hookManager)
|
||||
}
|
||||
|
||||
func ProvideCommentService(
|
||||
commentRepo *repository.CommentRepository,
|
||||
postRepo *repository.PostRepository,
|
||||
systemMessageService service.SystemMessageService,
|
||||
gorseClient gorse.Client,
|
||||
postAIService *service.PostAIService,
|
||||
cacheBackend cache.Cache,
|
||||
hookManager *hook.Manager,
|
||||
) *service.CommentService {
|
||||
return service.NewCommentService(commentRepo, postRepo, systemMessageService, gorseClient, postAIService, cacheBackend, hookManager)
|
||||
return service.NewCommentService(commentRepo, postRepo, systemMessageService, postAIService, cacheBackend, hookManager)
|
||||
}
|
||||
|
||||
// ProvideMessageService 提供消息服务
|
||||
@@ -349,6 +347,10 @@ func ProvideLogService(
|
||||
}
|
||||
|
||||
// ProvideQRCodeLoginService 提供二维码登录服务
|
||||
func ProvideHotRankWorker(cfg *config.Config, postRepo *repository.PostRepository, cacheBackend cache.Cache) *service.HotRankWorker {
|
||||
return service.NewHotRankWorker(cfg, postRepo, cacheBackend)
|
||||
}
|
||||
|
||||
func ProvideQRCodeLoginService(
|
||||
redisClient *redis.Client,
|
||||
sseHub *sse.Hub,
|
||||
|
||||
Reference in New Issue
Block a user