新增 Account、Department 和 Role 類別

This commit is contained in:
Chen, Chun-Yi 2025-09-26 16:26:58 +08:00
parent 4406a06970
commit 171a60089b
3 changed files with 52 additions and 0 deletions

View 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
}
}

View 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
View 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>();
}
}