平安校园
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.

IndexController.cs 2.5 KiB

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