平安校园
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

UserCenterController.cs 4.7 KiB

pirms 4 mēnešiem
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. 
  2. //
  3. namespace SafeCampus.Web.Core;
  4. /// <summary>
  5. /// 用户个人信息控制器
  6. /// </summary>
  7. [ApiDescriptionSettings(Tag = "用户个人信息控制器")]
  8. [Route("userCenter")]
  9. public class UserCenterController : BaseController
  10. {
  11. private readonly IUserCenterService _userCenterService;
  12. public UserCenterController(IUserCenterService userCenterService)
  13. {
  14. _userCenterService = userCenterService;
  15. }
  16. #region Get
  17. /// <summary>
  18. /// 获取个人菜单
  19. /// </summary>
  20. /// <returns></returns>
  21. [HttpGet("loginMenu")]
  22. public async Task<dynamic> LoginMenu([FromQuery] BaseIdInput input)
  23. {
  24. return await _userCenterService.GetLoginMenu(input);
  25. }
  26. /// <summary>
  27. /// 获取个人工作台
  28. /// </summary>
  29. /// <returns></returns>
  30. [HttpGet("loginWorkbench")]
  31. public async Task<dynamic> LoginWorkbench()
  32. {
  33. return await _userCenterService.GetLoginWorkbench();
  34. }
  35. /// <summary>
  36. /// 获取组织架构
  37. /// </summary>
  38. /// <returns></returns>
  39. [HttpGet("loginOrgTree")]
  40. public async Task<dynamic> LoginOrgTree()
  41. {
  42. return await _userCenterService.LoginOrgTree();
  43. }
  44. /// <summary>
  45. /// 获取登录用户的站内信分页
  46. /// </summary>
  47. /// <param name="input"></param>
  48. /// <returns></returns>
  49. [HttpGet("loginUnreadMessagePage")]
  50. public async Task<dynamic> LoginUnreadMessagePage([FromQuery] MessagePageInput input)
  51. {
  52. return await _userCenterService.LoginMessagePage(input);
  53. }
  54. /// <summary>
  55. /// 读取登录用户站内信详情
  56. /// </summary>
  57. /// <param name="input"></param>
  58. /// <returns></returns>
  59. [HttpGet("loginUnreadMessageDetail")]
  60. public async Task<dynamic> LoginUnreadMessageDetail([FromQuery] BaseIdInput input)
  61. {
  62. return await _userCenterService.LoginMessageDetail(input);
  63. }
  64. /// <summary>
  65. /// 未读消息数
  66. /// </summary>
  67. /// <returns></returns>
  68. [HttpGet("UnReadCount")]
  69. public async Task<dynamic> UnReadCount()
  70. {
  71. return await _userCenterService.UnReadCount();
  72. }
  73. /// <summary>
  74. /// 删除我的消息
  75. /// </summary>
  76. /// <param name="input"></param>
  77. /// <returns></returns>
  78. [HttpPost("deleteMessage")]
  79. [DisplayName("删除个人消息")]
  80. public async Task DeleteMessage([FromBody] BaseIdInput input)
  81. {
  82. await _userCenterService.DeleteMyMessage(input);
  83. }
  84. /// <summary>
  85. /// 修改密码
  86. /// </summary>
  87. /// <param name="input"></param>
  88. /// <returns></returns>
  89. [HttpPost("updatePassword")]
  90. [DisplayName("修改密码")]
  91. public async Task UpdatePassword([FromBody] UpdatePasswordInput input)
  92. {
  93. await _userCenterService.UpdatePassword(input);
  94. }
  95. /// <summary>
  96. /// 修改头像
  97. /// </summary>
  98. /// <param name="input"></param>
  99. /// <returns></returns>
  100. [HttpPost("updateAvatar")]
  101. [DisplayName("修改头像")]
  102. public async Task<dynamic> UpdateAvatar([FromForm] BaseFileInput input)
  103. {
  104. return await _userCenterService.UpdateAvatar(input);
  105. }
  106. /// <summary>
  107. /// 修改默认模块
  108. /// </summary>
  109. /// <param name="input"></param>
  110. [HttpPost("setDefaultModule")]
  111. public async Task SetDefaultModule([FromBody] SetDefaultModuleInput input)
  112. {
  113. await _userCenterService.SetDefaultModule(input);
  114. }
  115. /// <summary>
  116. /// 快捷方式菜单树
  117. /// </summary>
  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. }