mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-19 18:22:11 +08:00
check bugs
This commit is contained in:
72
OpenAuth.Mvc/Controllers/ApplicationsController.cs
Normal file
72
OpenAuth.Mvc/Controllers/ApplicationsController.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Web.Http;
|
||||
using System.Web.Mvc;
|
||||
using Infrastructure;
|
||||
using OpenAuth.App;
|
||||
using OpenAuth.App.Request;
|
||||
using OpenAuth.App.Response;
|
||||
using OpenAuth.Repository.Domain;
|
||||
|
||||
namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
public class ApplicationsController : BaseController
|
||||
{
|
||||
public AppManager App { get; set; }
|
||||
|
||||
|
||||
public string GetList([FromUri]QueryAppListReq request)
|
||||
{
|
||||
return JsonHelper.Instance.Serialize(App.GetList(request));
|
||||
}
|
||||
|
||||
[System.Web.Mvc.HttpPost]
|
||||
public string Delete(string[] ids)
|
||||
{
|
||||
Response resp = new Response();
|
||||
try
|
||||
{
|
||||
App.Delete(ids);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
resp.Code = 500;
|
||||
resp.Message = e.Message;
|
||||
}
|
||||
return JsonHelper.Instance.Serialize(resp);
|
||||
}
|
||||
|
||||
[System.Web.Mvc.HttpPost]
|
||||
public string Add(Application obj)
|
||||
{
|
||||
Response resp = new Response();
|
||||
try
|
||||
{
|
||||
App.Add(obj);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
resp.Code = 500;
|
||||
resp.Message = e.Message;
|
||||
}
|
||||
return JsonHelper.Instance.Serialize(resp);
|
||||
}
|
||||
|
||||
[System.Web.Mvc.HttpPost]
|
||||
public string Update(Application obj)
|
||||
{
|
||||
Response resp = new Response();
|
||||
try
|
||||
{
|
||||
App.Update(obj);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
resp.Code = 500;
|
||||
resp.Message = e.Message;
|
||||
}
|
||||
return JsonHelper.Instance.Serialize(resp);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user