using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Newtonsoft.Json;

namespace detect.gui.Models.Entities;

[Table("dat_log")]
[Index(nameof(UserId), IsUnique = false)]
[Index(nameof(CreateTime), IsUnique = false)]
public class LogEntity
{
    [JsonProperty(PropertyName = "id")]
    [Column("id")]
    [Key]
    public long? Id { get; set; }

    [JsonProperty(PropertyName = "description")]
    [Column("description")]
    [StringLength(255), Comment("描述")]
    public string? Description { get; set; }

    [JsonProperty(PropertyName = "userId")]
    [Column("user_id")]
    [Comment("操作人ID")]
    public long? UserId { get; set; }

    [StringLength(20), Comment("操作人")]
    [JsonProperty(PropertyName = "username")]
    [Column("username")]
    public string? Username { get; set; }

    [StringLength(255), Comment("说明")]
    [JsonProperty(PropertyName = "remark")]
    [Column("remark")]
    public string? Remark { get; set; }

    [Comment("创建时间")]
    [JsonProperty(PropertyName = "createTime")]
    [Column("create_time")]
    public DateTime? CreateTime { get; set; }
}