mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-18 09:44:28 +08:00
完成用户/角色分配资源
This commit is contained in:
@@ -12,6 +12,7 @@ namespace OpenAuth.App
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class ResourceApp:BaseApp<Resource>
|
public class ResourceApp:BaseApp<Resource>
|
||||||
{
|
{
|
||||||
|
public RevelanceManagerApp RevelanceManagerApp { get; set; }
|
||||||
|
|
||||||
public IEnumerable<Resource> Get(string type)
|
public IEnumerable<Resource> Get(string type)
|
||||||
{
|
{
|
||||||
@@ -32,6 +33,19 @@ namespace OpenAuth.App
|
|||||||
Repository.Update(u =>u.Id,resource);
|
Repository.Update(u =>u.Id,resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IEnumerable<Resource> LoadForUser(string appId, string userId)
|
||||||
|
{
|
||||||
|
var elementIds = RevelanceManagerApp.Get(Define.USERRESOURCE, true, userId);
|
||||||
|
return UnitWork.Find<Resource>(u => elementIds.Contains(u.Id) && (appId == "" || u.AppId == appId));
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<Resource> LoadForRole(string appId, string userId)
|
||||||
|
{
|
||||||
|
var elementIds = RevelanceManagerApp.Get(Define.ROLERESOURCE, true, userId);
|
||||||
|
return UnitWork.Find<Resource>(u => elementIds.Contains(u.Id) && (appId =="" || u.AppId == appId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public TableData Load(QueryResourcesReq request)
|
public TableData Load(QueryResourcesReq request)
|
||||||
{
|
{
|
||||||
|
@@ -28,9 +28,9 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
{
|
{
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载用户模块
|
/// 加载特定用户的模块
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="firstId">The user identifier.</param>
|
/// <param name="firstId">The user identifier.</param>
|
||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
using OpenAuth.App;
|
using OpenAuth.App;
|
||||||
using OpenAuth.App.Request;
|
using OpenAuth.App.Request;
|
||||||
using OpenAuth.App.Response;
|
|
||||||
using OpenAuth.Repository.Domain;
|
using OpenAuth.Repository.Domain;
|
||||||
|
|
||||||
namespace OpenAuth.Mvc.Controllers
|
namespace OpenAuth.Mvc.Controllers
|
||||||
@@ -19,6 +20,61 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
{
|
{
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
public ActionResult Assign()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 加载特定用户的资源
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="appId">应用appId</param>
|
||||||
|
/// <param name="firstId">用户ID</param>
|
||||||
|
/// <returns>System.String.</returns>
|
||||||
|
public string LoadForUser(string appId, string firstId)
|
||||||
|
{
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var result = new Response<List<string>>
|
||||||
|
{
|
||||||
|
Result = App.LoadForUser(appId, firstId).Select(u =>u.Id).ToList()
|
||||||
|
};
|
||||||
|
return JsonHelper.Instance.Serialize(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Result.Code = 500;
|
||||||
|
Result.Message = e.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return JsonHelper.Instance.Serialize(Result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 加载角色资源
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="appId">应用ID</param>
|
||||||
|
/// <param name="firstId">角色ID</param>
|
||||||
|
public string LoadForRole(string appId, string firstId)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var result = new Response<List<string>>
|
||||||
|
{
|
||||||
|
Result = App.LoadForRole(appId, firstId).Select(u => u.Id).ToList()
|
||||||
|
};
|
||||||
|
return JsonHelper.Instance.Serialize(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Result.Code = 500;
|
||||||
|
Result.Message = e.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return JsonHelper.Instance.Serialize(Result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public string Load([FromUri]QueryResourcesReq request)
|
public string Load([FromUri]QueryResourcesReq request)
|
||||||
{
|
{
|
||||||
|
@@ -201,6 +201,7 @@
|
|||||||
<Content Include="js\slimscroll.js" />
|
<Content Include="js\slimscroll.js" />
|
||||||
<Content Include="js\utils.js" />
|
<Content Include="js\utils.js" />
|
||||||
<Content Include="layui\css\modules\laydate\default\font.css" />
|
<Content Include="layui\css\modules\laydate\default\font.css" />
|
||||||
|
<Content Include="userJs\assignResource.js" />
|
||||||
<Content Include="userJs\assignRole.js" />
|
<Content Include="userJs\assignRole.js" />
|
||||||
<Content Include="userJs\flowinstanceDetail.js" />
|
<Content Include="userJs\flowinstanceDetail.js" />
|
||||||
<Content Include="userJs\resources.js" />
|
<Content Include="userJs\resources.js" />
|
||||||
@@ -650,6 +651,7 @@
|
|||||||
<Content Include="Views\RoleManager\Assign.cshtml" />
|
<Content Include="Views\RoleManager\Assign.cshtml" />
|
||||||
<Content Include="Views\FlowInstances\Detail.cshtml" />
|
<Content Include="Views\FlowInstances\Detail.cshtml" />
|
||||||
<Content Include="Views\Resources\Index.cshtml" />
|
<Content Include="Views\Resources\Index.cshtml" />
|
||||||
|
<Content Include="Views\Resources\Assign.cshtml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="layui\lay\modules\mobile\" />
|
<Folder Include="layui\lay\modules\mobile\" />
|
||||||
|
31
OpenAuth.Mvc/Views/Resources/Assign.cshtml
Normal file
31
OpenAuth.Mvc/Views/Resources/Assign.cshtml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
@section header
|
||||||
|
{
|
||||||
|
<link rel="stylesheet" href="/css/treetable.css" />
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
<table class="layui-table"
|
||||||
|
lay-data="{height: 'full-5', page:true, id:'mainList'}"
|
||||||
|
lay-filter="list" lay-size="sm">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th lay-data="{checkbox:true, fixed: true}"></th>
|
||||||
|
<th lay-data="{field:'Id', width:200}">资源标识</th>
|
||||||
|
<th lay-data="{field:'Name', width:150}">名称</th>
|
||||||
|
<th lay-data="{field:'Disable', width:150, templet:'#Disable'}">是否可用</th>
|
||||||
|
<th lay-data="{field:'Description', width:200}">描述</th>
|
||||||
|
<th lay-data="{field:'AppName', width:150}">所属应用</th>
|
||||||
|
<th lay-data="{field:'TypeName', width:150}">分类名称</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
</table>
|
||||||
|
<script type="text/html" id="Disable">
|
||||||
|
{{# if(d.Disable){ }}
|
||||||
|
<span class="layui-badge">已禁用</span>
|
||||||
|
{{# } else{}}
|
||||||
|
<span class="layui-badge layui-bg-green">正常</span>
|
||||||
|
{{# } }}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="/layui/layui.js"></script>
|
||||||
|
<script type="text/javascript" src="/userJs/assignResource.js"></script>
|
@@ -5,37 +5,45 @@
|
|||||||
<blockquote class="layui-elem-quote news_search toolList" id="menus"></blockquote>
|
<blockquote class="layui-elem-quote news_search toolList" id="menus"></blockquote>
|
||||||
|
|
||||||
<div class="layui-card">
|
<div class="layui-card">
|
||||||
|
|
||||||
<table class="layui-table"
|
<table class="layui-table"
|
||||||
lay-data="{height: 'full-80', page:true, id:'mainList'}"
|
lay-data="{height: 'full-80', page:true, id:'mainList'}"
|
||||||
lay-filter="list" lay-size="sm">
|
lay-filter="list" lay-size="sm">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th lay-data="{checkbox:true, fixed: true}"></th>
|
<th lay-data="{checkbox:true, fixed: true}"></th>
|
||||||
<th lay-data="{field:'Key', width:150}">资源标识</th>
|
<th lay-data="{field:'Id', width:200}">资源标识</th>
|
||||||
<th lay-data="{field:'Name', width:150}">名称</th>
|
<th lay-data="{field:'Name', width:150}">名称</th>
|
||||||
<th lay-data="{field:'Status', width:150}">当前状态</th>
|
<th lay-data="{field:'Disable', width:150, templet:'#Disable'}">是否可用</th>
|
||||||
<th lay-data="{field:'SortNo', width:150}">排序号</th>
|
<th lay-data="{field:'SortNo', width:50}">排序</th>
|
||||||
<th lay-data="{field:'Description', width:150}">描述</th>
|
<th lay-data="{field:'Description', width:200}">描述</th>
|
||||||
<th lay-data="{field:'TypeName', width:150}">分类名称</th>
|
<th lay-data="{field:'AppName', width:150}">所属应用</th>
|
||||||
</tr>
|
<th lay-data="{field:'TypeName', width:150}">分类名称</th>
|
||||||
</thead>
|
</tr>
|
||||||
</table>
|
</thead>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<script type="text/html" id="Disable">
|
||||||
|
{{# if(d.Disable){ }}
|
||||||
|
<span class="layui-badge">已禁用</span>
|
||||||
|
{{# } else{}}
|
||||||
|
<span class="layui-badge layui-bg-green">正常</span>
|
||||||
|
{{# } }}
|
||||||
|
</script>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--添加/编辑窗口-->
|
<!--添加/编辑窗口-->
|
||||||
<div id="divEdit" style="display: none">
|
<div id="divEdit" style="display: none">
|
||||||
<form class="layui-form layui-form-pane" action="" id="formEdit">
|
<form class="layui-form layui-form-pane" action="" id="formEdit">
|
||||||
<input type="hidden" name="Id" v-model="Id" />
|
|
||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">资源标识</label>
|
<label class="layui-form-label">资源标识</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" name="Key" v-model="Key" required lay-verify="required"
|
<input type="text" name="Id" v-model="Id" required lay-verify="required"
|
||||||
placeholder="资源英文唯一标识" autocomplete="off" class="layui-input">
|
placeholder="名称" autocomplete="off" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">名称</label>
|
<label class="layui-form-label">名称</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
@@ -43,7 +51,7 @@
|
|||||||
placeholder="名称" autocomplete="off" class="layui-input">
|
placeholder="名称" autocomplete="off" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">描述</label>
|
<label class="layui-form-label">描述</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
@@ -51,17 +59,17 @@
|
|||||||
placeholder="描述" autocomplete="off" class="layui-input">
|
placeholder="描述" autocomplete="off" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">所属应用</label>
|
<label class="layui-form-label">所属应用</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
|
|
||||||
<input id="AppName" name="AppName" v-model="AppName" class="layui-input" />
|
<input id="AppName" name="AppName" v-model="AppName" class="layui-input" />
|
||||||
<input id="AppId" name="AppId" v-model="AppId" type="hidden" />
|
<input id="AppId" name="AppId" v-model="AppId" type="hidden" />
|
||||||
<div id="menuContent" class="menuContent" style="display: none;">
|
<div id="menuContent" class="menuContent" style="display: none;">
|
||||||
<ul id="org" class="ztree"></ul>
|
<ul id="org" class="ztree"></ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
93
OpenAuth.Mvc/userJs/assignResource.js
Normal file
93
OpenAuth.Mvc/userJs/assignResource.js
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
layui.config({
|
||||||
|
base: "/js/"
|
||||||
|
}).use(['form','vue', 'ztree', 'layer', 'jquery', 'table','utils'], function () {
|
||||||
|
var form = layui.form,
|
||||||
|
layer = layui.layer,
|
||||||
|
$ = layui.jquery;
|
||||||
|
var table = layui.table;
|
||||||
|
var id = $.getUrlParam("id"); //待分配的id
|
||||||
|
var type = $.getUrlParam("type"); //待分配的id
|
||||||
|
|
||||||
|
|
||||||
|
//主列表加载,可反复调用进行刷新
|
||||||
|
var config= {}; //table的参数,如搜索key,点击tree的id
|
||||||
|
var mainList = function(options) {
|
||||||
|
if (options != undefined) {
|
||||||
|
$.extend(config, options);
|
||||||
|
}
|
||||||
|
table.reload('mainList',
|
||||||
|
{
|
||||||
|
url: '/Resources/Load',
|
||||||
|
where: config,
|
||||||
|
done: function(res, curr, count) {
|
||||||
|
//如果是异步请求数据方式,res即为你接口返回的信息。
|
||||||
|
//如果是直接赋值的方式,res即为:{data: [], count: 99} data为当前页数据、count为数据总长度
|
||||||
|
var url = "/Resources/LoadForUser";
|
||||||
|
if (type.indexOf("Role") != -1) {
|
||||||
|
url = "/Resources/LoadForRole";
|
||||||
|
}
|
||||||
|
|
||||||
|
$.ajax(url,
|
||||||
|
{
|
||||||
|
async: false
|
||||||
|
, data: {
|
||||||
|
firstId: id
|
||||||
|
, appid: "" //暂时不做左边的应用列表树
|
||||||
|
}
|
||||||
|
, dataType: 'json'
|
||||||
|
,success: function(json) {
|
||||||
|
if (json.Code == 500) return;
|
||||||
|
var roles = json.Result;
|
||||||
|
//循环所有数据,找出对应关系,设置checkbox选中状态
|
||||||
|
for (var i = 0; i < res.data.length; i++) {
|
||||||
|
for (var j = 0; j < roles.length; j++) {
|
||||||
|
if (res.data[i].Id != roles[j]) continue;
|
||||||
|
|
||||||
|
//这里才是真正的有效勾选
|
||||||
|
res.data[i]["LAY_CHECKED"] = true;
|
||||||
|
//找到对应数据改变勾选样式,呈现出选中效果
|
||||||
|
var index = res.data[i]['LAY_TABLE_INDEX'];
|
||||||
|
$('.layui-table-fixed-l tr[data-index=' + index + '] input[type="checkbox"]')
|
||||||
|
.prop('checked', true);
|
||||||
|
$('.layui-table-fixed-l tr[data-index=' + index + '] input[type="checkbox"]')
|
||||||
|
.next().addClass('layui-form-checked');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//如果构成全选
|
||||||
|
var checkStatus = table.checkStatus('mainList');
|
||||||
|
if (checkStatus.isAll) {
|
||||||
|
$('.layui-table-header th[data-field="0"] input[type="checkbox"]')
|
||||||
|
.prop('checked', true);
|
||||||
|
$('.layui-table-header th[data-field="0"] input[type="checkbox"]').next()
|
||||||
|
.addClass('layui-form-checked');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
mainList();
|
||||||
|
|
||||||
|
//分配及取消分配
|
||||||
|
table.on('checkbox(list)', function (obj) {
|
||||||
|
console.log(obj.checked); //当前是否选中状态
|
||||||
|
console.log(obj.data); //选中行的相关数据
|
||||||
|
console.log(obj.type); //如果触发的是全选,则为:all,如果触发的是单选,则为:one
|
||||||
|
|
||||||
|
var url = "/RelevanceManager/Assign";
|
||||||
|
if (!obj.checked) {
|
||||||
|
url = "/RelevanceManager/UnAssign";
|
||||||
|
}
|
||||||
|
$.post(url, { type: type, firstId: id, secIds: [obj.data.Id] }
|
||||||
|
, function (data) {
|
||||||
|
layer.msg(data.Message);
|
||||||
|
}
|
||||||
|
, "json");
|
||||||
|
});
|
||||||
|
//监听页面主按钮操作 end
|
||||||
|
})
|
@@ -24,8 +24,8 @@ layui.config({
|
|||||||
|
|
||||||
$.ajax("/RoleManager/LoadForUser?userId=" + id,{
|
$.ajax("/RoleManager/LoadForUser?userId=" + id,{
|
||||||
async: false
|
async: false
|
||||||
, success: function (data) {
|
, dataType: 'json'
|
||||||
var json = JSON.parse(data);
|
, success: function (json) {
|
||||||
if (json.Code == 500) return;
|
if (json.Code == 500) return;
|
||||||
var roles = json.Result;
|
var roles = json.Result;
|
||||||
//循环所有数据,找出对应关系,设置checkbox选中状态
|
//循环所有数据,找出对应关系,设置checkbox选中状态
|
||||||
|
@@ -166,6 +166,24 @@ layui.config({
|
|||||||
content: "/ModuleManager/Assign?type=RoleModule&menuType=RoleElement&id=" + data[0].Id,
|
content: "/ModuleManager/Assign?type=RoleModule&menuType=RoleElement&id=" + data[0].Id,
|
||||||
success: function (layero, index) {
|
success: function (layero, index) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
, btnAssignReource: function () {
|
||||||
|
var checkStatus = table.checkStatus('mainList')
|
||||||
|
, data = checkStatus.data;
|
||||||
|
if (data.length != 1) {
|
||||||
|
toplayer.msg("请选择要分配的角色");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var index = toplayer.open({
|
||||||
|
title: "为角色【" + data[0].Name + "】分配资源",
|
||||||
|
type: 2,
|
||||||
|
area: ['750px', '600px'],
|
||||||
|
content: "/Resources/Assign?type=RoleResource&id=" + data[0].Id,
|
||||||
|
success: function (layero, index) {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -188,6 +188,24 @@ layui.config({
|
|||||||
content: "/RoleManager/Assign?type=UserRole&id=" + data[0].Id,
|
content: "/RoleManager/Assign?type=UserRole&id=" + data[0].Id,
|
||||||
success: function (layero, index) {
|
success: function (layero, index) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
, btnAssignReource: function () {
|
||||||
|
var checkStatus = table.checkStatus('mainList')
|
||||||
|
, data = checkStatus.data;
|
||||||
|
if (data.length != 1) {
|
||||||
|
toplayer.msg("请选择要分配的用户");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var index = toplayer.open({
|
||||||
|
title: "为用户【" + data[0].Name + "】分配资源",
|
||||||
|
type: 2,
|
||||||
|
area: ['750px', '600px'],
|
||||||
|
content: "/Resources/Assign?type=UserResource&id=" + data[0].Id,
|
||||||
|
success: function (layero, index) {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -21,8 +21,7 @@ namespace OpenAuth.Repository.Domain
|
|||||||
public Application()
|
public Application()
|
||||||
{
|
{
|
||||||
this.Name= string.Empty;
|
this.Name= string.Empty;
|
||||||
this.AppId= string.Empty;
|
this.AppSecret= string.Empty;
|
||||||
this.AppKey= string.Empty;
|
|
||||||
this.Description= string.Empty;
|
this.Description= string.Empty;
|
||||||
this.Icon= string.Empty;
|
this.Icon= string.Empty;
|
||||||
this.CreateTime= DateTime.Now;
|
this.CreateTime= DateTime.Now;
|
||||||
@@ -30,17 +29,13 @@ namespace OpenAuth.Repository.Domain
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 名称
|
/// 应用名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// 应用ID
|
|
||||||
/// </summary>
|
|
||||||
public string AppId { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 应用密钥
|
/// 应用密钥
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string AppKey { get; set; }
|
public string AppSecret { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 应用描述
|
/// 应用描述
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -56,7 +51,7 @@ namespace OpenAuth.Repository.Domain
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建日期
|
/// 创建日期
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public System.DateTime? CreateTime { get; set; }
|
public System.DateTime CreateTime { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建人
|
/// 创建人
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@@ -21,13 +21,13 @@ namespace OpenAuth.Repository.Domain
|
|||||||
public Resource()
|
public Resource()
|
||||||
{
|
{
|
||||||
this.CascadeId= string.Empty;
|
this.CascadeId= string.Empty;
|
||||||
this.Key= string.Empty;
|
|
||||||
this.Name= string.Empty;
|
this.Name= string.Empty;
|
||||||
this.Status= 0;
|
|
||||||
this.SortNo= 0;
|
this.SortNo= 0;
|
||||||
this.Description= string.Empty;
|
this.Description= string.Empty;
|
||||||
|
this.ParentName= string.Empty;
|
||||||
this.ParentId= string.Empty;
|
this.ParentId= string.Empty;
|
||||||
this.AppId= string.Empty;
|
this.AppId= string.Empty;
|
||||||
|
this.AppName= string.Empty;
|
||||||
this.TypeName= string.Empty;
|
this.TypeName= string.Empty;
|
||||||
this.TypeId= string.Empty;
|
this.TypeId= string.Empty;
|
||||||
}
|
}
|
||||||
@@ -36,18 +36,10 @@ namespace OpenAuth.Repository.Domain
|
|||||||
/// 节点语义ID
|
/// 节点语义ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string CascadeId { get; set; }
|
public string CascadeId { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// 资源英文唯一标识
|
|
||||||
/// </summary>
|
|
||||||
public string Key { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 名称
|
/// 名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// 当前状态
|
|
||||||
/// </summary>
|
|
||||||
public int Status { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 排序号
|
/// 排序号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -57,13 +49,21 @@ namespace OpenAuth.Repository.Domain
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 父节点流水号
|
/// 父节点名称
|
||||||
|
/// </summary>
|
||||||
|
public string ParentName { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 父节点流ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ParentId { get; set; }
|
public string ParentId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源所属应用
|
/// 资源所属应用ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string AppId { get; set; }
|
public string AppId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 所属应用名称
|
||||||
|
/// </summary>
|
||||||
|
public string AppName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 分类名称
|
/// 分类名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -72,6 +72,10 @@ namespace OpenAuth.Repository.Domain
|
|||||||
/// 分类ID
|
/// 分类ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TypeId { get; set; }
|
public string TypeId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否可用
|
||||||
|
/// </summary>
|
||||||
|
public bool Disable { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -32,12 +32,8 @@ namespace OpenAuth.Repository.Mapping
|
|||||||
.HasColumnName("Name")
|
.HasColumnName("Name")
|
||||||
.HasMaxLength(255)
|
.HasMaxLength(255)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
Property(t => t.AppId)
|
Property(t => t.AppSecret)
|
||||||
.HasColumnName("AppId")
|
.HasColumnName("AppSecret")
|
||||||
.HasMaxLength(255)
|
|
||||||
.IsOptional();
|
|
||||||
Property(t => t.AppKey)
|
|
||||||
.HasColumnName("AppKey")
|
|
||||||
.HasMaxLength(255)
|
.HasMaxLength(255)
|
||||||
.IsOptional();
|
.IsOptional();
|
||||||
Property(t => t.Description)
|
Property(t => t.Description)
|
||||||
@@ -53,7 +49,7 @@ namespace OpenAuth.Repository.Mapping
|
|||||||
.IsRequired();
|
.IsRequired();
|
||||||
Property(t => t.CreateTime)
|
Property(t => t.CreateTime)
|
||||||
.HasColumnName("CreateTime")
|
.HasColumnName("CreateTime")
|
||||||
.IsOptional();
|
.IsRequired();
|
||||||
Property(t => t.CreateUser)
|
Property(t => t.CreateUser)
|
||||||
.HasColumnName("CreateUser")
|
.HasColumnName("CreateUser")
|
||||||
.HasMaxLength(50)
|
.HasMaxLength(50)
|
||||||
|
@@ -32,17 +32,10 @@ namespace OpenAuth.Repository.Mapping
|
|||||||
.HasColumnName("CascadeId")
|
.HasColumnName("CascadeId")
|
||||||
.HasMaxLength(255)
|
.HasMaxLength(255)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
Property(t => t.Key)
|
|
||||||
.HasColumnName("Key")
|
|
||||||
.HasMaxLength(200)
|
|
||||||
.IsRequired();
|
|
||||||
Property(t => t.Name)
|
Property(t => t.Name)
|
||||||
.HasColumnName("Name")
|
.HasColumnName("Name")
|
||||||
.HasMaxLength(255)
|
.HasMaxLength(255)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
Property(t => t.Status)
|
|
||||||
.HasColumnName("Status")
|
|
||||||
.IsRequired();
|
|
||||||
Property(t => t.SortNo)
|
Property(t => t.SortNo)
|
||||||
.HasColumnName("SortNo")
|
.HasColumnName("SortNo")
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
@@ -50,6 +43,10 @@ namespace OpenAuth.Repository.Mapping
|
|||||||
.HasColumnName("Description")
|
.HasColumnName("Description")
|
||||||
.HasMaxLength(500)
|
.HasMaxLength(500)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
Property(t => t.ParentName)
|
||||||
|
.HasColumnName("ParentName")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.IsOptional();
|
||||||
Property(t => t.ParentId)
|
Property(t => t.ParentId)
|
||||||
.HasColumnName("ParentId")
|
.HasColumnName("ParentId")
|
||||||
.HasMaxLength(50)
|
.HasMaxLength(50)
|
||||||
@@ -58,6 +55,10 @@ namespace OpenAuth.Repository.Mapping
|
|||||||
.HasColumnName("AppId")
|
.HasColumnName("AppId")
|
||||||
.HasMaxLength(50)
|
.HasMaxLength(50)
|
||||||
.IsOptional();
|
.IsOptional();
|
||||||
|
Property(t => t.AppName)
|
||||||
|
.HasColumnName("AppName")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.IsOptional();
|
||||||
Property(t => t.TypeName)
|
Property(t => t.TypeName)
|
||||||
.HasColumnName("TypeName")
|
.HasColumnName("TypeName")
|
||||||
.HasMaxLength(20)
|
.HasMaxLength(20)
|
||||||
@@ -66,6 +67,9 @@ namespace OpenAuth.Repository.Mapping
|
|||||||
.HasColumnName("TypeId")
|
.HasColumnName("TypeId")
|
||||||
.HasMaxLength(50)
|
.HasMaxLength(50)
|
||||||
.IsOptional();
|
.IsOptional();
|
||||||
|
Property(t => t.Disable)
|
||||||
|
.HasColumnName("Disable")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
// Relationships
|
// Relationships
|
||||||
}
|
}
|
||||||
|
BIN
建表&初始化数据.sql
BIN
建表&初始化数据.sql
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user