mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 18:47:55 +08:00
转移.net core 3.1,为.NET 5做准备
This commit is contained in:
84
OpenAuth.Mvc/Controllers/SysLogsController.cs
Normal file
84
OpenAuth.Mvc/Controllers/SysLogsController.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using Infrastructure;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using OpenAuth.App;
|
||||
using OpenAuth.App.Interface;
|
||||
using OpenAuth.App.Request;
|
||||
using OpenAuth.Repository.Domain;
|
||||
|
||||
namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
public class SysLogsController : BaseController
|
||||
{
|
||||
private readonly SysLogApp _app;
|
||||
|
||||
public SysLogsController(SysLogApp app, IAuth auth) : base(auth)
|
||||
{
|
||||
_app = app;
|
||||
}
|
||||
|
||||
//主页
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
//添加或修改
|
||||
[HttpPost]
|
||||
public string Add(SysLog obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
_app.Add(obj);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Result.Code = 500;
|
||||
Result.Message = ex.Message;
|
||||
}
|
||||
return JsonHelper.Instance.Serialize(Result);
|
||||
}
|
||||
|
||||
//添加或修改
|
||||
[HttpPost]
|
||||
public string Update(SysLog obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
_app.Update(obj);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Result.Code = 500;
|
||||
Result.Message = ex.Message;
|
||||
}
|
||||
return JsonHelper.Instance.Serialize(Result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载列表
|
||||
/// </summary>
|
||||
public string Load([FromQuery]QuerySysLogListReq request)
|
||||
{
|
||||
return JsonHelper.Instance.Serialize(_app.Load(request));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public string Delete(string[] ids)
|
||||
{
|
||||
try
|
||||
{
|
||||
_app.Delete(ids);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Result.Code = 500;
|
||||
Result.Message = e.Message;
|
||||
}
|
||||
|
||||
return JsonHelper.Instance.Serialize(Result);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user