- 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.
46 lines
1.4 KiB
Go
46 lines
1.4 KiB
Go
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 可以自动处理
|