Add FileCleanupWorker for automatic expiration of chat files with configurable retention period and batch processing. Files uploaded via `/api/v1/uploads/files` are tracked in `uploaded_files` table with expiration timestamps, then deleted from S3 and database upon expiry. Expired file URLs are injected as `"expired": true` in message responses. Extend JPush push notification configuration with vendor-specific channel_id support (xiaomi, huawei, oppo, vivo, meizu, honor, fcm) for differentiating system vs chat notifications. Add iOS APNs thread-id grouping configuration for notification categorization.
73 lines
2.1 KiB
Go
73 lines
2.1 KiB
Go
package wire
|
||
|
||
import (
|
||
"with_you/internal/cache"
|
||
"with_you/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.NewGroupJoinRequestRepository,
|
||
repository.NewStickerRepository,
|
||
repository.NewVoteRepository,
|
||
repository.NewChannelRepository,
|
||
repository.NewScheduleRepository,
|
||
repository.NewGradeRepository,
|
||
repository.NewExamRepository,
|
||
repository.NewEmptyClassroomRepository,
|
||
repository.NewMaterialSubjectRepository,
|
||
repository.NewMaterialFileRepository,
|
||
repository.NewCallRepository,
|
||
repository.NewReportRepository,
|
||
ProvideUserActivityRepository,
|
||
|
||
// 日志相关仓储
|
||
repository.NewOperationLogRepository,
|
||
repository.NewLoginLogRepository,
|
||
repository.NewDataChangeLogRepository,
|
||
|
||
// 身份认证相关仓储
|
||
repository.NewVerificationRepository,
|
||
|
||
// 敏感词相关仓储
|
||
repository.NewSensitiveWordRepository,
|
||
|
||
// 用户资料审核相关仓储
|
||
repository.NewUserProfileAuditRepository,
|
||
|
||
// 帖子内链引用关系
|
||
repository.NewPostRefRepository,
|
||
|
||
// 二手交易相关
|
||
repository.NewTradeRepository,
|
||
|
||
// 版本日志同步
|
||
repository.NewConversationVersionLogRepository,
|
||
|
||
// 文件上传记录(聊天文件 TTL 过期清理)
|
||
repository.NewUploadedFileRepository,
|
||
)
|
||
|
||
// 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 可以自动处理
|