WebsiteService.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?php
  2. namespace App\JsonRpc;
  3. use Hyperf\RpcClient\AbstractServiceClient;
  4. class WebsiteService extends AbstractServiceClient implements WebsiteServiceInterface
  5. {
  6. /**
  7. * 定义对应服务提供者的服务名称
  8. * @var string
  9. */
  10. protected string $serviceName = 'WebsiteService';
  11. /**
  12. * 定义对应服务提供者的服务协议
  13. * @var string
  14. */
  15. protected string $protocol = 'jsonrpc-http';
  16. /**
  17. * @param string $keyword
  18. * @param int $page
  19. * @param int $pageSize
  20. * @return mixed
  21. */
  22. public function getWebsitetList(string $keyword, int $page, int $pageSize)
  23. {
  24. return $this->__request(__FUNCTION__, compact('keyword','page','pageSize'));
  25. }
  26. /**
  27. * @param array $data
  28. * @return mixed
  29. */
  30. public function createWebsite(array $data)
  31. {
  32. return $this->__request(__FUNCTION__, $data);
  33. }
  34. /**
  35. * @param int $id
  36. * @param array $data
  37. * @return mixed
  38. */
  39. public function updateWebsite(int $id, array $data)
  40. {
  41. return $this->__request(__FUNCTION__,$id, $data);
  42. }
  43. /**
  44. * @param int $id
  45. * @return mixed
  46. */
  47. public function delWebsite(int $id)
  48. {
  49. return $this->__request(__FUNCTION__,$id);
  50. }
  51. /**
  52. * @param int $id
  53. * @return mixed
  54. */
  55. public function getWebsiteInfo(int $id)
  56. {
  57. return $this->__request(__FUNCTION__,$id);
  58. }
  59. /**
  60. * @param array $data
  61. * @return array
  62. */
  63. public function getWebsiteColumn(array $data): array
  64. {
  65. return $this->__request(__FUNCTION__, $data);
  66. }
  67. /**
  68. * @param string $keyword
  69. * @param int $page
  70. * @param int $pageSize
  71. * @return mixed
  72. */
  73. public function getWebsiteColumnList(string $keyword, int $page, int $pageSize)
  74. {
  75. return $this->__request(__FUNCTION__, compact('keyword','page','pageSize'));
  76. }
  77. /**
  78. * @param array $data
  79. * @return mixed
  80. */
  81. public function createWebsiteColumn(array $data)
  82. {
  83. return $this->__request(__FUNCTION__, $data);
  84. }
  85. /**
  86. * @param int $id
  87. * @param array $data
  88. * @return mixed
  89. */
  90. public function updateWebsiteColumn(int $id, array $data)
  91. {
  92. return $this->__request(__FUNCTION__,$id, $data);
  93. }
  94. /**
  95. * @param int $id
  96. * @return mixed
  97. */
  98. public function delWebsiteColumn(int $id)
  99. {
  100. return $this->__request(__FUNCTION__,$id);
  101. }
  102. }