From 171a60089bc2608f046ff2dd539a415acfca3231 Mon Sep 17 00:00:00 2001 From: Chunyi Date: Fri, 26 Sep 2025 16:26:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20Account=E3=80=81Department?= =?UTF-8?q?=20=E5=92=8C=20Role=20=E9=A1=9E=E5=88=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Models/Entities/Account.cs | 28 ++++++++++++++++++++++++++++ Models/Entities/Department.cs | 12 ++++++++++++ Models/Entities/Role.cs | 12 ++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 Models/Entities/Account.cs create mode 100644 Models/Entities/Department.cs create mode 100644 Models/Entities/Role.cs diff --git a/Models/Entities/Account.cs b/Models/Entities/Account.cs new file mode 100644 index 0000000..0ff2417 --- /dev/null +++ b/Models/Entities/Account.cs @@ -0,0 +1,28 @@ +using System; + +namespace Models.Entities +{ + public class Account : BaseEntity + { + public int AccountId { get; set; } + + public string Name { get; set; } = string.Empty; + public string Username { get; set; } = string.Empty; + public string Password { get; set; } = string.Empty; + public string Email { get; set; } = string.Empty; + + public int DepartmentId { get; set; } + public int RoleId { get; set; } + public AccountStatus Status { get; set; } + + public virtual Department? Department { get; set; } + public virtual Role? Role { get; set; } + } + + public enum AccountStatus + { + Enabled, + Disabled, + Unverified + } +} \ No newline at end of file diff --git a/Models/Entities/Department.cs b/Models/Entities/Department.cs new file mode 100644 index 0000000..a7cd806 --- /dev/null +++ b/Models/Entities/Department.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; + +namespace Models.Entities +{ + public class Department + { + public int DepartmentId { get; set; } + public string DepartmentName { get; set; } = string.Empty; + + public virtual ICollection Accounts { get; set; } = new HashSet(); + } +} \ No newline at end of file diff --git a/Models/Entities/Role.cs b/Models/Entities/Role.cs new file mode 100644 index 0000000..30267ec --- /dev/null +++ b/Models/Entities/Role.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; + +namespace Models.Entities +{ + public class Role + { + public int RoleId { get; set; } + public string RoleName { get; set; } = string.Empty; + + public virtual ICollection Accounts { get; set; } = new HashSet(); + } +} \ No newline at end of file