UserService.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <?php
  2. namespace App\JsonRpc;
  3. use Hyperf\RpcClient\AbstractServiceClient;
  4. class UserService extends AbstractServiceClient implements UserServiceInterface
  5. {
  6. /**
  7. * 定义对应服务提供者的服务名称
  8. * @var string
  9. */
  10. protected string $serviceName = 'UserService';
  11. /**
  12. * 定义对应服务提供者的服务协议
  13. * @var string
  14. */
  15. protected string $protocol = 'jsonrpc-http';
  16. /**
  17. * @param string $name
  18. * @param int $gender
  19. * @return mixed|string
  20. */
  21. public function createUser(array $data)
  22. {
  23. return $this->__request(__FUNCTION__, $data);
  24. }
  25. /**
  26. * @param int $id
  27. * @return array|mixed
  28. */
  29. public function getUserInfo(int $id)
  30. {
  31. return $this->__request(__FUNCTION__, compact('id'));
  32. }
  33. /**
  34. * @param array $data
  35. * @return array|mixed
  36. */
  37. public function getUserList(array $data)
  38. {
  39. return $this->__request(__FUNCTION__, $data);
  40. }
  41. /**
  42. * @param array $data
  43. * @return mixed
  44. */
  45. public function verifyUserInfo(array $data)
  46. {
  47. return $this->__request(__FUNCTION__, $data);
  48. }
  49. /**
  50. * @remark 创建登录日志信息
  51. * @param array $data
  52. */
  53. public function createUserLogin(array $data): mixed{
  54. return $this->__request(__FUNCTION__, $data);
  55. }
  56. /**
  57. * 更新用户信息
  58. * @param array $data
  59. */
  60. public function updateUser(array $data): mixed{
  61. return $this->__request(__FUNCTION__, $data);
  62. }
  63. /**
  64. * 更新用户
  65. * @param array $data
  66. */
  67. public function updateUserInfo(array $data){
  68. return $this->__request(__FUNCTION__, $data);
  69. }
  70. /**
  71. * 删除用户
  72. * @param int $id
  73. */
  74. public function delUser(int $id){
  75. return $this->__request(__FUNCTION__, compact('id'));
  76. }
  77. /**
  78. * 添加角色
  79. * @param array $data
  80. * @return array
  81. */
  82. public function addRole(array $data){
  83. return $this->__request(__FUNCTION__, $data);
  84. }
  85. /**
  86. * 删除角色
  87. * @param array $data
  88. * @return array
  89. */
  90. public function delRole(array $data){
  91. return $this->__request(__FUNCTION__, $data);
  92. }
  93. /**
  94. * 更新角色
  95. * @param array $data
  96. * @return array
  97. */
  98. public function updateRole(array $data){
  99. return $this->__request(__FUNCTION__, $data);
  100. }
  101. /**
  102. * 角色列表
  103. * @param array $data
  104. * @return array
  105. */
  106. public function roleList(array $data){
  107. return $this->__request(__FUNCTION__, $data);
  108. }
  109. /**
  110. * 角色信息
  111. * @param array $data
  112. * @return array
  113. */
  114. public function roleInfo(array $data){
  115. return $this->__request(__FUNCTION__, $data);
  116. }
  117. /**
  118. * @param array $data
  119. * @return array|mixed
  120. */
  121. public function getWechatInfo(array $data){
  122. return $this->__request(__FUNCTION__, $data);
  123. }
  124. /**
  125. * @param array $data
  126. * @return array|mixed
  127. */
  128. public function addWechatInfo(array $data){
  129. return $this->__request(__FUNCTION__, $data);
  130. }
  131. /**
  132. * @param array $data
  133. * @return array|mixed
  134. */
  135. public function changePassword(array $data){
  136. return $this->__request(__FUNCTION__, $data);
  137. }
  138. /**
  139. * @param array $data
  140. * @return array|mixed
  141. */
  142. public function upUserStatus(array $data){
  143. return $this->__request(__FUNCTION__, $data);
  144. }
  145. /**
  146. * @param array $data
  147. * @return array|mixed
  148. */
  149. public function resetPassword(array $data){
  150. return $this->__request(__FUNCTION__, $data);
  151. }
  152. /**
  153. * @param array $data
  154. * @return array|mixed
  155. */
  156. public function updateUserAvatarNickname(array $data){
  157. return $this->__request(__FUNCTION__, $data);
  158. }
  159. /**
  160. * @param array $data
  161. * @return array|mixed
  162. */
  163. public function getWebsiteGroupInfo(array $data){
  164. return $this->__request(__FUNCTION__, $data);
  165. }
  166. }