detect/detect.gui/Models/Entities/LogEntity.cs

44 lines
1.2 KiB
C#
Raw Permalink Normal View History

2024-11-13 17:09:15 +08:00
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
2024-11-14 17:11:43 +08:00
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Newtonsoft.Json;
2024-11-13 17:09:15 +08:00
namespace detect.gui.Models.Entities;
2024-11-14 17:11:43 +08:00
[Table("dat_log")]
2024-11-13 17:09:15 +08:00
[Index(nameof(UserId), IsUnique = false)]
[Index(nameof(CreateTime), IsUnique = false)]
public class LogEntity
{
2024-11-14 17:11:43 +08:00
[JsonProperty(PropertyName = "id")]
[Column("id")]
[Key]
public long? Id { get; set; }
2024-11-13 17:09:15 +08:00
2024-11-14 17:11:43 +08:00
[JsonProperty(PropertyName = "description")]
[Column("description")]
[StringLength(255), Comment("描述")]
public string? Description { get; set; }
2024-11-13 17:09:15 +08:00
2024-11-14 17:11:43 +08:00
[JsonProperty(PropertyName = "userId")]
[Column("user_id")]
[Comment("操作人ID")]
public long? UserId { get; set; }
2024-11-13 17:09:15 +08:00
2024-11-14 17:11:43 +08:00
[StringLength(20), Comment("操作人")]
[JsonProperty(PropertyName = "username")]
[Column("username")]
public string? Username { get; set; }
2024-11-13 17:09:15 +08:00
2024-11-14 17:11:43 +08:00
[StringLength(255), Comment("说明")]
[JsonProperty(PropertyName = "remark")]
[Column("remark")]
public string? Remark { get; set; }
2024-11-13 17:09:15 +08:00
2024-11-14 17:11:43 +08:00
[Comment("创建时间")]
[JsonProperty(PropertyName = "createTime")]
[Column("create_time")]
public DateTime? CreateTime { get; set; }
2024-11-13 17:09:15 +08:00
}