Total Complexity | 7 |
Total Lines | 84 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
21 | class Client extends BaseClient |
||
22 | { |
||
23 | /** |
||
24 | * Get department list. |
||
25 | * |
||
26 | * @param int $id |
||
27 | * |
||
28 | * @return array |
||
29 | */ |
||
30 | public function list(int $id) |
||
31 | { |
||
32 | return $this->httpGet('department/list', compact('id')); |
||
|
|||
33 | } |
||
34 | |||
35 | /** |
||
36 | * Get department detail. |
||
37 | * |
||
38 | * @param int $id |
||
39 | * |
||
40 | * @return array |
||
41 | */ |
||
42 | public function get(int $id) |
||
43 | { |
||
44 | return $this->httpGet('department/get', compact('id')); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Create a department. |
||
49 | * |
||
50 | * @param array $data |
||
51 | * |
||
52 | * @return array |
||
53 | */ |
||
54 | public function create(array $data) |
||
55 | { |
||
56 | return $this->httpPostJson('department/create', $data); |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * Update a department. |
||
61 | * |
||
62 | * @param array $data |
||
63 | * |
||
64 | * @return array |
||
65 | */ |
||
66 | public function update(array $data) |
||
67 | { |
||
68 | return $this->httpPostJson('department/update', $data); |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * Delete a department. |
||
73 | * |
||
74 | * @param int $id |
||
75 | * |
||
76 | * @return array |
||
77 | */ |
||
78 | public function delete(int $id) |
||
81 | } |
||
82 | |||
83 | /** |
||
84 | * Get department parents by department id. |
||
85 | * |
||
86 | * @param int $id |
||
87 | * |
||
88 | * @return array |
||
89 | */ |
||
90 | public function parent(int $id) |
||
91 | { |
||
92 | return $this->httpGet('department/list_parent_depts_by_dept', compact('id')); |
||
93 | } |
||
94 | |||
95 | /** |
||
96 | * Get department parents by user id. |
||
97 | * |
||
98 | * @param string $userId |
||
99 | * |
||
100 | * @return array |
||
101 | */ |
||
102 | public function userParent(string $userId) |
||
105 | } |
||
106 | } |
||
107 |