新增用户角色相关表定义和初始化表相关方法。

This commit is contained in:
falcon 2023-01-30 15:55:07 +08:00
parent 91e487b0ed
commit 8cf7880575
3 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,18 @@
namespace Falcon.SugarApi.FalconClaim.Tables
{
/// <summary>
/// 角色定义
/// </summary>
public class FalconClaim_Roles
{
/// <summary>
/// 角色名称
/// </summary>
public string RoleName { get; set; }
/// <summary>
/// 角色说明
/// </summary>
public string RoleDescription { get; set; }
}
}

View File

@ -0,0 +1,17 @@
namespace Falcon.SugarApi.FalconClaim.Tables
{
/// <summary>
/// 用户角色对应关系
/// </summary>
public class FalconClaim_UserInRoles
{
/// <summary>
/// 用户主键
/// </summary>
public string UserKey { get; set; }
/// <summary>
/// 角色名
/// </summary>
public string RoleName { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using Falcon.SugarApi.DatabaseDefinitions;
namespace Falcon.SugarApi.FalconClaim.Tables
{
/// <summary>
/// 数据库扩展方法
/// </summary>
public static class SugarDbContextExtend
{
/// <summary>
/// 初始化FalconClaim角色相关表
/// </summary>
/// <param name="dbContext">数据库上下文</param>
/// <returns>数据库上下文</returns>
public static SugarDbContext InitFalconClaimRoleDbTables(this SugarDbContext dbContext) {
dbContext.CodeFirst.InitTables<FalconClaim_Roles>();
dbContext.CodeFirst.InitTables<FalconClaim_UserInRoles>();
return dbContext;
}
}
}