Files
monorepo/LCU.API.Internal.FileOperations/LCU.Library.Internal.FileOperationsModels/Models/BatchParsePdfRequest.cs
T
2026-04-27 10:50:07 -05:00

65 lines
1.3 KiB
C#

using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using LCU.Library.Internal.ApiResponse.Models;
namespace LCU.Library.Internal.FileOperationsModels.Models
{
public class BatchParsePdfRequest : ReturnResponse
{
private string rootPath;
[Required(AllowEmptyStrings = false)]
public string RootPath
{
get
{
return rootPath;
}
set
{
rootPath = string.IsNullOrWhiteSpace(value) || value.EndsWith("\\") ? value : $"{value}\\";
}
}
[Required(AllowEmptyStrings = false)]
public string PdfName { get; set; }
public List<BatchPdf> BatchPdfs { get; set; }
[NotMapped]
public string FullPdfPath
{
get
{
return RootPath + PdfName;
}
}
}
public class BatchPdf
{
private string parsedPdfname;
[Required]
[Range(1, int.MaxValue, ErrorMessage = "PageStart must be larger then 0.")]
public int PageStart { get; set; }
[Required]
[Range(1, int.MaxValue, ErrorMessage = "PageStop must be larger then 0.")]
public int PageStop { get; set; }
public string ParsedPdfname
{
get
{
return parsedPdfname;
}
set
{
parsedPdfname = value.ToLower().EndsWith(".pdf") || string.IsNullOrWhiteSpace(value) ? value : $"{value}.pdf";
}
}
}
}