detect/detect.gui/Models/Entities/UserEntity.cs

45 lines
1.3 KiB
C#
Raw Normal View History

2024-11-13 17:09:15 +08:00
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
2024-11-14 17:11:43 +08:00
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_user")]
2024-11-13 17:09:15 +08:00
[Index(nameof(Username), IsUnique = true)]
public class UserEntity
{
2024-11-14 17:11:43 +08:00
[Key]
[JsonProperty(PropertyName = "id")]
[Column("id")]
public long? Id { get; set; }
2024-11-13 17:09:15 +08:00
[NotMapped] public List<AuthorityEntity>? AuthorityList { get; set; }
2024-11-14 17:11:43 +08:00
[StringLength(255), Comment("姓名")]
[JsonProperty(PropertyName = "realName")]
[Column("real_name")]
public string? RealName { get; set; }
2024-11-13 17:09:15 +08:00
2024-11-14 17:11:43 +08:00
[StringLength(255), 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 = "password")]
[Column("password")]
public string? Password { 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
2024-11-14 17:11:43 +08:00
[Comment("更新时间")]
[JsonProperty(PropertyName = "updateTime")]
[Column("update_time")]
public DateTime? UpdateTime { get; set; }
2024-11-13 17:09:15 +08:00
}