Batch.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace WeWork\Api;
  3. use WeWork\Traits\HttpClientTrait;
  4. class Batch
  5. {
  6. use HttpClientTrait;
  7. /**
  8. * 邀请成员
  9. *
  10. * @param array $json
  11. * @return array
  12. */
  13. public function invite(array $json): array
  14. {
  15. return $this->httpClient->postJson('batch/invite', $json);
  16. }
  17. /**
  18. * 增量更新成员
  19. *
  20. * @param array $json
  21. * @return array
  22. */
  23. public function syncUser(array $json): array
  24. {
  25. return $this->httpClient->postJson('batch/syncuser', $json);
  26. }
  27. /**
  28. * 全量覆盖成员
  29. *
  30. * @param array $json
  31. * @return array
  32. */
  33. public function replaceUser(array $json): array
  34. {
  35. return $this->httpClient->postJson('batch/replaceuser', $json);
  36. }
  37. /**
  38. * 全量覆盖部门
  39. *
  40. * @param array $json
  41. * @return array
  42. */
  43. public function replaceParty(array $json): array
  44. {
  45. return $this->httpClient->postJson('batch/replaceparty', $json);
  46. }
  47. /**
  48. * 获取异步任务结果
  49. *
  50. * @param string $jobId
  51. * @return array
  52. */
  53. public function getResult(string $jobId): array
  54. {
  55. return $this->httpClient->get('batch/getresult', ['jobid' => $jobId]);
  56. }
  57. }