测试
This commit is contained in:
@@ -28,22 +28,24 @@ class ImService extends BaseService
|
||||
|
||||
public function sendMessage($data, $type = MessageTypeEnum::Text->value)
|
||||
{
|
||||
$uids = [1,2,3];
|
||||
$uidsC = [];
|
||||
foreach ($uids as $v) {
|
||||
$uidsC[$v] = Gateway::getClientIdByUid($v);
|
||||
}
|
||||
ds($uidsC);
|
||||
// $uids = [1,2,3];
|
||||
// $uidsC = [];
|
||||
// foreach ($uids as $v) {
|
||||
// $uidsC[$v] = Gateway::getClientIdByUid($v);
|
||||
// }
|
||||
// ds($uidsC);
|
||||
$data['message_type'] = MessageTypeEnum::from($type)->description();
|
||||
$this->gatewayClient->sendToUser(
|
||||
$this->userId === 1? 2: 1,
|
||||
$this->userId,
|
||||
$this->userInfo['nick_name'],
|
||||
$data['avatarColor'],
|
||||
$data['content'],
|
||||
);
|
||||
$this->gatewayClient->broadcastMessage(
|
||||
$this->userId,
|
||||
$this->userInfo['nick_name'],
|
||||
$data['avatarColor'],
|
||||
$data['content'],
|
||||
);
|
||||
return ['发送成功'];
|
||||
|
||||
Reference in New Issue
Block a user