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

104 lines
2.3 KiB

  1. //
  2. namespace SafeCampus.Web.Core;
  3. /// <summary>
  4. /// 会话管理控制器
  5. /// </summary>
  6. [ApiDescriptionSettings(Tag = "会话管理")]
  7. [Route("sys/auth/[controller]")]
  8. [SuperAdmin]
  9. public class SessionController : BaseController
  10. {
  11. private readonly ISessionService _sessionService;
  12. public SessionController(ISessionService sessionService)
  13. {
  14. _sessionService = sessionService;
  15. }
  16. /// <summary>
  17. /// B端会话分页
  18. /// </summary>
  19. /// <param name="input"></param>
  20. /// <returns></returns>
  21. [HttpGet("b/page")]
  22. public async Task<dynamic> PageB([FromQuery] SessionPageInput input)
  23. {
  24. return await _sessionService.PageB(input);
  25. }
  26. /// <summary>
  27. /// C端会话分页
  28. /// </summary>
  29. /// <param name="input"></param>
  30. /// <returns></returns>
  31. [HttpGet("c/page")]
  32. public async Task<dynamic> PageC([FromQuery] SessionPageInput input)
  33. {
  34. return await _sessionService.PageC(input);
  35. }
  36. /// <summary>
  37. /// 会话统计
  38. /// </summary>
  39. /// <returns></returns>
  40. [HttpGet("analysis")]
  41. public dynamic Analysis()
  42. {
  43. return _sessionService.Analysis();
  44. }
  45. /// <summary>
  46. /// 强退B端会话
  47. /// </summary>
  48. /// <param name="input"></param>
  49. [HttpPost("b/exitSession")]
  50. [DisplayName("强退B端会话")]
  51. public async Task ExitSessionForB([FromBody] BaseIdInput input)
  52. {
  53. await _sessionService.ExitSession(input);
  54. }
  55. /// <summary>
  56. /// 强退C端会话
  57. /// </summary>
  58. /// <param name="input"></param>
  59. [HttpPost("c/exitSession")]
  60. [DisplayName("强退C端会话")]
  61. public async Task ExitSessionForC([FromBody] BaseIdInput input)
  62. {
  63. await _sessionService.ExitSession(input);
  64. }
  65. /// <summary>
  66. /// 强退B端Token
  67. /// </summary>
  68. /// <param name="input"></param>
  69. [HttpPost("b/ExitToken")]
  70. [DisplayName("强退B端Token")]
  71. public async Task ExitTokenForB([FromBody] ExitTokenInput input)
  72. {
  73. await _sessionService.ExitToken(input);
  74. }
  75. /// <summary>
  76. /// 强退C端Token
  77. /// </summary>
  78. /// <param name="input"></param>
  79. [HttpPost("c/ExitToken")]
  80. [DisplayName("强退C端Token")]
  81. public async Task ExitTokenForC([FromBody] ExitTokenInput input)
  82. {
  83. await _sessionService.ExitToken(input);
  84. }
  85. }