This commit is contained in:
commie
2026-02-15 19:41:56 +08:00
parent 61c5192018
commit 1a7f4bc98a
68 changed files with 992 additions and 353 deletions
+45 -7
View File
@@ -23,17 +23,27 @@ class HookController{
{
$userID= Input('userID');
$nickname= Input('nickname');
$users = Input('users');
$im = new \support\OpenImSdk\Client([
'host' => 'http://127.0.0.1:10002', // OpenIM API地址
'secret' => 'n1e5a6s6m7', // OpenIM密钥
]);
$im->message->sendBusinessNotification('official_team',$userID,[
'contentType' => 101,
'textElem' => [
'content' => '欢迎使用'.Config('site.name')
]
]);
foreach($users as $k=>$v){
// 'userID' => '0EO9K107ON',
// 'nickname' => '坏蛋',
// 'faceURL' => '/static/img/avatar.png',
// 'ex' => '',
// 'createTime' => 0,
// 'appMangerLevel' => 0,
// 'globalRecvMsgOpt' => 0,
$im->message->sendBusinessNotification('official_team',idEncode($v['userID']),[
'contentType' => 101,
'textElem' => [
'content' => '欢迎使用'.Config('site.name')
]
]);
}
return json([
"actionCode" => 0,
"errCode" => 0,
@@ -266,4 +276,32 @@ class HookController{
"nextCode"=> 0
]);
}
function callbackAfterDeleteFriendCommand() : Response {
$friendUserID = Input('friendUserID');
$ownerUserID = Input('ownerUserID');
$sdk = $this->getSdk();
$relation = $sdk->friend->isFriend($friendUserID,$ownerUserID);
if($relation){
if($relation['inUser1Friends']){
$this->getSdk()->friend->deleteFriend($friendUserID,$ownerUserID);
}
if($relation['inUser2Friends']){
$this->getSdk()->friend->deleteFriend($ownerUserID,$friendUserID);
}
}
return json([
"actionCode" => 0,
"errCode" => 0,
"errMsg" => "",
"errDlt" => "",
"nextCode"=> 0
]);
}
function getSdk(){
$IM = new \support\OpenImSdk\Client([
'host' => 'http://127.0.0.1:10002', // OpenIM API地址
'secret' => 'n1e5a6s6m7', // OpenIM密钥
]);
return $IM;
}
}