EsService.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace App\JsonRpc;
  3. use Hyperf\RpcClient\AbstractServiceClient;
  4. class EsService extends AbstractServiceClient implements EsServiceInterface
  5. {
  6. /**
  7. * 定义对应服务提供者的服务名称
  8. * @var string
  9. */
  10. protected string $serviceName = 'EsService';
  11. /**
  12. * 定义对应服务提供者的服务协议
  13. * @var string
  14. */
  15. protected string $protocol = 'jsonrpc-http';
  16. /**
  17. * 创建索引
  18. *
  19. * @param array $data
  20. * @return array
  21. */
  22. public function createIndex(array $data): array
  23. {
  24. var_dump($data, true, 'SERVICE=================1');
  25. return $this->__request(__FUNCTION__, $data);
  26. }
  27. public function associateData(array $data): array
  28. {
  29. return $this->__request(__FUNCTION__, $data);
  30. }
  31. public function searchIndex(array $data): array
  32. {
  33. return $this->__request(__FUNCTION__, $data);
  34. }
  35. public function deleteIndex(array $data): array
  36. {
  37. return $this->__request(__FUNCTION__, $data);
  38. }
  39. public function getDocument(array $data): array
  40. {
  41. return $this->__request(__FUNCTION__, $data);
  42. }
  43. public function updateData(array $data): array
  44. {
  45. return $this->__request(__FUNCTION__, $data);
  46. }
  47. public function deleteData(array $data): array
  48. {
  49. return $this->__request(__FUNCTION__, $data);
  50. }
  51. }