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

200 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. /// <param name="input"></param>
  118. /// <returns></returns>
  119. [HttpGet("shortcutTree")]
  120. public async Task<dynamic> ShortcutTree()
  121. {
  122. return await _userCenterService.ShortcutTree();
  123. }
  124. #endregion
  125. #region Post
  126. /// <summary>
  127. /// 编辑个人信息
  128. /// </summary>
  129. /// <param name="input"></param>
  130. /// <returns></returns>
  131. [HttpPost("updateUserInfo")]
  132. [DisplayName("编辑个人信息")]
  133. public async Task UpdateUserInfo([FromBody] UpdateInfoInput input)
  134. {
  135. await _userCenterService.UpdateUserInfo(input);
  136. }
  137. /// <summary>
  138. /// 更新签名
  139. /// </summary>
  140. /// <param name="input"></param>
  141. /// <returns></returns>
  142. [HttpPost("updateSignature")]
  143. [DisplayName("更新签名")]
  144. public async Task UpdateSignature([FromBody] UpdateSignatureInput input)
  145. {
  146. await _userCenterService.UpdateSignature(input);
  147. }
  148. /// <summary>
  149. /// 编辑工作台
  150. /// </summary>
  151. /// <param name="input"></param>
  152. /// <returns></returns>
  153. [HttpPost("updateUserWorkbench")]
  154. [DisplayName("编辑工作台")]
  155. public async Task UpdateUserWorkbench([FromBody] UpdateWorkbenchInput input)
  156. {
  157. await _userCenterService.UpdateWorkbench(input);
  158. }
  159. #endregion
  160. }