=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -14,6 +14,7 @@ namespace adas_core.Application.Services;
|
||||
/// <summary>
|
||||
/// Provides a concrete implementation of the <see cref="IFileService"/> contract for performing file-related operations.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=52eb70b -->
|
||||
public class FileService : IFileService
|
||||
{
|
||||
private readonly string? _assetsDirectory;
|
||||
@@ -47,6 +48,7 @@ public class FileService : IFileService
|
||||
/// </summary>
|
||||
/// <param name="files">The collection of uploaded form files to be written to the update directory.</param>
|
||||
/// <returns>A task that resolves to true when every file is successfully copied, or false when the update directory is not configured.</returns>
|
||||
/// <!-- aidoc:v1 sig=8b3261f body=f4c95cd -->
|
||||
public async Task<bool> CopyUpdateFiles(ICollection<IFormFile> files)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(_updateDirectory)) return false;
|
||||
@@ -66,6 +68,7 @@ public class FileService : IFileService
|
||||
/// <param name="files">The collection of uploaded form files to persist to the assets directory.</param>
|
||||
/// <param name="themeParse">The asset theme used to determine the subdirectory in which the files will be stored.</param>
|
||||
/// <returns>A task that resolves to <c>true</c> when the files are successfully written, or <c>false</c> when the assets directory path is not configured.</returns>
|
||||
/// <!-- aidoc:v1 sig=6ee9410 body=8680e5a -->
|
||||
public async Task<bool> UploadAssetFiles(ICollection<IFormFile> files, FileEnum.AssetTheme themeParse)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(_assetsDirectory)) return false;
|
||||
@@ -87,6 +90,7 @@ public class FileService : IFileService
|
||||
/// </summary>
|
||||
/// <param name="themeParse">The theme used to locate the corresponding subdirectory within the assets directory.</param>
|
||||
/// <returns>A list of <see cref="AssetDto"/> objects containing the name, extension, and full path of each file found; an empty list if the assets directory is not configured or an error occurs.</returns>
|
||||
/// <!-- aidoc:v1 sig=0de5997 body=8f16929 -->
|
||||
public List<AssetDto> GetAllAssetFile(FileEnum.AssetTheme themeParse)
|
||||
{
|
||||
try
|
||||
@@ -125,6 +129,7 @@ public class FileService : IFileService
|
||||
/// </summary>
|
||||
/// <param name="directoryPath">The path of the directory to search for files.</param>
|
||||
/// <returns>A list of file paths found in the directory, or an empty list if the directory does not exist or an error occurs.</returns>
|
||||
/// <!-- aidoc:v1 sig=c3be2b5 body=d2272c4 -->
|
||||
public List<string> GetFilesInDirectory(string directoryPath)
|
||||
{
|
||||
List<string> fileList = [];
|
||||
|
||||
Reference in New Issue
Block a user