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

SessionController.cs 2.3 KiB

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