UserService.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 mixed
  36. */
  37. public function verifyUserInfo(array $data)
  38. {
  39. return $this->__request(__FUNCTION__, $data);
  40. }
  41. /**
  42. * @remark 创建登录日志信息
  43. * @param array $data
  44. */
  45. public function createUserLogin(array $data){
  46. return $this->__request(__FUNCTION__, $data);
  47. }
  48. /**
  49. * 更新用户信息
  50. * @param array $data
  51. */
  52. public function updateUser(array $data){
  53. return $this->__request(__FUNCTION__, $data);
  54. }
  55. /**
  56. * 更新用户
  57. * @param array $data
  58. */
  59. public function updateUserInfo(array $data){
  60. return $this->__request(__FUNCTION__, $data);
  61. }
  62. /**
  63. * 删除用户
  64. * @param int $id
  65. */
  66. public function delUser(int $id){
  67. return $this->__request(__FUNCTION__, compact('id'));
  68. }
  69. }