新增im回调

This commit is contained in:
2023-03-10 14:53:50 +08:00
parent bd49332f64
commit b03f38704d
7 changed files with 362 additions and 24 deletions
+25 -17
View File
@@ -125,7 +125,7 @@ class UserController extends AbstractController
$group = new Group();
$friend = new Friend();
$message = new Message();
$result = $account->createAccount(10009,'测试患者9',"https://img.applets.igandanyiyuan.com/applet/doctor/avatar/03dc8df2-e7c0-4ad9-b87e-5133e40e0f76.jpg");
// $result = $account->createAccount(10009,'测试患者9',"https://img.applets.igandanyiyuan.com/applet/doctor/avatar/03dc8df2-e7c0-4ad9-b87e-5133e40e0f76.jpg");
// 查询账号导入状态
// $result = $account->checkAccountStatus("123456");
@@ -148,23 +148,31 @@ class UserController extends AbstractController
// $result = $friend->addFriend("123456",'1234567',"快速问诊");
// 发送消息
// $arg = array();
// $arg['From_Account'] = "1234567"; // 发送方user_id 如系统发送,无需填写
// $arg['To_Account'] = "123456"; // 接收方user_id
// $arg['ForbidCallbackControl'] = ['ForbidBeforeSendMsgCallback'];
//
// $arg['MsgBody'] = [
// [
// "MsgType" => "TIMTextElem",
// "MsgContent" => [
// "Text" => "测试消息1",
// ],
// ]
// ];
//
// $result = $message->sendMessage($arg);
$arg = array();
$arg['From_Account'] = "10000"; // 发送方user_id 如系统发送,无需填写
$arg['To_Account'] = "123456"; // 接收方user_id
$arg['ForbidCallbackControl'] = ['ForbidBeforeSendMsgCallback'];
$arg['MsgBody'] = [
[
"MsgType" => "TIMTextElem",
"MsgContent" => [
"Text" => "测试消息22",
],
]
];
// 自定义消息
$cloud_custom_data = array();
$cloud_custom_data['order_inquiry_id'] = 491937904055369728;
$cloud_custom_data['is_system'] = 1;
$arg['CloudCustomData'] = json_encode($cloud_custom_data,JSON_UNESCAPED_UNICODE);
$result = $message->sendMessage($arg);
// $result = $profile->getOneAccountPortraitList("123456");
$result = $profile->getOneAccountPortraitList("123456");
dump($result);