refactor: update repository interfaces and improve dependency injection
- Refactored repository structures to use interfaces instead of concrete types, enhancing flexibility and testability. - Updated various repository methods to accept interfaces, allowing for better dependency management. - Modified wire generation to accommodate new repository interfaces, ensuring proper service injection throughout the application. - Enhanced handler methods to utilize DTOs for filtering and data handling, improving code clarity and maintainability.
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
package wire
|
||||
|
||||
import (
|
||||
"carrot_bbs/internal/cache"
|
||||
"carrot_bbs/internal/handler"
|
||||
"carrot_bbs/internal/pkg/sse"
|
||||
"carrot_bbs/internal/repository"
|
||||
"carrot_bbs/internal/service"
|
||||
|
||||
"github.com/google/wire"
|
||||
@@ -101,10 +99,8 @@ func ProvideMessageHandler(
|
||||
// ProvideSystemMessageHandler 提供系统消息处理器
|
||||
func ProvideSystemMessageHandler(
|
||||
systemMsgService service.SystemMessageService,
|
||||
systemNotificationRepo *repository.SystemNotificationRepository,
|
||||
cacheBackend cache.Cache,
|
||||
) *handler.SystemMessageHandler {
|
||||
return handler.NewSystemMessageHandler(systemMsgService, systemNotificationRepo, cacheBackend)
|
||||
return handler.NewSystemMessageHandler(systemMsgService)
|
||||
}
|
||||
|
||||
// ProvideGroupHandler 提供群组处理器
|
||||
|
||||
Reference in New Issue
Block a user