fix issue #I3YVBH 兼容oracle 11g

add load all users/roles for flowinstance
fix issue #I3W5YR
This commit is contained in:
yubaolee
2021-07-05 21:44:35 +08:00
parent b94fba7c19
commit 38a62595ba
15 changed files with 205 additions and 60 deletions

View File

@@ -5,6 +5,7 @@ using OpenAuth.App.Response;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;
using System.Linq;
using System.Threading.Tasks;
using Infrastructure;
using OpenAuth.App.Request;
using OpenAuth.Repository;
@@ -29,6 +30,26 @@ namespace OpenAuth.App
return roles;
}
/// <summary>
/// 获取所有的角色
/// 为了控制权限通常只用于流程实例选择执行角色其他地方请使用Load
/// </summary>
public async Task<TableResp<Role>> LoadAll(QueryRoleListReq request)
{
var result = new TableResp<Role>();
var objs = UnitWork.Find<Role>(null);
if (!string.IsNullOrEmpty(request.key))
{
objs = objs.Where(u => u.Name.Contains(request.key));
}
result.data = objs.OrderBy(u => u.Name)
.Skip((request.page - 1) * request.limit)
.Take(request.limit).ToList();
result.count = objs.Count();
return result;
}
/// <summary>
@@ -80,5 +101,7 @@ namespace OpenAuth.App
{
_revelanceApp = app;
}
}
}