using SqlSugar;
namespace MyHomePage.Api.Models.Entities;
/// 同步日志:每次增删改都写一条,前端通过 since=timestamp 拉取增量
[SugarTable("sync_log")]
public class SyncLog
{
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
/// 实体类型:category | bookmark | search_engine | setting
[SugarColumn(Length = 32, IsNullable = false, IndexGroupNameList = new[] { "idx_synclog_type" })]
public string EntityType { get; set; } = string.Empty;
/// 实体 ID
[SugarColumn(IsNullable = false, IndexGroupNameList = new[] { "idx_synclog_type" })]
public int EntityId { get; set; }
/// 操作:create | update | delete
[SugarColumn(Length = 16, IsNullable = false)]
public string Operation { get; set; } = "update";
/// 变更时间(UTC)
[SugarColumn(IsNullable = false)]
public DateTime Timestamp { get; set; } = DateTime.UtcNow;
}