Agent.php 771 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace WeWork\Api;
  3. use WeWork\Traits\AgentIdTrait;
  4. use WeWork\Traits\HttpClientTrait;
  5. class Agent
  6. {
  7. use HttpClientTrait, AgentIdTrait;
  8. /**
  9. * 获取应用
  10. *
  11. * @return array
  12. */
  13. public function get(): array
  14. {
  15. return $this->httpClient->get('agent/get', ['agentid' => $this->agentId]);
  16. }
  17. /**
  18. * 设置应用
  19. *
  20. * @param array $json
  21. * @return array
  22. */
  23. public function set(array $json): array
  24. {
  25. return $this->httpClient->postJson('agent/set', array_merge(['agentid' => $this->agentId], $json));
  26. }
  27. /**
  28. * 获取应用列表
  29. *
  30. * @return array
  31. */
  32. public function list(): array
  33. {
  34. return $this->httpClient->get('agent/list');
  35. }
  36. }