123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?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') : []);
- }
- }
|