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

199 lines
4.7 KiB

  1. //
  2. namespace SafeCampus.Web.Core;
  3. /// <summary>
  4. /// 用户个人信息控制器
  5. /// </summary>
  6. [ApiDescriptionSettings(Tag = "用户个人信息控制器")]
  7. [Route("userCenter")]
  8. public class UserCenterController : BaseController
  9. {
  10. private readonly IUserCenterService _userCenterService;
  11. public UserCenterController(IUserCenterService userCenterService)
  12. {
  13. _userCenterService = userCenterService;
  14. }
  15. #region Get
  16. /// <summary>
  17. /// 获取个人菜单
  18. /// </summary>
  19. /// <returns></returns>
  20. [HttpGet("loginMenu")]
  21. public async Task<dynamic> LoginMenu([FromQuery] BaseIdInput input)
  22. {
  23. return await _userCenterService.GetLoginMenu(input);
  24. }
  25. /// <summary>
  26. /// 获取个人工作台
  27. /// </summary>
  28. /// <returns></returns>
  29. [HttpGet("loginWorkbench")]
  30. public async Task<dynamic> LoginWorkbench()
  31. {
  32. return await _userCenterService.GetLoginWorkbench();
  33. }
  34. /// <summary>
  35. /// 获取组织架构
  36. /// </summary>
  37. /// <returns></returns>
  38. [HttpGet("loginOrgTree")]
  39. public async Task<dynamic> LoginOrgTree()
  40. {
  41. return await _userCenterService.LoginOrgTree();
  42. }
  43. /// <summary>
  44. /// 获取登录用户的站内信分页
  45. /// </summary>
  46. /// <param name="input"></param>
  47. /// <returns></returns>
  48. [HttpGet("loginUnreadMessagePage")]
  49. public async Task<dynamic> LoginUnreadMessagePage([FromQuery] MessagePageInput input)
  50. {
  51. return await _userCenterService.LoginMessagePage(input);
  52. }
  53. /// <summary>
  54. /// 读取登录用户站内信详情
  55. /// </summary>
  56. /// <param name="input"></param>
  57. /// <returns></returns>
  58. [HttpGet("loginUnreadMessageDetail")]
  59. public async Task<dynamic> LoginUnreadMessageDetail([FromQuery] BaseIdInput input)
  60. {
  61. return await _userCenterService.LoginMessageDetail(input);
  62. }
  63. /// <summary>
  64. /// 未读消息数
  65. /// </summary>
  66. /// <returns></returns>
  67. [HttpGet("UnReadCount")]
  68. public async Task<dynamic> UnReadCount()
  69. {
  70. return await _userCenterService.UnReadCount();
  71. }
  72. /// <summary>
  73. /// 删除我的消息
  74. /// </summary>
  75. /// <param name="input"></param>
  76. /// <returns></returns>
  77. [HttpPost("deleteMessage")]
  78. [DisplayName("删除个人消息")]
  79. public async Task DeleteMessage([FromBody] BaseIdInput input)
  80. {
  81. await _userCenterService.DeleteMyMessage(input);
  82. }
  83. /// <summary>
  84. /// 修改密码
  85. /// </summary>
  86. /// <param name="input"></param>
  87. /// <returns></returns>
  88. [HttpPost("updatePassword")]
  89. [DisplayName("修改密码")]
  90. public async Task UpdatePassword([FromBody] UpdatePasswordInput input)
  91. {
  92. await _userCenterService.UpdatePassword(input);
  93. }
  94. /// <summary>
  95. /// 修改头像
  96. /// </summary>
  97. /// <param name="input"></param>
  98. /// <returns></returns>
  99. [HttpPost("updateAvatar")]
  100. [DisplayName("修改头像")]
  101. public async Task<dynamic> UpdateAvatar([FromForm] BaseFileInput input)
  102. {
  103. return await _userCenterService.UpdateAvatar(input);
  104. }
  105. /// <summary>
  106. /// 修改默认模块
  107. /// </summary>
  108. /// <param name="input"></param>
  109. [HttpPost("setDefaultModule")]
  110. public async Task SetDefaultModule([FromBody] SetDefaultModuleInput input)
  111. {
  112. await _userCenterService.SetDefaultModule(input);
  113. }
  114. /// <summary>
  115. /// 快捷方式菜单树
  116. /// </summary>
  117. /// <returns></returns>
  118. [HttpGet("shortcutTree")]
  119. public async Task<dynamic> ShortcutTree()
  120. {
  121. return await _userCenterService.ShortcutTree();
  122. }
  123. #endregion
  124. #region Post
  125. /// <summary>
  126. /// 编辑个人信息
  127. /// </summary>
  128. /// <param name="input"></param>
  129. /// <returns></returns>
  130. [HttpPost("updateUserInfo")]
  131. [DisplayName("编辑个人信息")]
  132. public async Task UpdateUserInfo([FromBody] UpdateInfoInput input)
  133. {
  134. await _userCenterService.UpdateUserInfo(input);
  135. }
  136. /// <summary>
  137. /// 更新签名
  138. /// </summary>
  139. /// <param name="input"></param>
  140. /// <returns></returns>
  141. [HttpPost("updateSignature")]
  142. [DisplayName("更新签名")]
  143. public async Task UpdateSignature([FromBody] UpdateSignatureInput input)
  144. {
  145. await _userCenterService.UpdateSignature(input);
  146. }
  147. /// <summary>
  148. /// 编辑工作台
  149. /// </summary>
  150. /// <param name="input"></param>
  151. /// <returns></returns>
  152. [HttpPost("updateUserWorkbench")]
  153. [DisplayName("编辑工作台")]
  154. public async Task UpdateUserWorkbench([FromBody] UpdateWorkbenchInput input)
  155. {
  156. await _userCenterService.UpdateWorkbench(input);
  157. }
  158. #endregion
  159. }