using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace Blahblah.FlowerStory.Server.Data.Model;
///
/// 记录对象
///
[Table("records")]
public class RecordItem
{
///
/// 自增 id,主键
///
[Column("rid")]
[Key]
[Required]
public int Id { get; set; }
///
/// 关联人 uid
///
[Column("uid")]
[Required]
public int OwnerId { get; set; }
///
/// 事件类型
///
[Column("eid")]
[Required]
public int EventId { get; set; }
///
/// 操作时间
///
[Column("date")]
[Required]
[JsonPropertyName("date")]
public long DateUnixTime { get; set; }
///
/// 操作人 uid
///
[Column("byuid")]
public int? ByUserId { get; set; }
///
/// 操作人名称
///
[Column("byname")]
public string? ByUserName { get; set; }
///
/// 事件关联照片
///
[Column("photo")]
public byte[]? Photo { get; set; }
///
/// 备注
///
[Column("memo")]
public string? Memo { get; set; }
///
/// 操作时间
///
[NotMapped]
[JsonIgnore]
public DateTimeOffset Date => DateTimeOffset.FromUnixTimeMilliseconds(DateUnixTime);
}