更新
This commit is contained in:
@@ -52,8 +52,12 @@ $service = new QywxCustomerAcquisitionApiService(new Client([
|
||||
|
||||
$list = $service->listLinks('', 100);
|
||||
$detail = $service->getLink('link_1');
|
||||
$created = $service->createLink(['link_name' => '官网获客', 'range' => ['user_list' => ['zhangsan']]]);
|
||||
$service->updateLink(['link_id' => 'link_1', 'link_name' => '官网获客-更新']);
|
||||
$created = $service->createLink(['link_name' => '官网获客', 'range' => ['user_list' => ['zhangsan', 'lisi']]]);
|
||||
$service->updateLink([
|
||||
'link_id' => 'link_1',
|
||||
'link_name' => '官网获客-更新',
|
||||
'range' => ['user_list' => ['lisi', 'zhangsan']],
|
||||
]);
|
||||
$service->deleteLink('link_1');
|
||||
$customers = $service->listCustomers('link_1', '', 1000);
|
||||
$chat = $service->getChatInfo('chat_key_1');
|
||||
@@ -88,7 +92,11 @@ $actualPaths = array_map(static fn (array $entry): string => $entry['request']->
|
||||
$assert($actualPaths === $expectedPaths, '请求端点不正确:' . implode(', ', $actualPaths));
|
||||
|
||||
$createPayload = json_decode((string) $history[2]['request']->getBody(), true);
|
||||
$assert(($createPayload['range']['user_list'][0] ?? '') === 'zhangsan', 'create_link 成员范围请求体不正确');
|
||||
$assert(($createPayload['range']['user_list'] ?? []) === ['zhangsan', 'lisi'], 'create_link 多人成员范围请求体不正确');
|
||||
$updatePayload = json_decode((string) $history[3]['request']->getBody(), true);
|
||||
$assert(($updatePayload['range']['user_list'] ?? []) === ['lisi', 'zhangsan'], 'update_link 多人成员范围请求体不正确');
|
||||
$deletePayload = json_decode((string) $history[4]['request']->getBody(), true);
|
||||
$assert(($deletePayload['link_id'] ?? '') === 'link_1', 'delete_link 请求体缺少官方 link_id');
|
||||
$customerPayload = json_decode((string) $history[5]['request']->getBody(), true);
|
||||
$assert(($customerPayload['link_id'] ?? '') === 'link_1' && ($customerPayload['limit'] ?? 0) === 1000, 'customer 请求体不正确');
|
||||
$chatPayload = json_decode((string) $history[6]['request']->getBody(), true);
|
||||
|
||||
Reference in New Issue
Block a user