平安校园
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

100 lines
2.5 KiB

  1. //
  2. namespace SafeCampus.Web.Core;
  3. /// <summary>
  4. /// 系统首页控制器
  5. /// </summary>
  6. [ApiDescriptionSettings(Tag = "系统首页")]
  7. [Route("home/index")]
  8. [RolePermission]
  9. public class IndexController : BaseController
  10. {
  11. private readonly IVisitLogService _visitLogService;
  12. private readonly IOperateLogService _operateLogService;
  13. private readonly IIndexService _indexService;
  14. public IndexController(IVisitLogService visitLogService, IOperateLogService operateLogService, IIndexService indexService)
  15. {
  16. _visitLogService = visitLogService;
  17. _operateLogService = operateLogService;
  18. _indexService = indexService;
  19. }
  20. /// <summary>
  21. /// 获取当前用户访问日志列表
  22. /// </summary>
  23. /// <returns></returns>
  24. [HttpGet("visLog/list")]
  25. [DisplayName("访问日志")]
  26. public async Task<dynamic> VisLogList()
  27. {
  28. return await _visitLogService.Page(new VisitLogPageInput { Account = UserManager.UserAccount });
  29. }
  30. /// <summary>
  31. /// 获取当前用户操作日志列表
  32. /// </summary>
  33. /// <returns></returns>
  34. [HttpGet("opLog/list")]
  35. [DisplayName("操作日志")]
  36. public async Task<dynamic> OpLogList()
  37. {
  38. return await _operateLogService.Page(new OperateLogPageInput { Account = UserManager.UserAccount });
  39. }
  40. /// <summary>
  41. /// 获取当前用户站内信列表
  42. /// </summary>
  43. /// <returns></returns>
  44. [HttpGet("message/list")]
  45. [DisplayName("站内信列表")]
  46. public async Task<dynamic> MessageList()
  47. {
  48. return new string[] { };
  49. }
  50. /// <summary>
  51. /// 获取当前用户日程列表
  52. /// </summary>
  53. /// <returns></returns>
  54. [HttpGet("schedule/list")]
  55. [DisplayName("日程列表")]
  56. public async Task<dynamic> ScheduleList([FromQuery] ScheduleListInput input)
  57. {
  58. return await _indexService.ScheduleList(input);
  59. }
  60. /// <summary>
  61. /// 添加日程
  62. /// </summary>
  63. /// <param name="input"></param>
  64. /// <returns></returns>
  65. [HttpPost("schedule/add")]
  66. [DisplayName("添加日程")]
  67. public async Task AddSchedule([FromBody] ScheduleAddInput input)
  68. {
  69. await _indexService.AddSchedule(input);
  70. }
  71. /// <summary>
  72. /// 删除日程
  73. /// </summary>
  74. /// <param name="input"></param>
  75. /// <returns></returns>
  76. [HttpPost("schedule/deleteSchedule")]
  77. [DisplayName("删除日程")]
  78. public async Task DeleteSchedule([FromBody] BaseIdListInput input)
  79. {
  80. await _indexService.DeleteSchedule(input);
  81. }
  82. }