refactor: update repository interfaces and improve dependency injection
All checks were successful
Build Backend / build (push) Successful in 12m45s
Build Backend / build-docker (push) Successful in 2m40s

- 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:
lafay
2026-03-26 18:14:16 +08:00
parent 7b41dfeb00
commit c6848aba06
50 changed files with 1034 additions and 663 deletions

View File

@@ -19,6 +19,7 @@ var RepositorySet = wire.NewSet(
repository.NewDeviceTokenRepository,
repository.NewSystemNotificationRepository,
repository.NewGroupRepository,
repository.NewGroupJoinRequestRepository,
repository.NewStickerRepository,
repository.NewVoteRepository,
repository.NewChannelRepository,
@@ -34,7 +35,7 @@ var RepositorySet = wire.NewSet(
)
// ProvideUserActivityRepository 提供用户活跃数据仓储
func ProvideUserActivityRepository(db *gorm.DB, cache cache.Cache) *repository.UserActivityRepository {
func ProvideUserActivityRepository(db *gorm.DB, cache cache.Cache) repository.UserActivityRepository {
return repository.NewUserActivityRepository(db, cache)
}