完成资源分配前端模块化处理

This commit is contained in:
yubaolee
2016-04-17 23:16:58 +08:00
parent 2f0a9a3719
commit 40ffa5f1e8
16 changed files with 285 additions and 398 deletions

View 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);
}
}
}