You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
91 lines
2.3 KiB
C#
91 lines
2.3 KiB
C#
using System.Dynamic;
|
|
|
|
namespace DS.WMS.Core.Op.Entity
|
|
{
|
|
/// <summary>
|
|
/// 邮件模板模型
|
|
/// </summary>
|
|
public class MailTemplateModel
|
|
{
|
|
/// <summary>
|
|
/// 业务ID
|
|
/// </summary>
|
|
public long BusinessId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 业务ID
|
|
/// </summary>
|
|
public BusinessType BusinessType { get; set; } = BusinessType.OceanShippingExport;
|
|
|
|
/// <summary>
|
|
/// 发送附件
|
|
/// </summary>
|
|
public List<FileAttachment>? FileAttachments { get; set; }
|
|
|
|
/// <summary>
|
|
/// 主要数据项
|
|
/// </summary>
|
|
public dynamic Primary { get; set; } = new ExpandoObject();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 文件附件
|
|
/// </summary>
|
|
public class FileAttachment
|
|
{
|
|
/// <summary>
|
|
/// 文件物理路径
|
|
/// </summary>
|
|
public string FilePath { get; set; }
|
|
|
|
/// <summary>
|
|
/// 附件显示的名称(为空时显示原始文件名)
|
|
/// </summary>
|
|
public string? DisplayName { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 邮件模板模型
|
|
/// </summary>
|
|
/// <typeparam name="T">数据类型</typeparam>
|
|
public class MailTemplateModel<T> : MailTemplateModel
|
|
{
|
|
/// <summary>
|
|
/// 主要数据项
|
|
/// </summary>
|
|
public new T Primary { get; internal set; }
|
|
|
|
/// <summary>
|
|
/// 初始化
|
|
/// </summary>
|
|
/// <param name="primary">主数据</param>
|
|
public MailTemplateModel(T primary)
|
|
{
|
|
Primary = primary;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 邮件模板模型
|
|
/// </summary>
|
|
/// <typeparam name="T1">主要数据类型</typeparam>
|
|
/// <typeparam name="T2">次要数据类型</typeparam>
|
|
public class MailTemplateModel<T1, T2> : MailTemplateModel<T1>
|
|
{
|
|
/// <summary>
|
|
/// 次要数据项
|
|
/// </summary>
|
|
public T2 Secondary { get; internal set; }
|
|
|
|
/// <summary>
|
|
/// 初始化
|
|
/// </summary>
|
|
/// <param name="primary">主数据</param>
|
|
/// <param name="secondary">主数据</param>
|
|
public MailTemplateModel(T1 primary, T2 secondary) : base(primary)
|
|
{
|
|
Secondary = secondary;
|
|
}
|
|
}
|
|
}
|