Files
backend/internal/wire/repository.go
lafay 0ef8e5a7e1
Some checks failed
Build Backend / build (push) Failing after 12m1s
Build Backend / build-docker (push) Has been skipped
feat(material): add material handling and routing functionality
- Introduced MaterialHandler for managing learning materials and subjects.
- Updated router to include routes for public and admin material management.
- Enhanced database initialization with material subject and file models.
- Implemented seeding logic for material subjects and files.
- Updated wire generation to include MaterialHandler and related services.
2026-03-25 20:44:12 +08:00

46 lines
1.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package wire
import (
"carrot_bbs/internal/cache"
"carrot_bbs/internal/repository"
"github.com/google/wire"
"gorm.io/gorm"
)
// RepositorySet Repository 层 Provider Set
var RepositorySet = wire.NewSet(
repository.NewUserRepository,
repository.NewPostRepository,
repository.NewCommentRepository,
repository.NewMessageRepository,
repository.NewNotificationRepository,
repository.NewPushRecordRepository,
repository.NewDeviceTokenRepository,
repository.NewSystemNotificationRepository,
repository.NewGroupRepository,
repository.NewStickerRepository,
repository.NewVoteRepository,
repository.NewChannelRepository,
repository.NewScheduleRepository,
repository.NewMaterialSubjectRepository,
repository.NewMaterialFileRepository,
ProvideUserActivityRepository,
// 日志相关仓储
repository.NewOperationLogRepository,
repository.NewLoginLogRepository,
repository.NewDataChangeLogRepository,
)
// ProvideUserActivityRepository 提供用户活跃数据仓储
func ProvideUserActivityRepository(db *gorm.DB, cache cache.Cache) *repository.UserActivityRepository {
return repository.NewUserActivityRepository(db, cache)
}
// Note: 以下 Repository 返回接口类型而非指针,需要单独处理
// - ScheduleRepository (repository.ScheduleRepository)
// - StickerRepository (repository.StickerRepository)
// - GroupRepository (repository.GroupRepository)
// 这些已经在各自的 New* 函数中正确返回接口类型Wire 可以自动处理