using System.ComponentModel.DataAnnotations; using Microsoft.AspNetCore.Http; namespace YD_Event.Application.Certificate.Dtos; /// /// 更新DOC模板输入 /// public class UpdateDocTemplateInput { /// /// 模板ID /// [Required(ErrorMessage = "模板ID不能为空")] public long Id { get; set; } /// /// 版本号 /// [Required(ErrorMessage = "版本号不能为空")] public int Version { get; set; } /// /// DOC模板文件(可选) /// public IFormFile TemplateFile { get; set; } /// /// 像素宽度 /// [Required(ErrorMessage = "宽度不能为空")] [Range(100, 5000, ErrorMessage = "宽度必须在100-5000像素之间")] public int Width { get; set; } /// /// 像素高度 /// [Required(ErrorMessage = "高度不能为空")] [Range(100, 5000, ErrorMessage = "高度必须在100-5000像素之间")] public int Height { get; set; } /// /// 是否当前激活版本 /// public bool IsActive { get; set; } } /// /// 证书模板上传结果 /// public class CertificateTemplateUploadResult { /// /// 模板ID /// public long TemplateId { get; set; } /// /// 模板文件URL /// public string TemplateUrl { get; set; } /// /// 检测到的占位符列表 /// public List DetectedPlaceholders { get; set; } = new(); /// /// 总占位符数量 /// public int TotalPlaceholders { get; set; } /// /// 有效占位符数量 /// public int ValidPlaceholders { get; set; } } /// /// 检测占位符输入 /// public class DetectPlaceholdersInput { /// /// DOC模板文件 /// [Required(ErrorMessage = "请选择DOC模板文件")] public IFormFile TemplateFile { get; set; } } /// /// 保存占位符配置输入 /// public class SavePlaceholdersInput { /// /// 模板ID /// [Required(ErrorMessage = "模板ID不能为空")] public long TemplateId { get; set; } /// /// 占位符列表 /// [Required(ErrorMessage = "占位符列表不能为空")] public List Placeholders { get; set; } } /// /// 占位符输入 /// public class PlaceholderInput { /// /// 占位符键名 /// [Required(ErrorMessage = "占位符键名不能为空")] [StringLength(50, ErrorMessage = "占位符键名长度不能超过50个字符")] public string PlaceholderKey { get; set; } /// /// 显示名称 /// [Required(ErrorMessage = "显示名称不能为空")] [StringLength(100, ErrorMessage = "显示名称长度不能超过100个字符")] public string DisplayName { get; set; } /// /// 占位符类型 /// [Required(ErrorMessage = "占位符类型不能为空")] public string PlaceholderType { get; set; } /// /// 默认值 /// public string DefaultValue { get; set; } /// /// 是否必填 /// public bool IsRequired { get; set; } /// /// 验证规则 /// public string ValidationRule { get; set; } /// /// 描述 /// public string Description { get; set; } /// /// 排序 /// public int Sort { get; set; } } /// /// 占位符输出 /// public class PlaceholderOutput { /// /// ID /// public long Id { get; set; } /// /// 模板ID /// public long TemplateId { get; set; } /// /// 占位符键名 /// public string PlaceholderKey { get; set; } /// /// 显示名称 /// public string DisplayName { get; set; } /// /// 占位符类型 /// public string PlaceholderType { get; set; } /// /// 默认值 /// public string DefaultValue { get; set; } /// /// 是否必填 /// public bool IsRequired { get; set; } /// /// 验证规则 /// public string ValidationRule { get; set; } /// /// 描述 /// public string Description { get; set; } /// /// 排序 /// public int Sort { get; set; } } /// /// 检测到的占位符输出 /// public class DetectedPlaceholderOutput { /// /// 占位符键名 /// public string PlaceholderKey { get; set; } /// /// 占位符类型 /// public string PlaceholderType { get; set; } /// /// 是否有效 /// public bool IsValid { get; set; } /// /// 验证消息 /// public string ValidationMessage { get; set; } /// /// 建议的显示名称 /// public string SuggestedDisplayName { get; set; } } /// /// 占位符检测结果 /// public class PlaceholderDetectionResult { /// /// 检测到的占位符列表 /// public List Placeholders { get; set; } = new(); /// /// 总数 /// public int TotalCount => Placeholders.Count; /// /// 有效数量 /// public int ValidCount { get; set; } /// /// 无效数量 /// public int InvalidCount { get; set; } } /// /// 证书模板输出 /// public class CertificateTemplateOutput { /// /// ID /// public long Id { get; set; } /// /// 版本号 /// public int Version { get; set; } /// /// 模板类型 /// public string TemplateType { get; set; } /// /// DOC模板URL /// public string DocxTemplateUrl { get; set; } /// /// 是否当前激活版本 /// public bool IsActive { get; set; } /// /// 状态 /// public AvailabilityStatus Status { get; set; } /// /// 创建时间 /// public DateTime CreatedTime { get; set; } /// /// 占位符列表 /// public List Placeholders { get; set; } = new(); } /// /// 证书模板简单输出(用于发放证书时的模板选择) /// public class CertificateTemplateSimpleOutput { /// /// 模板ID /// public long Id { get; set; } /// /// 模板类型 /// public string TemplateType { get; set; } /// /// 版本号 /// public int Version { get; set; } /// /// 宽度 /// public int Width { get; set; } /// /// 高度 /// public int Height { get; set; } /// /// 是否激活 /// public bool IsActive { get; set; } /// /// 创建时间 /// public DateTime CreatedTime { get; set; } /// /// 显示名称 /// public string DisplayName => $"模板 {Id} (v{Version}) - {TemplateType}"; }