| Total Complexity | 7 |
| Total Lines | 87 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | class Client extends BaseClient |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * 获取外部联系人标签列表 |
||
| 20 | * |
||
| 21 | * @param int $offset |
||
| 22 | * @param int $size |
||
| 23 | * |
||
| 24 | * @return mixed |
||
| 25 | */ |
||
| 26 | public function labels($offset = 0, $size = 100) |
||
| 27 | { |
||
| 28 | return $this->client->postJson('topapi/extcontact/listlabelgroups', compact('offset', 'size')); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * 获取外部联系人列表 |
||
| 33 | * |
||
| 34 | * @param int $offset |
||
| 35 | * @param int $size |
||
| 36 | * |
||
| 37 | * @return mixed |
||
| 38 | */ |
||
| 39 | public function list($offset = 0, $size = 100) |
||
| 40 | { |
||
| 41 | return $this->client->postJson('topapi/extcontact/list', compact('offset', 'size')); |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * 获取企业外部联系人详情 |
||
| 46 | * |
||
| 47 | * @param string $userId |
||
| 48 | * |
||
| 49 | * @return mixed |
||
| 50 | */ |
||
| 51 | public function get($userId) |
||
| 52 | { |
||
| 53 | return $this->client->postJson('topapi/extcontact/get', ['user_id' => $userId]); |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * 添加外部联系人 |
||
| 58 | * |
||
| 59 | * @param array $contact |
||
| 60 | * |
||
| 61 | * @return mixed |
||
| 62 | */ |
||
| 63 | public function create($contact) |
||
| 64 | { |
||
| 65 | return $this->client->postJson('topapi/extcontact/create', compact('contact')); |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * 更新外部联系人 |
||
| 70 | * |
||
| 71 | * @param string $userId |
||
| 72 | * @param array $contact |
||
| 73 | * |
||
| 74 | * @return mixed |
||
| 75 | */ |
||
| 76 | public function update($userId, $contact) |
||
| 77 | { |
||
| 78 | $contact = ['user_id' => $userId] + $contact; |
||
| 79 | |||
| 80 | return $this->client->postJson('topapi/extcontact/update', compact('contact')); |
||
| 81 | } |
||
| 82 | |||
| 83 | /** |
||
| 84 | * 删除外部联系人 |
||
| 85 | * |
||
| 86 | * @param string $userId |
||
| 87 | * |
||
| 88 | * @return mixed |
||
| 89 | */ |
||
| 90 | public function delete($userId) |
||
| 91 | { |
||
| 92 | return $this->client->postJson('topapi/extcontact/delete', ['user_id' => $userId]); |
||
| 93 | } |
||
| 94 | |||
| 95 | /** |
||
| 96 | * 获取通讯录权限范围 |
||
| 97 | * |
||
| 98 | * @return mixed |
||
| 99 | */ |
||
| 100 | public function scopes() |
||
| 103 | } |
||
| 104 | } |
||
| 105 |