init()->bindUser($clientId, $this->userId); return ['绑定成功']; } public function sendMessage($data, $type = MessageTypeEnum::Text->value) { $data['message_type'] = MessageTypeEnum::from($type)->description(); GatewayClientService::getInstance()->init()->sendToUser( $this->userId === 1? 2: 1, $this->userId, $this->userInfo['nick_name'], json_encode($data), ); return ['发送成功']; } }