Files
fast_response/admin/application/api/controller/Test.php
2025-03-29 13:59:40 +08:00

58 lines
1.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/*
* description
* authorwh
* email
* createTime{2025/3/29} {13:46}
*/
namespace app\api\controller;
use app\api\logic\PyappLofic;
use think\Controller;
class Test extends Controller
{
function test(){
$obj = new PyappLofic();
$res = $obj->setFollowupModel('54116019493@chatroom','测试内容');
dump($res);die;
$url = 'https://wechat-api-test.excn.vip/vip_groups/follow-up';
$data = [
"chatroom_id" => "54116019493@chatroom",
"is_follow_up" => true,
"follow_up_content" => "测试回访内容"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE );
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE );
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'accept: application/json',
'Content-Type: application/json'
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
echo 'Response:' . $response;
echo 'HTTP Code:' . $httpCode;
}
curl_close($ch);
}
}