using System.Collections.ObjectModel; using System.Dynamic; namespace DS.WMS.Core.Op.Entity { /// /// 邮件模板模型 /// public class MailTemplateModel { /// /// 业务ID /// public long BusinessId { get; set; } /// /// 业务ID /// public BusinessType BusinessType { get; set; } = BusinessType.OceanShippingExport; /// /// 发送附件 /// public List? FileAttachments { get; set; } /// /// 发件人 /// public MailSender Sender { get; set; } /// /// 收件人 /// public List Receivers { get; set; } /// /// 当前业务联系人 /// public string Contacts => Receivers == null ? string.Empty : string.Join(",", Receivers.Select(x => x.DisplayName)); /// /// 主要数据项 /// public dynamic Primary { get; set; } = new ExpandoObject(); } public class MailSender { /// /// 显示名称 /// public string DisplayName { get; set; } /// /// 邮件地址 /// public string MailAddress { get; set; } /// /// 个人签名内容 /// public string? SignatureHtml { get; set; } } public class MailReceiver { /// /// 显示名称 /// public string DisplayName { get; set; } /// /// 邮件地址 /// public string MailAddress { get; set; } } /// /// 文件附件 /// public class FileAttachment { /// /// 文件物理路径 /// public string FilePath { get; set; } /// /// 附件显示的名称(为空时显示原始文件名) /// public string? DisplayName { get; set; } } /// /// 邮件模板模型 /// /// 数据类型 public class MailTemplateModel : MailTemplateModel { /// /// 主要数据项 /// public new T Primary { get; internal set; } /// /// 初始化 /// /// 主数据 public MailTemplateModel(T primary) { Primary = primary; } } /// /// 邮件模板模型 /// /// 主要数据类型 /// 次要数据类型 public class MailTemplateModel : MailTemplateModel { /// /// 次要数据项 /// public T2 Secondary { get; internal set; } /// /// 初始化 /// /// 主数据 /// 主数据 public MailTemplateModel(T1 primary, T2 secondary) : base(primary) { Secondary = secondary; } } }