Updating
This commit is contained in:
+63
@@ -0,0 +1,63 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
namespace LCU.Library.Internal.FileOperationsModels.Models.HtmlToPdfModels;
|
||||
|
||||
public class HtmlToPdfRequest
|
||||
{
|
||||
[Required(AllowEmptyStrings = false)]
|
||||
public string HtmlTemplateFilePath { get; set; }
|
||||
[Required]
|
||||
[RegularExpression(@"^[^\.]+$", ErrorMessage = "File extensions are not allowed.")]
|
||||
public string PdfName { get; set; }
|
||||
public bool KeepHtmlFile { get; set; } = false;
|
||||
public bool KeepPdfFile { get; set; } = false;
|
||||
[Required(AllowEmptyStrings = false)]
|
||||
public string HtmlSaveFilePath { get; set; }
|
||||
[Required(AllowEmptyStrings = false)]
|
||||
public string PdfSaveFilePath { get; set; }
|
||||
public List<TagValue> BodyTagValues { get; set; }
|
||||
public List<ValueCollection> BodyValueCollections { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string FinalHtmlSaveFilePath
|
||||
{
|
||||
get
|
||||
{
|
||||
var finalHtmlSavePath = HtmlSaveFilePath.EndsWith("\\") ?
|
||||
HtmlSaveFilePath :
|
||||
$"{HtmlSaveFilePath}\\";
|
||||
return finalHtmlSavePath;
|
||||
}
|
||||
}
|
||||
|
||||
[NotMapped]
|
||||
public string FinalPdfSaveFilePath
|
||||
{
|
||||
get
|
||||
{
|
||||
var finalPdfSaveFilePath = PdfSaveFilePath.EndsWith("\\") ?
|
||||
PdfSaveFilePath :
|
||||
$"{PdfSaveFilePath}\\";
|
||||
return finalPdfSaveFilePath;
|
||||
}
|
||||
}
|
||||
|
||||
[NotMapped]
|
||||
public string FinalHtmlSaveFilePathWithFile
|
||||
{
|
||||
get
|
||||
{
|
||||
return $"{FinalHtmlSaveFilePath}{PdfName}.html";
|
||||
}
|
||||
}
|
||||
|
||||
[NotMapped]
|
||||
public string FinalPdfSaveFilePathWithFile
|
||||
{
|
||||
get
|
||||
{
|
||||
return $"{FinalPdfSaveFilePath}{PdfName}.pdf";
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace LCU.Library.Internal.FileOperationsModels.Models.HtmlToPdfModels;
|
||||
|
||||
public class TagValue
|
||||
{
|
||||
[Required(AllowEmptyStrings = false)]
|
||||
public string Tag { get; set; }
|
||||
[Required(AllowEmptyStrings = false)]
|
||||
public string Value { get; set; }
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace LCU.Library.Internal.FileOperationsModels.Models.HtmlToPdfModels;
|
||||
|
||||
public class ValueCollection
|
||||
{
|
||||
[Required(AllowEmptyStrings = false)]
|
||||
public string CollectionTag { get; set; }
|
||||
[Required(AllowEmptyStrings = false)]
|
||||
public string CollectionHtmlTemplateFilePath { get; set; }
|
||||
public List<ValueCollectionItem> ValueCollectionItems { get; set; }
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
namespace LCU.Library.Internal.FileOperationsModels.Models.HtmlToPdfModels;
|
||||
|
||||
public class ValueCollectionItem
|
||||
{
|
||||
public List<TagValue> TagValues { get; set; }
|
||||
public List<ValueCollection> ValueCollections { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user