67 lines
2.0 KiB
C#
67 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace SolarPower.Models
|
|
{
|
|
/// <summary>
|
|
/// 基礎BaseModel
|
|
/// </summary>
|
|
public class MyBaseModel
|
|
{
|
|
public int Id { get; set; } //編號
|
|
}
|
|
|
|
public class Created
|
|
{
|
|
private string createdAt;
|
|
|
|
public int CreatedBy { get; set; } //創建者
|
|
public string CreatedAt { get { return Convert.ToDateTime(createdAt).ToString("yyyy-MM-dd HH:mm:ss"); } set { createdAt = value; } } //創建時間
|
|
}
|
|
|
|
public class Updated : MyBaseModel
|
|
{
|
|
private string updatedAt;
|
|
public int UpdatedBy { get; set; } //修改者
|
|
public string UpdatedAt { get { return Convert.ToDateTime(updatedAt).ToString("yyyy-MM-dd HH:mm:ss"); } set { updatedAt = value; } } //修改時間
|
|
}
|
|
|
|
/// <summary>
|
|
/// 當前登入的使用者基本資訊
|
|
/// </summary>
|
|
public class MyUser
|
|
{
|
|
public int Id { get; set; } //編號
|
|
public byte Status { get; set; } //狀態
|
|
public string Name { get; set; } //姓名
|
|
public byte IsGod { get; set; } //神級使用者
|
|
public int CompanyId { get; set; } //公司編號
|
|
public int RoleId { get; set; } //角色編號
|
|
public string Email { get; set; }
|
|
public MyCompany Company { get; set; } //公司資訊
|
|
public MyRole Role { get; set; } //角色資訊
|
|
}
|
|
|
|
/// <summary>
|
|
/// 當前登入使用者的公司資訊
|
|
/// </summary>
|
|
public class MyCompany
|
|
{
|
|
public int Id { get; set; }
|
|
public byte Status { get; set; } //狀態
|
|
public string Name { get; set; } //名稱
|
|
public string Logo { get; set; }
|
|
}
|
|
|
|
//當前登入使用者的角色權限
|
|
public class MyRole
|
|
{
|
|
public int Id { get; set; }
|
|
public string Name { get; set; } //名稱
|
|
public byte Layer { get; set; } //角色層級
|
|
public List<string> Auths { get; set; } //可操作頁面
|
|
}
|
|
}
|