using SqlSugar;
using System.ComponentModel.DataAnnotations;
namespace DMS.Infrastructure.Entities
{
///
/// 邮件消息数据库实体
///
[SugarTable("email_messages")]
public class DbEmailMessage
{
///
/// 邮件ID
///
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
///
/// 关联的邮件账户ID
///
public int EmailAccountId { get; set; }
///
/// 发件人邮箱地址
///
[SugarColumn(Length = 255)]
public string From { get; set; }
///
/// 收件人邮箱地址(多个用分号分隔)
///
[SugarColumn(Length = 1000)]
public string To { get; set; }
///
/// 抄送邮箱地址(多个用分号分隔)
///
[SugarColumn(Length = 1000, IsNullable = true)]
public string? Cc { get; set; }
///
/// 密送邮箱地址(多个用分号分隔)
///
[SugarColumn(Length = 1000, IsNullable = true)]
public string? Bcc { get; set; }
///
/// 邮件主题
///
[SugarColumn(Length = 500)]
public string Subject { get; set; }
///
/// 邮件正文
///
[SugarColumn(Length = 4000)]
public string Body { get; set; }
///
/// 是否为HTML格式
///
public bool IsHtml { get; set; } = true;
///
/// 邮件发送状态
///
[SugarColumn(Length = 20)]
public string Status { get; set; } = "Pending";
///
/// 发送时间
///
[SugarColumn(IsNullable = true)]
public DateTime? SentAt { get; set; }
///
/// 创建时间
///
public DateTime CreatedAt { get; set; } = DateTime.Now;
///
/// 更新时间
///
public DateTime UpdatedAt { get; set; } = DateTime.Now;
}
}