ClientService.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. namespace App\JsonRpc;
  3. use Hyperf\RpcClient\AbstractServiceClient;
  4. use Hyperf\Logger\LoggerFactory;
  5. use Psr\Log\LoggerInterface;
  6. class ClientService extends AbstractServiceClient implements ClientServiceInterface
  7. {
  8. /**
  9. * 定义对应服务提供者的服务名称
  10. * @var string
  11. */
  12. protected string $serviceName = 'ClientService';
  13. /**
  14. * 定义对应服务提供者的服务协议
  15. * @var string
  16. */
  17. protected string $protocol = 'jsonrpc-http';
  18. protected $logger;
  19. public function __construct(LoggerFactory $loggerFactory)
  20. {
  21. $this->logger = $loggerFactory->get('default');
  22. }
  23. /**
  24. * test
  25. * @param array $data
  26. * @return array
  27. */
  28. public function test(array $data): array
  29. {
  30. return $this->__request(__FUNCTION__, $data);
  31. }
  32. public function indexData(array $data): array
  33. {
  34. return $this->__request(__FUNCTION__, $data);
  35. }
  36. public function addWeb(array $data): array
  37. {
  38. return $this->__request(__FUNCTION__, $data);
  39. }
  40. public function deleteWeb(array $data): array
  41. {
  42. return $this->__request(__FUNCTION__, $data);
  43. }
  44. public function updateWeb(array $data): array
  45. {
  46. return $this->__request(__FUNCTION__, $data);
  47. }
  48. public function getWebList(array $data): array
  49. {
  50. return $this->__request(__FUNCTION__, $data);
  51. }
  52. public function getWebInfo(array $data): array
  53. {
  54. return $this->__request(__FUNCTION__, $data);
  55. }
  56. public function updateWebConfig(array $data): array
  57. {
  58. return $this->__request(__FUNCTION__, $data);
  59. }
  60. public function updateWebOutput(array $data): array
  61. {
  62. return $this->__request(__FUNCTION__, $data);
  63. }
  64. public function updateWebMove(array $data): array
  65. {
  66. return $this->__request(__FUNCTION__, $data);
  67. }
  68. public function runWeb(array $data): array
  69. {
  70. return $this->__request(__FUNCTION__, $data);
  71. }
  72. public function stopWeb(array $data): array
  73. {
  74. return $this->__request(__FUNCTION__, $data);
  75. }
  76. }