平安校园
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

UserCenterController.cs 4.7 KiB

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