SysOperationLogController.cs
2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using HHECS.Application.Service;
using HHECS.Infrastructure.Json;
using HHECS.Model.Entities;
using HHECS.Model.ViewEntity;
using HHECS.WebCommon.Config;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Linq;
namespace HHECS.Web.Areas.SysLog.Controllers
{
[Area("SysLog")]
public class SysOperationLogController : BaseController
{
private readonly LogService _logService;
private readonly PermissionService _permissionService;
public SysOperationLogController(LogService logService, PermissionService permissionService)
{
_logService = logService;
_permissionService = permissionService;
}
[ServiceFilter(typeof(OperLogFilter))]
public IActionResult Index()
{
return View();
}
/// <summary>
/// 加载操作日志记录
/// </summary>
[HttpPost]
public string Load(PageReq pageRequest, WebOperationLog entity)
{
return _logService.Load(entity, pageRequest.page, pageRequest.limit);
}
#region 自定义方法
[HttpPost]
public string GetSysModular()
{
return _permissionService.GetPermissions("WEB");
}
[HttpPost]
public string GetUser()
{
return _permissionService.GetUsers();
}
[HttpPost]
public string GetOperType()
{
var data = ConfigRead.GetInstance.GetOperType().Select(t => new { Name = t.Value }).DistinctBy(x => x.Name).ToList();
data.Add(new { Name = "其他" });
var response = new Response
{
Result = data
};
return JsonHelper.Instance.Serialize(response);
}
[HttpPost]
public string GetResult()
{
var response = new Response()
{
Result = new List<object>()
{
new { Name = "成功", Value = true },
new { Name = "失败", Value = false }
}
};
return JsonHelper.Instance.Serialize(response);
}
#endregion
/// <summary>
/// 导出数据
/// </summary>
/// <param name="entity">请求条件实例</param>
/// <returns></returns>
[HttpPost]
public string Export(WebOperationLog entity)
{
return _logService.Export(entity);
}
}
}