mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-21 02:57:54 +08:00
完成资源分配前端模块化处理
This commit is contained in:
55
OpenAuth.Mvc/Controllers/RelevanceManagerController.cs
Normal file
55
OpenAuth.Mvc/Controllers/RelevanceManagerController.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Infrastructure;
|
||||
using OpenAuth.App;
|
||||
using OpenAuth.Mvc.Models;
|
||||
|
||||
namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
public class RelevanceManagerController : BaseController
|
||||
{
|
||||
private RevelanceManagerApp _app;
|
||||
|
||||
public RelevanceManagerController()
|
||||
{
|
||||
_app = AutofacExt.GetFromFac<RevelanceManagerApp>();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Anonymous]
|
||||
public string Assign(string type, int firstId, string secIds)
|
||||
{
|
||||
try
|
||||
{
|
||||
var secIdList = JsonHelper.Instance.Deserialize<int[]>(secIds);
|
||||
_app.Assign(type, firstId, secIdList);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BjuiResponse.statusCode = "300";
|
||||
BjuiResponse.message = ex.Message;
|
||||
}
|
||||
return JsonHelper.Instance.Serialize(BjuiResponse);
|
||||
}
|
||||
[HttpPost]
|
||||
[Anonymous]
|
||||
public string UnAssign(string type, int firstId, string secIds)
|
||||
{
|
||||
try
|
||||
{
|
||||
var secIdList = JsonHelper.Instance.Deserialize<int[]>(secIds);
|
||||
_app.UnAssign(type, firstId, secIdList);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BjuiResponse.statusCode = "300";
|
||||
BjuiResponse.message = ex.Message;
|
||||
}
|
||||
return JsonHelper.Instance.Serialize(BjuiResponse);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user