refactor FileUploadService to simplify category folder naming
This commit is contained in:
@@ -95,7 +95,7 @@ public class FileUploadService : IFileUploadService
|
||||
await _fileRepository.SaveChangesAsync();
|
||||
|
||||
// آپلود فایل به استوریج
|
||||
var categoryFolder = GetCategoryFolderName(category);
|
||||
var categoryFolder = category.ToString();
|
||||
var uploadResult = await _fileStorageService.UploadAsync(
|
||||
fileStream,
|
||||
uploadedFile.UniqueFileName,
|
||||
@@ -227,21 +227,5 @@ public class FileUploadService : IFileUploadService
|
||||
|
||||
return FileType.Document;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// دریافت نام پوشه بر اساس دستهبندی
|
||||
/// </summary>
|
||||
private string GetCategoryFolderName(FileCategory category)
|
||||
{
|
||||
return category switch
|
||||
{
|
||||
FileCategory.TaskChatMessage => "TaskChatMessage",
|
||||
FileCategory.TaskAttachment => "TaskAttachment",
|
||||
FileCategory.ProjectDocument => "ProjectDocument",
|
||||
FileCategory.UserProfilePhoto => "UserProfilePhoto",
|
||||
FileCategory.Report => "Report",
|
||||
_ => "Other"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user