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