mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2026-08-31 21:09:23 +08:00
调整结构
This commit is contained in:
@@ -23,7 +23,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
/// <summary>
|
||||
/// 加载分类下面的所有分类
|
||||
/// </summary>
|
||||
public string Load(Guid parentId, int page = 1, int rows = 30)
|
||||
public string Load(string parentId, int page = 1, int rows = 30)
|
||||
{
|
||||
return JsonHelper.Instance.Serialize(App.Load(parentId, page, rows));
|
||||
}
|
||||
@@ -50,7 +50,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return JsonHelper.Instance.Serialize(Result);
|
||||
}
|
||||
[HttpPost]
|
||||
public string Delete(Guid[] ids)
|
||||
public string Delete(string[] ids)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -26,12 +26,12 @@ namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
public ModuleElementManagerApp App { get; set; }
|
||||
|
||||
public ActionResult Index(Guid id)
|
||||
public ActionResult Index(string id)
|
||||
{
|
||||
ViewBag.ModuleId = id;
|
||||
return View();
|
||||
}
|
||||
public ActionResult Get(Guid moduleId)
|
||||
public ActionResult Get(string moduleId)
|
||||
{
|
||||
return Json(App.LoadByModuleId(moduleId), JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
}
|
||||
return JsonHelper.Instance.Serialize( Result);
|
||||
}
|
||||
public string Del(Guid[] ids)
|
||||
public string Del(string[] ids)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -71,13 +71,13 @@ namespace OpenAuth.Mvc.Controllers
|
||||
/// <param name="firstId">The first identifier.</param>
|
||||
/// <param name="key">The key.</param>
|
||||
/// <returns>ActionResult.</returns>
|
||||
public ActionResult AssignModuleElement(Guid firstId, string key)
|
||||
public ActionResult AssignModuleElement(string firstId, string key)
|
||||
{
|
||||
ViewBag.FirstId = firstId;
|
||||
ViewBag.ModuleType = key;
|
||||
return View();
|
||||
}
|
||||
public string LoadWithAccess(Guid tId, Guid firstId, string key)
|
||||
public string LoadWithAccess(string tId, string firstId, string key)
|
||||
{
|
||||
return JsonHelper.Instance.Serialize(App.LoadWithAccess(key, firstId, tId));
|
||||
}
|
||||
|
||||
@@ -23,12 +23,13 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return View();
|
||||
}
|
||||
|
||||
public ActionResult Assign(Guid firstId, string key)
|
||||
public ActionResult Assign(string firstId, string key)
|
||||
{
|
||||
ViewBag.FirstId = firstId;
|
||||
ViewBag.ModuleType = key;
|
||||
|
||||
var moduleWithChildren = AuthUtil.GetCurrentUser().Modules.GenerateTree(u =>u.Id, u =>u.ParentId);
|
||||
var moduleWithChildren = AuthUtil.GetCurrentUser().Modules
|
||||
.GenerateTree(u =>u.Id, u =>u.ParentId);
|
||||
var modules = key == "UserModule" ? App.LoadForUser(firstId) : App.LoadForRole(firstId);
|
||||
|
||||
CheckModule(moduleWithChildren, modules);
|
||||
@@ -99,7 +100,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
/// <summary>
|
||||
/// 加载模块下面的所有模块
|
||||
/// </summary>
|
||||
public string Load(Guid orgId, int page = 1, int rows = 30)
|
||||
public string Load(string orgId, int page = 1, int rows = 30)
|
||||
{
|
||||
return JsonHelper.Instance.Serialize(App.Load(orgId, page, rows));
|
||||
}
|
||||
@@ -109,7 +110,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
/// </summary>
|
||||
/// <param name="firstId">The user identifier.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
public string LoadForUser(Guid firstId)
|
||||
public string LoadForUser(string firstId)
|
||||
{
|
||||
var orgs = App.LoadForUser(firstId);
|
||||
return JsonHelper.Instance.Serialize(orgs);
|
||||
@@ -120,7 +121,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
/// </summary>
|
||||
/// <param name="firstId">The role identifier.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
public string LoadForRole(Guid firstId)
|
||||
public string LoadForRole(string firstId)
|
||||
{
|
||||
var orgs = App.LoadForRole(firstId);
|
||||
return JsonHelper.Instance.Serialize(orgs);
|
||||
@@ -151,7 +152,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public string Delete(Guid[] ids)
|
||||
public string Delete(string[] ids)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -18,20 +18,20 @@ namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
return View();
|
||||
}
|
||||
public ActionResult Assign(Guid firstId, string key)
|
||||
public ActionResult Assign(string firstId, string key)
|
||||
{
|
||||
ViewBag.FirstId = firstId;
|
||||
ViewBag.ModuleType = key;
|
||||
return View();
|
||||
}
|
||||
|
||||
public string LoadForUser(Guid firstId)
|
||||
public string LoadForUser(string firstId)
|
||||
{
|
||||
var orgs = OrgApp.LoadForUser(firstId);
|
||||
return JsonHelper.Instance.Serialize(orgs);
|
||||
}
|
||||
|
||||
public string LoadForRole(Guid firstId)
|
||||
public string LoadForRole(string firstId)
|
||||
{
|
||||
var orgs = OrgApp.LoadForRole(firstId);
|
||||
return JsonHelper.Instance.Serialize(orgs);
|
||||
@@ -54,7 +54,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return JsonHelper.Instance.Serialize(Result);
|
||||
}
|
||||
|
||||
public string LoadChildren(Guid id)
|
||||
public string LoadChildren(string id)
|
||||
{
|
||||
return JsonHelper.Instance.Serialize(OrgApp.LoadAllChildren(id));
|
||||
}
|
||||
@@ -65,7 +65,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
/// </summary>
|
||||
/// <returns>System.String.</returns>
|
||||
[HttpPost]
|
||||
public string DelOrg(Guid[] ids)
|
||||
public string DelOrg(string[] ids)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
public RevelanceManagerApp App { get; set; }
|
||||
|
||||
[HttpPost]
|
||||
public string Assign(string type, Guid firstId, Guid[] secIds)
|
||||
public string Assign(string type, string firstId, string[] secIds)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -29,7 +29,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return JsonHelper.Instance.Serialize(Result);
|
||||
}
|
||||
[HttpPost]
|
||||
public string UnAssign(string type, Guid firstId, Guid[] secIds)
|
||||
public string UnAssign(string type, string firstId, string[] secIds)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
/// <summary>
|
||||
/// 加载某分类的所有Resources
|
||||
/// </summary>
|
||||
public string Load(Guid categoryId, int page = 1, int rows = 30)
|
||||
public string Load(string categoryId, int page = 1, int rows = 30)
|
||||
{
|
||||
return JsonHelper.Instance.Serialize(App.Load(AuthUtil.GetUserName(), categoryId, page, rows));
|
||||
}
|
||||
@@ -52,7 +52,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public string Delete(Guid[] ids)
|
||||
public string Delete(string[] ids)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -75,7 +75,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
/// <para>如:UserResource/RoleResource</para>
|
||||
/// </param>
|
||||
/// <returns>ActionResult.</returns>
|
||||
public ActionResult AssignRes(Guid firstId, string key)
|
||||
public ActionResult AssignRes(string firstId, string key)
|
||||
{
|
||||
ViewBag.FirstId = firstId;
|
||||
ViewBag.ModuleType = key;
|
||||
@@ -89,7 +89,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
/// <param name="firstId">关联表中的firstId</param>
|
||||
/// <param name="key">关联表中的key</param>
|
||||
/// <returns>System.String.</returns>
|
||||
public string LoadWithAccess(Guid cId, Guid firstId, string key)
|
||||
public string LoadWithAccess(string cId, string firstId, string key)
|
||||
{
|
||||
return JsonHelper.Instance.Serialize(App.LoadWithAccess(AuthUtil.GetUserName(),key,firstId, cId));
|
||||
}
|
||||
|
||||
@@ -39,13 +39,13 @@ namespace OpenAuth.Mvc.Controllers
|
||||
/// <summary>
|
||||
/// 加载角色下面的所有用户
|
||||
/// </summary>
|
||||
public string Load(Guid orgId, int pageCurrent = 1, int pageSize = 30)
|
||||
public string Load(string orgId, int pageCurrent = 1, int pageSize = 30)
|
||||
{
|
||||
return JsonHelper.Instance.Serialize(App.Load(orgId, pageCurrent, pageSize));
|
||||
}
|
||||
|
||||
[System.Web.Mvc.HttpPost]
|
||||
public string Delete(Guid[] ids)
|
||||
public string Delete(string[] ids)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -64,14 +64,14 @@ namespace OpenAuth.Mvc.Controllers
|
||||
}
|
||||
|
||||
#region 为用户设置角色界面
|
||||
public ActionResult LookupMulti(Guid firstId, string key)
|
||||
public ActionResult LookupMulti(string firstId, string key)
|
||||
{
|
||||
ViewBag.FirstId = firstId;
|
||||
ViewBag.ModuleType = key;
|
||||
return View();
|
||||
}
|
||||
|
||||
public string LoadForOrgAndUser(Guid orgId, Guid userId)
|
||||
public string LoadForOrgAndUser(string orgId, string userId)
|
||||
{
|
||||
return JsonHelper.Instance.Serialize(App.LoadForOrgAndUser(orgId, userId));
|
||||
}
|
||||
|
||||
@@ -45,12 +45,12 @@ namespace OpenAuth.Mvc.Controllers
|
||||
/// <summary>
|
||||
/// 加载节点下面的所有Stocks
|
||||
/// </summary>
|
||||
public string Load(Guid parentId, int page = 1, int rows = 30)
|
||||
public string Load(string parentId, int page = 1, int rows = 30)
|
||||
{
|
||||
return JsonHelper.Instance.Serialize(App.Load(AuthUtil.GetUserName(), parentId, page, rows));
|
||||
}
|
||||
|
||||
public string Delete(Guid[] ids)
|
||||
public string Delete(string[] ids)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -40,13 +40,13 @@ namespace OpenAuth.Mvc.Controllers
|
||||
/// <summary>
|
||||
/// 加载组织下面的所有用户
|
||||
/// </summary>
|
||||
public string Load(Guid orgId, int page = 1, int limit = 30)
|
||||
public string Load(string orgId, int page = 1, int limit = 30)
|
||||
{
|
||||
return JsonHelper.Instance.Serialize(App.Load(orgId, page, limit));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public string Delete(Guid[] ids)
|
||||
public string Delete(string[] ids)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -69,7 +69,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
/// </summary>
|
||||
public string GetAccessedUsers()
|
||||
{
|
||||
IEnumerable<UserView> users = App.Load(Guid.Empty, 1, 10).data;
|
||||
IEnumerable<UserView> users = App.Load(string.Empty, 1, 10).data;
|
||||
var result = new Dictionary<string , object>();
|
||||
foreach (var user in users)
|
||||
{
|
||||
|
||||
@@ -17,8 +17,8 @@ namespace OpenAuth.Mvc.Controllers
|
||||
/// </summary>
|
||||
public string GetModulesTree()
|
||||
{
|
||||
|
||||
return JsonHelper.Instance.Serialize(user.Modules.GenerateTree(u => u.Id, u => u.ParentId));
|
||||
var moduleTree = user.Modules.GenerateTree(u => u.Id, u => u.ParentId);
|
||||
return JsonHelper.Instance.Serialize(moduleTree);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user