42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace IM_API.Models;
|
|
|
|
[Table("roles")]
|
|
[MySqlCharSet("utf8mb4")]
|
|
[MySqlCollation("utf8mb4_general_ci")]
|
|
public partial class Role
|
|
{
|
|
[Key]
|
|
[Column("ID", TypeName = "int(11)")]
|
|
public int Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// 角色名称
|
|
/// </summary>
|
|
[StringLength(20)]
|
|
public string Name { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// 角色描述
|
|
/// </summary>
|
|
[Column(TypeName = "text")]
|
|
public string Description { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// 创建时间
|
|
/// </summary>
|
|
[Column(TypeName = "datetime")]
|
|
public DateTime Created { get; set; }
|
|
|
|
[InverseProperty("Role")]
|
|
public virtual ICollection<Admin> Admins { get; set; } = new List<Admin>();
|
|
|
|
[InverseProperty("RoleldNavigation")]
|
|
public virtual ICollection<Permissionarole> Permissionaroles { get; set; } = new List<Permissionarole>();
|
|
}
|