mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-04-05 17:38:01 +08:00
check bugs
This commit is contained in:
parent
9e7e8f82ae
commit
6c05096138
9
.gitignore
vendored
9
.gitignore
vendored
@ -25,3 +25,12 @@
|
||||
/OpenAuth.sln.GhostDoc.xml
|
||||
/类结构.mdj
|
||||
/数据库设计关系图/OpenAuthDB.pdb
|
||||
/OpenAuth.WebTest/obj/Release
|
||||
/OpenAuth.UnitTest/obj/Release
|
||||
/OpenAuth.WebApi/obj/Release
|
||||
/OpenAuth.Repository/bin/Release
|
||||
/OpenAuth.Repository/obj/Release
|
||||
/OpenAuth.Mvc/obj/Release
|
||||
/OpenAuth.App/obj/Release
|
||||
/Infrastructure/bin/Release
|
||||
/Infrastructure/obj/Release
|
||||
|
BIN
DOC/核心设计.EAP
BIN
DOC/核心设计.EAP
Binary file not shown.
38
OpenAuth.App/AppManager.cs
Normal file
38
OpenAuth.App/AppManager.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenAuth.App.Request;
|
||||
using OpenAuth.App.Response;
|
||||
using OpenAuth.Repository.Domain;
|
||||
|
||||
namespace OpenAuth.App
|
||||
{
|
||||
/// <summary>
|
||||
/// 分类管理
|
||||
/// </summary>
|
||||
public class AppManager : BaseApp<Application>
|
||||
{
|
||||
public void Add(Application Application)
|
||||
{
|
||||
if (string.IsNullOrEmpty(Application.Id))
|
||||
{
|
||||
Application.Id = Guid.NewGuid().ToString();
|
||||
}
|
||||
Repository.Add(Application);
|
||||
}
|
||||
|
||||
public void Update(Application Application)
|
||||
{
|
||||
Repository.Update(u =>u.Id,Application);
|
||||
}
|
||||
|
||||
|
||||
public List<Application> GetList(QueryAppListReq request)
|
||||
{
|
||||
var applications = UnitWork.Find<Application>(null) ;
|
||||
|
||||
return applications.ToList();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
7
OpenAuth.App/Request/QueryAppListReq.cs
Normal file
7
OpenAuth.App/Request/QueryAppListReq.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace OpenAuth.App.Request
|
||||
{
|
||||
public class QueryAppListReq : PageReq
|
||||
{
|
||||
|
||||
}
|
||||
}
|
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user