LogController.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using LeaRun.Application.Busines.SystemManage;
  2. using LeaRun.Application.Code;
  3. using LeaRun.Util;
  4. using LeaRun.Util.WebControl;
  5. using System.Web.Mvc;
  6. namespace LeaRun.Application.Web.Areas.SystemManage.Controllers
  7. {
  8. /// <summary>
  9. /// 版 本 6.1
  10. /// Copyright (c) 2013-2016 上海力软信息技术有限公司
  11. /// 创建人:佘赐雄
  12. /// 日 期:2015.11.18 9:56
  13. /// 描 述:系统日志
  14. /// </summary>
  15. public class LogController : MvcControllerBase
  16. {
  17. #region 视图功能
  18. /// <summary>
  19. /// 日志管理
  20. /// </summary>
  21. /// <returns></returns>
  22. [HttpGet]
  23. [HandlerAuthorize(PermissionMode.Enforce)]
  24. public ActionResult Index()
  25. {
  26. return View();
  27. }
  28. /// <summary>
  29. /// 清空日志
  30. /// </summary>
  31. /// <returns></returns>
  32. [HttpGet]
  33. [HandlerAuthorize(PermissionMode.Enforce)]
  34. public ActionResult RemoveLog()
  35. {
  36. return View();
  37. }
  38. #endregion
  39. #region 获取数据
  40. /// <summary>
  41. /// 日志列表
  42. /// </summary>
  43. /// <param name="pagination">分页参数</param>
  44. /// <param name="queryJson">查询参数</param>
  45. /// <returns>返回分页列表Json</returns>
  46. [HttpGet]
  47. public ActionResult GetPageListJson(Pagination pagination, string queryJson)
  48. {
  49. var watch = CommonHelper.TimerStart();
  50. var data = LogBLL.GetPageList(pagination, queryJson);
  51. var JsonData = new
  52. {
  53. rows = data,
  54. total = pagination.total,
  55. page = pagination.page,
  56. records = pagination.records,
  57. costtime = CommonHelper.TimerEnd(watch)
  58. };
  59. return Content(JsonData.ToJson());
  60. }
  61. #endregion
  62. #region 提交数据
  63. /// <summary>
  64. /// 清空日志
  65. /// </summary>
  66. /// <param name="categoryId">日志分类Id</param>
  67. /// <param name="keepTime">保留时间段内</param>
  68. /// <returns></returns>
  69. [HttpPost]
  70. [ValidateAntiForgeryToken]
  71. [AjaxOnly]
  72. public ActionResult RemoveLog(int categoryId, string keepTime)
  73. {
  74. LogBLL.RemoveLog(categoryId, keepTime);
  75. return Success("清空成功。");
  76. }
  77. #endregion
  78. }
  79. }