新增 Account、Department 和 Role 類別
This commit is contained in:
parent
4406a06970
commit
171a60089b
28
Models/Entities/Account.cs
Normal file
28
Models/Entities/Account.cs
Normal file
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Models/Entities/Department.cs
Normal file
12
Models/Entities/Department.cs
Normal file
@ -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<Account> Accounts { get; set; } = new HashSet<Account>();
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Models/Entities/Role.cs
Normal file
12
Models/Entities/Role.cs
Normal file
@ -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<Account> Accounts { get; set; } = new HashSet<Account>();
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user