mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2026-04-08 01:51:28 +08:00
全面修改Id为Guid类型,为2.0版做准备
This commit is contained in:
@@ -19,9 +19,9 @@ namespace OpenAuth.App
|
||||
_orgRepository = orgRepository;
|
||||
}
|
||||
|
||||
public int GetCategoryCntInOrg(int orgId)
|
||||
public int GetCategoryCntInOrg(Guid orgId)
|
||||
{
|
||||
if (orgId == 0)
|
||||
if (orgId == Guid.Empty)
|
||||
{
|
||||
return _repository.Find(null).Count();
|
||||
}
|
||||
@@ -39,11 +39,11 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 加载一个部门及子部门全部Categorys
|
||||
/// </summary>
|
||||
public dynamic Load(int parentId, int pageindex, int pagesize)
|
||||
public dynamic Load(Guid parentId, int pageindex, int pagesize)
|
||||
{
|
||||
IEnumerable<Category> Categorys;
|
||||
int total = 0;
|
||||
if (parentId == 0)
|
||||
if (parentId == Guid.Empty)
|
||||
{
|
||||
Categorys = _repository.LoadCategorys(pageindex, pagesize);
|
||||
total = _repository.GetCount();
|
||||
@@ -66,14 +66,14 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 获取当前组织的所有下级组织
|
||||
/// </summary>
|
||||
private int[] GetSubCategories(int orgId)
|
||||
private Guid[] GetSubCategories(Guid orgId)
|
||||
{
|
||||
var category = Find(orgId);
|
||||
var categories = _repository.Find(u => u.CascadeId.Contains(category.CascadeId)).Select(u => u.Id).ToArray();
|
||||
return categories;
|
||||
}
|
||||
|
||||
public Category Find(int id)
|
||||
public Category Find(Guid id)
|
||||
{
|
||||
var category = _repository.FindSingle(u => u.Id == id);
|
||||
if (category == null) return new Category();
|
||||
@@ -81,7 +81,7 @@ namespace OpenAuth.App
|
||||
return category;
|
||||
}
|
||||
|
||||
public void Delete(int id)
|
||||
public void Delete(Guid id)
|
||||
{
|
||||
_repository.Delete(id);
|
||||
}
|
||||
@@ -92,7 +92,7 @@ namespace OpenAuth.App
|
||||
model.CopyTo(category);
|
||||
ChangeModuleCascade(category);
|
||||
|
||||
if (category.Id == 0)
|
||||
if (category.Id == Guid.Empty)
|
||||
{
|
||||
_repository.Add(category);
|
||||
}
|
||||
@@ -116,7 +116,7 @@ namespace OpenAuth.App
|
||||
if (currentCascadeId <= objCascadeId) currentCascadeId = objCascadeId + 1;
|
||||
}
|
||||
|
||||
if (org.ParentId != 0)
|
||||
if (org.ParentId != Guid.Empty)
|
||||
{
|
||||
var parentOrg = _repository.FindSingle(o => o.Id == org.ParentId);
|
||||
if (parentOrg != null)
|
||||
|
||||
45
OpenAuth.App/GoodsApplyApp.cs
Normal file
45
OpenAuth.App/GoodsApplyApp.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenAuth.Domain;
|
||||
using OpenAuth.Domain.Interface;
|
||||
|
||||
namespace OpenAuth.App
|
||||
{
|
||||
public class GoodsApplyApp
|
||||
{
|
||||
private IRepository<GoodsApply> _repository;
|
||||
|
||||
public GoodsApplyApp(IRepository<GoodsApply> repository)
|
||||
{
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
public void AddOrUpdate(GoodsApply model)
|
||||
{
|
||||
if (model.Id == Guid.Empty)
|
||||
{
|
||||
_repository.Add(model);
|
||||
}
|
||||
else
|
||||
{
|
||||
_repository.Update(u => u.Id == model.Id, u => new GoodsApply
|
||||
{
|
||||
UserId = model.UserId,
|
||||
Name = model.Name,
|
||||
Number = model.Number
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public GoodsApply Get(Guid value)
|
||||
{
|
||||
return _repository.FindSingle(u =>u.Id == value);
|
||||
}
|
||||
|
||||
public IEnumerable<GoodsApply> Load(Guid userid, Guid parentId, int pageCurrent, int pageSize)
|
||||
{
|
||||
return _repository.Find( pageCurrent, pageSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
// <summary>模块元素</summary>
|
||||
// ***********************************************************************
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
@@ -40,7 +41,7 @@ namespace OpenAuth.App
|
||||
_moduleEleManService.AddOrUpdate(newbtn);
|
||||
}
|
||||
|
||||
public IEnumerable<ModuleElement> LoadByModuleId(int id)
|
||||
public IEnumerable<ModuleElement> LoadByModuleId(Guid id)
|
||||
{
|
||||
string username = AuthUtil.GetUserName();
|
||||
return _moduleEleManService.LoadByModuleId(username, id);
|
||||
@@ -55,7 +56,7 @@ namespace OpenAuth.App
|
||||
/// 当为UserElement时,表示UserId
|
||||
/// </param>
|
||||
/// <param name="moduleId">模块ID</param>
|
||||
public List<dynamic> LoadWithAccess(string accessType, int firstId, int moduleId)
|
||||
public List<dynamic> LoadWithAccess(string accessType, Guid firstId, Guid moduleId)
|
||||
{
|
||||
string username = AuthUtil.GetUserName();
|
||||
return _moduleEleManService.LoadWithAccess(username, accessType, firstId, moduleId);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Infrastructure;
|
||||
using System;
|
||||
using Infrastructure;
|
||||
using OpenAuth.Domain;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
@@ -19,12 +20,12 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 加载一个节点下面的所有
|
||||
/// </summary>
|
||||
public dynamic Load(int parentId, int pageindex, int pagesize)
|
||||
public dynamic Load(Guid parentId, int pageindex, int pagesize)
|
||||
{
|
||||
return _moduleManService.Load(AuthUtil.GetUserName(), parentId, pageindex, pagesize);
|
||||
}
|
||||
|
||||
public void Delete(int id)
|
||||
public void Delete(Guid id)
|
||||
{
|
||||
_moduleManService.Delete(id);
|
||||
}
|
||||
@@ -43,7 +44,7 @@ namespace OpenAuth.App
|
||||
/// TODO:这里会加载用户及用户角色的所有模块,“为用户分配模块”功能会给人一种混乱的感觉,但可以接受
|
||||
/// </summary>
|
||||
/// <param name="userId">The user unique identifier.</param>
|
||||
public List<Module> LoadForUser(int userId)
|
||||
public List<Module> LoadForUser(Guid userId)
|
||||
{
|
||||
return _moduleManService.LoadForUser(userId);
|
||||
}
|
||||
@@ -52,7 +53,7 @@ namespace OpenAuth.App
|
||||
/// 加载特定角色的模块
|
||||
/// </summary>
|
||||
/// <param name="roleId">The role unique identifier.</param>
|
||||
public List<Module> LoadForRole(int roleId)
|
||||
public List<Module> LoadForRole(Guid roleId)
|
||||
{
|
||||
return _moduleManService.LoadForRole(roleId);
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@
|
||||
<Compile Include="SSO\SSOAuthAttribute.cs" />
|
||||
<Compile Include="SSO\UserAuthSession.cs" />
|
||||
<Compile Include="SSO\UserAuthSessionService.cs" />
|
||||
<Compile Include="GoodsApplyApp.cs" />
|
||||
<Compile Include="StockManagerApp.cs" />
|
||||
<Compile Include="UserManagerApp.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace OpenAuth.App
|
||||
/// </summary>
|
||||
/// <param name="orgId">The org unique identifier.</param>
|
||||
/// <returns>IEnumerable{Org}.</returns>
|
||||
public IList<Org> LoadDirectChildren(int orgId)
|
||||
public IList<Org> LoadDirectChildren(Guid orgId)
|
||||
{
|
||||
return _repository.Find(u => u.ParentId == orgId).ToList();
|
||||
}
|
||||
@@ -37,7 +37,7 @@ namespace OpenAuth.App
|
||||
/// 得到部门的所有子部门
|
||||
/// <para>如果orgId为0,表示取得所有部门</para>
|
||||
/// </summary>
|
||||
public IList<Org> LoadAllChildren(int orgId)
|
||||
public IList<Org> LoadAllChildren(Guid orgId)
|
||||
{
|
||||
return _repository.GetSubOrgs(orgId).ToList();
|
||||
}
|
||||
@@ -48,10 +48,10 @@ namespace OpenAuth.App
|
||||
/// <param name="org">The org.</param>
|
||||
/// <returns>System.Int32.</returns>
|
||||
/// <exception cref="System.Exception">未能找到该组织的父节点信息</exception>
|
||||
public int AddOrUpdate(Org org)
|
||||
public Guid AddOrUpdate(Org org)
|
||||
{
|
||||
ChangeModuleCascade(org);
|
||||
if (org.Id == 0)
|
||||
if (org.Id == Guid.Empty)
|
||||
{
|
||||
_repository.Add(org);
|
||||
}
|
||||
@@ -66,7 +66,7 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 删除指定ID的部门及其所有子部门
|
||||
/// </summary>
|
||||
public void DelOrg(int id)
|
||||
public void DelOrg(Guid id)
|
||||
{
|
||||
var delOrg = _repository.FindSingle(u => u.Id == id);
|
||||
if (delOrg == null) return;
|
||||
@@ -80,7 +80,7 @@ namespace OpenAuth.App
|
||||
/// TODO:这里会加载用户及用户角色的所有角色,“为用户分配角色”功能会给人一种混乱的感觉,但可以接受
|
||||
/// </summary>
|
||||
/// <param name="userId">The user unique identifier.</param>
|
||||
public List<Org> LoadForUser(int userId)
|
||||
public List<Org> LoadForUser(Guid userId)
|
||||
{
|
||||
//用户角色
|
||||
var userRoleIds =
|
||||
@@ -101,7 +101,7 @@ namespace OpenAuth.App
|
||||
/// 加载特定角色的角色
|
||||
/// </summary>
|
||||
/// <param name="roleId">The role unique identifier.</param>
|
||||
public List<Org> LoadForRole(int roleId)
|
||||
public List<Org> LoadForRole(Guid roleId)
|
||||
{
|
||||
var moduleIds =
|
||||
_relevanceRepository.Find(u => u.FirstId == roleId && u.Key == "RoleAccessedOrg")
|
||||
@@ -125,7 +125,7 @@ namespace OpenAuth.App
|
||||
if (currentCascadeId <= objCascadeId) currentCascadeId = objCascadeId + 1;
|
||||
}
|
||||
|
||||
if (org.ParentId != 0)
|
||||
if (org.ParentId != Guid.Empty)
|
||||
{
|
||||
var parentOrg = _repository.FindSingle(o => o.Id == org.ParentId);
|
||||
if (parentOrg != null)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenAuth.App
|
||||
_resManagerService = resManagerService;
|
||||
}
|
||||
|
||||
public int GetResourceCntInOrg(int orgId)
|
||||
public int GetResourceCntInOrg(Guid orgId)
|
||||
{
|
||||
return _resManagerService.GetResourceCntInOrg(orgId);
|
||||
}
|
||||
@@ -32,14 +32,14 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 加载一个节点下面的一个或全部Resources
|
||||
/// </summary>
|
||||
public dynamic Load(string username, int categoryId, int pageindex, int pagesize)
|
||||
public dynamic Load(string username, Guid categoryId, int pageindex, int pagesize)
|
||||
{
|
||||
return _resManagerService.Load(username, categoryId, pageindex, pagesize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Delete(int id)
|
||||
public void Delete(Guid id)
|
||||
{
|
||||
_resManagerService.Delete(id);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ namespace OpenAuth.App
|
||||
/// 当为UserResource时,表示UserId
|
||||
/// </param>
|
||||
/// <param name="cId">分类ID</param>
|
||||
public List<dynamic> LoadWithAccess(string username, string accessType, int firstId, int cId)
|
||||
public List<dynamic> LoadWithAccess(string username, string accessType, Guid firstId, Guid cId)
|
||||
{
|
||||
return _resManagerService.LoadWithAccess(username, accessType, firstId, cId);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace OpenAuth.App
|
||||
/// <para>比如给用户分配资源,那么firstId就是用户ID,secIds就是资源ID列表</para>
|
||||
/// </summary>
|
||||
/// <param name="type">关联的类型,如"UserResource"</param>
|
||||
public void Assign(string type, int firstId, int[] secIds)
|
||||
public void Assign(string type, Guid firstId, Guid[] secIds)
|
||||
{
|
||||
_relevanceRepository.AddRelevance(type, secIds.ToLookup(u => firstId));
|
||||
}
|
||||
@@ -36,7 +36,7 @@ namespace OpenAuth.App
|
||||
/// <param name="type">关联的类型,如"UserResource"</param>
|
||||
/// <param name="firstId">The first identifier.</param>
|
||||
/// <param name="secIds">The sec ids.</param>
|
||||
public void UnAssign(string type, int firstId, int[] secIds)
|
||||
public void UnAssign(string type, Guid firstId, Guid[] secIds)
|
||||
{
|
||||
_relevanceRepository.DeleteBy(type, secIds.ToLookup(u =>firstId));
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using OpenAuth.Domain;
|
||||
using OpenAuth.Domain.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Dynamic;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenAuth.App
|
||||
@@ -22,9 +23,9 @@ namespace OpenAuth.App
|
||||
_relevanceRepository = relevanceRepository;
|
||||
}
|
||||
|
||||
public int GetRoleCntInOrg(int orgId)
|
||||
public int GetRoleCntInOrg(Guid orgId)
|
||||
{
|
||||
if (orgId == 0)
|
||||
if (orgId == Guid.Empty)
|
||||
{
|
||||
return _repository.Find(null).Count();
|
||||
}
|
||||
@@ -37,12 +38,12 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 加载一个部门及子部门全部Roles
|
||||
/// </summary>
|
||||
public dynamic Load(int orgId, int pageindex, int pagesize)
|
||||
public dynamic Load(Guid orgId, int pageindex, int pagesize)
|
||||
{
|
||||
if (pageindex < 1) pageindex = 1; //TODO:如果列表为空新增加一个用户后,前端会传一个0过来,奇怪??
|
||||
IEnumerable<Role> roles;
|
||||
int total = 0;
|
||||
if (orgId == 0)
|
||||
if (orgId == Guid.Empty)
|
||||
{
|
||||
roles = _repository.LoadRoles(pageindex, pagesize);
|
||||
total = _repository.GetCount();
|
||||
@@ -53,39 +54,39 @@ namespace OpenAuth.App
|
||||
total = _repository.GetRoleCntInOrgs(orgId);
|
||||
}
|
||||
|
||||
return new
|
||||
{
|
||||
total = total,
|
||||
list = roles,
|
||||
pageCurrent = pageindex
|
||||
};
|
||||
dynamic result = new ExpandoObject();
|
||||
result.total = total;
|
||||
result.list = roles.ToList();
|
||||
result.pageCurrent = pageindex;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前组织的所有下级组织
|
||||
/// </summary>
|
||||
private int[] GetSubOrgIds(int orgId)
|
||||
private Guid[] GetSubOrgIds(Guid orgId)
|
||||
{
|
||||
var org = _orgRepository.FindSingle(u => u.Id == orgId);
|
||||
var orgs = _orgRepository.Find(u => u.CascadeId.Contains(org.CascadeId)).Select(u => u.Id).ToArray();
|
||||
return orgs;
|
||||
}
|
||||
|
||||
public Role Find(int id)
|
||||
public Role Find(Guid id)
|
||||
{
|
||||
var role = _repository.FindSingle(u => u.Id == id);
|
||||
if (role == null) role = new Role();
|
||||
return role;
|
||||
}
|
||||
|
||||
public void Delete(int id)
|
||||
public void Delete(Guid id)
|
||||
{
|
||||
_repository.Delete(id);
|
||||
}
|
||||
|
||||
public void AddOrUpdate(Role role)
|
||||
{
|
||||
if (role.Id == 0)
|
||||
if (role.Id == Guid.Empty)
|
||||
{
|
||||
role.CreateTime = DateTime.Now;
|
||||
_repository.Add(role);
|
||||
@@ -96,10 +97,11 @@ namespace OpenAuth.App
|
||||
}
|
||||
}
|
||||
|
||||
public List<RoleVM> LoadForOrgAndUser(int orgId, int userId)
|
||||
public List<RoleVM> LoadForOrgAndUser(Guid orgId, Guid userId)
|
||||
{
|
||||
var allorgs = GetSubOrgIds(orgId);
|
||||
var roleIds = _repository.Find(u => orgId == 0 || allorgs.Contains(u.OrgId)).ToList();
|
||||
var roleIds = _repository.Find(u => orgId == Guid.Empty
|
||||
|| (u.OrgId != null &&allorgs.Contains(u.OrgId.Value))).ToList();
|
||||
var rolevms = new List<RoleVM>();
|
||||
foreach (var role in roleIds)
|
||||
{
|
||||
@@ -113,12 +115,12 @@ namespace OpenAuth.App
|
||||
return rolevms;
|
||||
}
|
||||
|
||||
public void AccessRole(int userId, int[] roleIds)
|
||||
public void AccessRole(Guid userId, Guid[] roleIds)
|
||||
{
|
||||
_relevanceRepository.AddRelevance("UserRole", roleIds.ToLookup(roleId => userId));
|
||||
}
|
||||
|
||||
public void DelAccessRole(int userId, int[] roleids)
|
||||
public void DelAccessRole(Guid userId, Guid[] roleids)
|
||||
{
|
||||
_relevanceRepository.DeleteBy("UserRole", roleids.ToLookup(roleId => userId));
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ using System.Web.Mvc;
|
||||
using Infrastructure;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
|
||||
|
||||
namespace OpenAuth.App.SSO
|
||||
{
|
||||
public class SSOAuthUtil
|
||||
@@ -28,6 +30,7 @@ namespace OpenAuth.App.SSO
|
||||
{
|
||||
userInfo = new User
|
||||
{
|
||||
Id = Guid.Empty,
|
||||
Account = "System",
|
||||
Name ="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա",
|
||||
Password = "123456"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using OpenAuth.Domain;
|
||||
using System;
|
||||
using OpenAuth.Domain;
|
||||
using Infrastructure;
|
||||
using OpenAuth.Domain.Service;
|
||||
|
||||
@@ -16,12 +17,12 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 根据部门ID得到进出库信息
|
||||
/// </summary>
|
||||
public dynamic Load(string username, int orgId, int pageindex, int pagesize)
|
||||
public dynamic Load(string username, Guid orgId, int pageindex, int pagesize)
|
||||
{
|
||||
return _service.Load(username, orgId, pageindex, pagesize);
|
||||
}
|
||||
|
||||
public void Delete(int id)
|
||||
public void Delete(Guid id)
|
||||
{
|
||||
_service.Delete(id);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
namespace OpenAuth.App
|
||||
{
|
||||
public class UserManagerApp
|
||||
@@ -27,9 +28,9 @@ namespace OpenAuth.App
|
||||
return _repository.FindSingle(u => u.Account == account);
|
||||
}
|
||||
|
||||
public int GetUserCntInOrg(int orgId)
|
||||
public int GetUserCntInOrg(Guid orgId)
|
||||
{
|
||||
if (orgId == 0)
|
||||
if (orgId == Guid.Empty)
|
||||
{
|
||||
return _repository.Find(null).Count();
|
||||
}
|
||||
@@ -42,12 +43,12 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 加载一个部门及子部门全部用户
|
||||
/// </summary>
|
||||
public dynamic Load(int orgId, int pageindex, int pagesize)
|
||||
public dynamic Load(Guid orgId, int pageindex, int pagesize)
|
||||
{
|
||||
if (pageindex < 1) pageindex = 1; //TODO:如果列表为空新增加一个用户后,前端会传一个0过来,奇怪??
|
||||
IEnumerable<User> users;
|
||||
int total = 0;
|
||||
if (orgId == 0)
|
||||
if (orgId ==Guid.Empty)
|
||||
{
|
||||
users = _repository.LoadUsers(pageindex, pagesize);
|
||||
total = _repository.GetCount();
|
||||
@@ -79,14 +80,14 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 获取当前组织的所有下级组织
|
||||
/// </summary>
|
||||
private int[] GetSubOrgIds(int orgId)
|
||||
private Guid[] GetSubOrgIds(Guid orgId)
|
||||
{
|
||||
var org = _orgRepository.FindSingle(u => u.Id == orgId);
|
||||
var orgs = _orgRepository.Find(u => u.CascadeId.Contains(org.CascadeId)).Select(u => u.Id).ToArray();
|
||||
return orgs;
|
||||
}
|
||||
|
||||
public UserView Find(int id)
|
||||
public UserView Find(Guid id)
|
||||
{
|
||||
var user = _repository.FindSingle(u => u.Id == id);
|
||||
if (user == null) return new UserView();
|
||||
@@ -102,7 +103,7 @@ namespace OpenAuth.App
|
||||
return view;
|
||||
}
|
||||
|
||||
public void Delete(int id)
|
||||
public void Delete(Guid id)
|
||||
{
|
||||
_repository.Delete(u => u.Id == id);
|
||||
_relevanceRepository.DeleteBy("UserOrg", id);
|
||||
@@ -113,7 +114,7 @@ namespace OpenAuth.App
|
||||
public void AddOrUpdate(UserView view)
|
||||
{
|
||||
User user = view;
|
||||
if (user.Id == 0)
|
||||
if (user.Id == Guid.Empty)
|
||||
{
|
||||
if (_repository.IsExist(u => u.Account == view.Account))
|
||||
{
|
||||
@@ -130,14 +131,13 @@ namespace OpenAuth.App
|
||||
{
|
||||
Account = user.Account,
|
||||
BizCode = user.BizCode,
|
||||
CreateId = user.CreateId,
|
||||
Name = user.Name,
|
||||
Sex = user.Sex,
|
||||
Status = user.Status,
|
||||
Type = user.Type
|
||||
});
|
||||
}
|
||||
int[] orgIds = view.OrganizationIds.Split(',').Select(id => int.Parse(id)).ToArray();
|
||||
Guid[] orgIds = view.OrganizationIds.Split(',').Select(id => Guid.Parse(id)).ToArray();
|
||||
|
||||
_relevanceRepository.DeleteBy("UserOrg", user.Id);
|
||||
_relevanceRepository.AddRelevance("UserOrg", orgIds.ToLookup(u => user.Id));
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Infrastructure;
|
||||
using System;
|
||||
using Infrastructure;
|
||||
using OpenAuth.Domain;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -10,7 +11,7 @@ namespace OpenAuth.App.ViewModel
|
||||
/// ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Id { get; set; }
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组织名称
|
||||
@@ -28,7 +29,7 @@ namespace OpenAuth.App.ViewModel
|
||||
/// 父节点流水号
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int ParentId { get; set; }
|
||||
public Guid? ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 节点图标文件名称
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenAuth.App.ViewModel
|
||||
/// 用户ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Id { get; set; }
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using Infrastructure;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
|
||||
namespace OpenAuth.App.ViewModel
|
||||
{
|
||||
public class UserView
|
||||
@@ -11,7 +12,7 @@ namespace OpenAuth.App.ViewModel
|
||||
/// 用户ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Id { get; set; }
|
||||
public Guid Id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
using System.Collections.Generic;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
|
||||
namespace OpenAuth.App.ViewModel
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user