新增用户角色相关表定义和初始化表相关方法。
This commit is contained in:
parent
91e487b0ed
commit
8cf7880575
18
Falcon.SugarApi/FalconClaim/Tables/FalconClaim_Role.cs
Normal file
18
Falcon.SugarApi/FalconClaim/Tables/FalconClaim_Role.cs
Normal 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; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -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; }
|
||||||
|
}
|
||||||
|
}
|
21
Falcon.SugarApi/FalconClaim/Tables/SugarDbContextExtend.cs
Normal file
21
Falcon.SugarApi/FalconClaim/Tables/SugarDbContextExtend.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user