refactor FileUploadService to simplify category folder naming

This commit is contained in:
2026-01-27 16:24:34 +03:30
parent 8622f12f12
commit 9596c8f8b6

View File

@@ -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"
};
}
}