Blame view

addons/antis/library/wework/Api/Department.php 1.04 KB
2db47680   hexiaodong   chore: 初始提交 php 遗...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
  <?php

  

  namespace WeWork\Api;

  

  use WeWork\Traits\HttpClientTrait;

  

  class Department

  {

      use HttpClientTrait;

  

      /**

       * 创建部门

       *

       * @param array $json

       * @return array

       */

      public function create(array $json): array

      {

          return $this->httpClient->postJson('department/create', $json);

      }

  

      /**

       * 更新部门

       *

       * @param array $json

       * @return array

       */

      public function update(array $json): array

      {

          return $this->httpClient->postJson('department/update', $json);

      }

  

      /**

       * 删除部门

       *

       * @param int $id

       * @return array

       */

      public function delete(int $id): array

      {

          return $this->httpClient->get('department/delete', compact('id'));

      }

  

      /**

       * 获取部门列表

       *

       * @param int $id

       * @return array

       */

      public function list(int $id = 0): array

      {

          return $this->httpClient->get('department/list', $id > 0 ? compact('id') : []);

      }

  }