Updating
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.IO;
|
||||
using LCU.Library.Internal.FileOperationsModels.Models.NameSettings;
|
||||
using LCU.Library.Internal.FileOperationsModels.Shared;
|
||||
|
||||
namespace LCU.Library.Internal.FileOperationsModels.Models.Requests;
|
||||
|
||||
public class FileDestinationRequest
|
||||
{
|
||||
[Required(ErrorMessage = "Destination path is required.")]
|
||||
public string DestinationPath { get; set; }
|
||||
public DynamicNameSetting DestinationPathSettings { get; set; }
|
||||
public string DestinationName { get; set; } = string.Empty;
|
||||
public bool Overwrite { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string FinalDestinationPath
|
||||
{
|
||||
get
|
||||
{
|
||||
var destinationPath = DestinationPath.EndsWith("\\") ? DestinationPath : $"{DestinationPath}\\";
|
||||
return DynamicNameBuilder.BuildDynamicName(destinationPath, DestinationPathSettings);
|
||||
}
|
||||
}
|
||||
|
||||
[NotMapped]
|
||||
public string Destination => Path.Combine(FinalDestinationPath, DestinationName);
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
using LCU.Library.Internal.FileOperationsModels.Enums;
|
||||
|
||||
namespace LCU.Library.Internal.FileOperationsModels.Models.Requests;
|
||||
|
||||
public class FileSizeRequest : IFileSourceRequest
|
||||
{
|
||||
public FileSourceRequest FileSourceRequest { get; set; } = new();
|
||||
public FileSizeTypes FileSizeType { get; set; }
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.IO;
|
||||
using LCU.Library.Internal.FileOperationsModels.Models.NameSettings;
|
||||
using LCU.Library.Internal.FileOperationsModels.Shared;
|
||||
|
||||
namespace LCU.Library.Internal.FileOperationsModels.Models.Requests;
|
||||
|
||||
public class FileSourceRequest
|
||||
{
|
||||
[Required(ErrorMessage = "Source path is required")]
|
||||
public string SourcePath { get; set; } = string.Empty;
|
||||
public DynamicNameSetting SourcePathSettings { get; set; } = new();
|
||||
|
||||
[Required(ErrorMessage = "Source file is required")]
|
||||
public string SourceFile { get; set; } = string.Empty;
|
||||
|
||||
public DynamicNameSetting SourceFileSettings { get; set; } = new();
|
||||
|
||||
[NotMapped]
|
||||
public string FinalSourceFile => DynamicNameBuilder.BuildDynamicName(SourceFile, SourceFileSettings);
|
||||
|
||||
[NotMapped]
|
||||
public string FinalSourcePath
|
||||
{
|
||||
get
|
||||
{
|
||||
var sourcePath = SourcePath.EndsWith("\\") ? SourcePath : $"{SourcePath}\\";
|
||||
return DynamicNameBuilder.BuildDynamicName(sourcePath, SourcePathSettings);
|
||||
}
|
||||
}
|
||||
|
||||
[NotMapped]
|
||||
public string Source => Path.Combine(FinalSourcePath, FinalSourceFile);
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
namespace LCU.Library.Internal.FileOperationsModels.Models.Requests;
|
||||
|
||||
public interface IFileDestinationRequest
|
||||
{
|
||||
public FileDestinationRequest FileDestinationRequest { get; set; }
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
namespace LCU.Library.Internal.FileOperationsModels.Models.Requests;
|
||||
|
||||
public interface IFileSourceRequest
|
||||
{
|
||||
public FileSourceRequest FileSourceRequest { get; set; }
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
using LCU.Library.Internal.ApiResponse.Models;
|
||||
using LCU.Library.Internal.FileOperationsModels.Enums;
|
||||
using System.ComponentModel;
|
||||
namespace LCU.Library.Internal.FileOperationsModels.Models.Requests;
|
||||
|
||||
public class ValidateFileRequest : ReturnResponse, IFileSourceRequest
|
||||
{
|
||||
public FileSourceRequest FileSourceRequest { get; set; } = new();
|
||||
[DefaultValue(false)]
|
||||
public bool CheckFileCount { get; set; } = false;
|
||||
public int FileCount { get; set; }
|
||||
public OperatorTypes OperatorType { get; set; }
|
||||
public bool FileDoesExist { get; set; }
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
using LCU.Library.Internal.ApiResponse.Models;
|
||||
using LCU.Library.Internal.FileOperationsModels.Enums;
|
||||
|
||||
namespace LCU.Library.Internal.FileOperationsModels.Models.Requests;
|
||||
|
||||
public class ValidateFileSizeInRangeRequest : ReturnResponse, IFileSourceRequest
|
||||
{
|
||||
public FileSourceRequest FileSourceRequest { get; set; } = new();
|
||||
public FileSizeTypes FileSizeType { get; set; }
|
||||
public decimal StartFileSizeRange { get; set; }
|
||||
public decimal EndFileSizeRange { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user