using System; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Avalonia.Collections; using Microsoft.EntityFrameworkCore; using Newtonsoft.Json; namespace detect.gui.Models.Entities; [Table("Authority")] [Index(nameof(Name), IsUnique = true)] [Index(nameof(ParentId), IsUnique = false)] public class AuthorityEntity { [Key] public long? Id { get; set; } [StringLength(255), Comment("名称")] public string? Name { get; set; } [DefaultValue(0)] public long? ParentId { get; set; } [Comment("创建时间")] public DateTime? CreateTime { get; set; } [Comment("更新时间")] public DateTime? UpdateTime { get; set; } [NotMapped] [JsonIgnore] public AvaloniaList? Children { get; set; } }