feat(upload): integrate upload service for chat image validation and S3 uploads
- Added UploadService to handle image uploads and validation for chat messages. - Updated ChatService and MessageService to utilize UploadService for validating image segments in messages. - Enhanced wire generation to inject UploadService into relevant services. - Introduced UploadImageBytes method in UploadService for uploading images directly from memory. - Added TrustedPublicURLPrefix method in S3 Client for generating public URLs for uploaded images.
This commit is contained in:
@@ -133,8 +133,9 @@ func ProvideMessageService(
|
||||
db *gorm.DB,
|
||||
messageRepo *repository.MessageRepository,
|
||||
cacheBackend cache.Cache,
|
||||
uploadService *service.UploadService,
|
||||
) *service.MessageService {
|
||||
return service.NewMessageService(db, messageRepo, cacheBackend)
|
||||
return service.NewMessageService(db, messageRepo, cacheBackend, uploadService)
|
||||
}
|
||||
|
||||
// ProvideNotificationService 提供通知服务
|
||||
@@ -185,8 +186,9 @@ func ProvideChatService(
|
||||
userRepo *repository.UserRepository,
|
||||
sseHub *sse.Hub,
|
||||
cacheBackend cache.Cache,
|
||||
uploadService *service.UploadService,
|
||||
) service.ChatService {
|
||||
return service.NewChatService(db, messageRepo, userRepo, nil, sseHub, cacheBackend)
|
||||
return service.NewChatService(db, messageRepo, userRepo, nil, sseHub, cacheBackend, uploadService)
|
||||
}
|
||||
|
||||
// ProvideScheduleService 提供日程服务
|
||||
|
||||
Reference in New Issue
Block a user