Files
backend/internal/wire/repository.go
lafay fc0d6ff19d
All checks were successful
Build Backend / build (push) Successful in 19m14s
Build Backend / build-docker (push) Successful in 1m28s
feat(channel): integrate channel functionality into post management
- Added Channel support in Post model, including ChannelID field in PostRequest and PostResponse DTOs.
- Updated PostService and PostRepository to handle channel-specific logic for creating and listing posts.
- Introduced ChannelRepository and ChannelService, along with corresponding handlers for managing channels.
- Enhanced router to include routes for channel management and public channel listing.
- Seeded default channels in the database during initialization.
2026-03-24 22:27:53 +08:00

44 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,
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 可以自动处理