mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-22 12:09:19 +08:00
优化代码结构,完成分类处理
This commit is contained in:
@@ -13,7 +13,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
|
||||
public CategoryManagerController()
|
||||
{
|
||||
_app = (CategoryManagerApp)DependencyResolver.Current.GetService(typeof(CategoryManagerApp));
|
||||
_app = AutofacExt.GetFromFac<CategoryManagerApp>();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -23,6 +23,28 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return View();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载组织下面的所有用户
|
||||
/// </summary>
|
||||
public string Load(int orgId, int pageCurrent = 1, int pageSize = 30)
|
||||
{
|
||||
return JsonHelper.Instance.Serialize(_app.Load(orgId, pageCurrent, pageSize));
|
||||
}
|
||||
|
||||
public string LoadForTree()
|
||||
{
|
||||
var models = _app.LoadAll();
|
||||
//添加根节点
|
||||
models.Add(new Category
|
||||
{
|
||||
Id = 0,
|
||||
ParentId = -1,
|
||||
Name = "根结点",
|
||||
CascadeId = "0"
|
||||
});
|
||||
return JsonHelper.Instance.Serialize(models);
|
||||
}
|
||||
|
||||
public ActionResult Add(int id = 0)
|
||||
{
|
||||
return View(_app.Find(id));
|
||||
@@ -45,14 +67,6 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return JsonHelper.Instance.Serialize(BjuiResponse);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载组织下面的所有用户
|
||||
/// </summary>
|
||||
public string Load(int orgId, int pageCurrent = 1, int pageSize = 30)
|
||||
{
|
||||
return JsonHelper.Instance.Serialize(_app.Load(orgId, pageCurrent, pageSize));
|
||||
}
|
||||
|
||||
public string Delete(int Id)
|
||||
{
|
||||
try
|
||||
|
Reference in New Issue
Block a user