UserAuthService.java 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /*
  2. * *************************************************
  3. * Copyright (c) 2018 QMTH. All Rights Reserved.
  4. * Created by Deason on 2018-07-31 17:40:42.
  5. * *************************************************
  6. */
  7. package cn.com.qmth.examcloud.app.service;
  8. import cn.com.qmth.examcloud.app.model.LoginInfo;
  9. import cn.com.qmth.examcloud.app.model.Result;
  10. import cn.com.qmth.examcloud.app.model.UserInfo;
  11. /**
  12. * 认证中心业务服务接口
  13. *
  14. * @author: fengdesheng
  15. * @since: 2018/7/31
  16. */
  17. public interface UserAuthService {
  18. /**
  19. * 用户登录
  20. *
  21. * @param loginInfo
  22. * @return
  23. * @throws Exception
  24. */
  25. Result<UserInfo> login(LoginInfo loginInfo) throws Exception;
  26. /**
  27. * 用户退出登录
  28. *
  29. * @param key
  30. * @param token
  31. * @return
  32. * @throws Exception
  33. */
  34. Result logout(String key, String token) throws Exception;
  35. /**
  36. * 获取用户信息
  37. *
  38. * @param key
  39. * @param token
  40. * @return
  41. * @throws Exception
  42. */
  43. @Deprecated
  44. Result getUserInfo(String key, String token) throws Exception;
  45. /**
  46. * 修改密码
  47. *
  48. * @param key
  49. * @param token
  50. * @param studentId
  51. * @param password
  52. * @param newPassword
  53. * @return
  54. * @throws Exception
  55. */
  56. Result updateStudentPassword(String key, String token, Long studentId, String password, String newPassword) throws Exception;
  57. /**
  58. * 重置密码
  59. *
  60. * @param key
  61. * @param token
  62. * @param newPassword
  63. * @return
  64. * @throws Exception
  65. */
  66. Result resetStudentPassword(String key, String token, String newPassword) throws Exception;
  67. /**
  68. * 获取短信验证码
  69. *
  70. * @param key
  71. * @param token
  72. * @param phone
  73. * @return
  74. * @throws Exception
  75. */
  76. Result sendSmsCode(String key, String token, String phone) throws Exception;
  77. /**
  78. * 获取短信验证码
  79. *
  80. * @param key
  81. * @param token
  82. * @param phone
  83. * @return
  84. * @throws Exception
  85. */
  86. Result code4Student(Long rootOrgId, String phone, Boolean bound) throws Exception;
  87. /**
  88. * 保存用户绑定的手机号
  89. *
  90. * @param key
  91. * @param token
  92. * @param phone
  93. * @param code
  94. * @return
  95. * @throws Exception
  96. */
  97. Result userBindingPhone(String key, String token, String phone, String code) throws Exception;
  98. /**
  99. * 缓存用户登录信息
  100. *
  101. * @param loginInfo
  102. * @param key
  103. */
  104. void cacheLoginInfo(LoginInfo loginInfo, String key);
  105. /**
  106. * 获取缓存中的用户登录信息
  107. *
  108. * @param key
  109. * @return
  110. */
  111. LoginInfo getLoginInfo(String key);
  112. /**
  113. * 获取平台端的默认过期时间(秒)
  114. *
  115. * @return
  116. */
  117. int getSessionTimeout();
  118. /**
  119. * 初始化内部接口请求鉴权
  120. */
  121. void initRequestTrace();
  122. }