generated from VLADIMIR/template
clear
This commit is contained in:
@@ -8,13 +8,16 @@ import (
|
||||
|
||||
type FileService struct {
|
||||
fileStorage file_storage.IFileStorage
|
||||
stringTools string_tools.IStringTools
|
||||
}
|
||||
|
||||
func NewFileService(
|
||||
fileStorage file_storage.IFileStorage,
|
||||
stringTools string_tools.IStringTools,
|
||||
) *FileService {
|
||||
return &FileService{
|
||||
fileStorage: fileStorage,
|
||||
stringTools: stringTools,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +25,7 @@ func (s *FileService) UploadFile(
|
||||
ctx context.Context,
|
||||
file *file_storage.File,
|
||||
) (string, error) {
|
||||
file.Name = string_tools.Transliterate(file.Name)
|
||||
file.Name = s.stringTools.Transliterate(file.Name)
|
||||
if err := s.fileStorage.Put(ctx, file); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user