<?php
/**
 * 极光云通信测试
 * @Copyright (C) 2016 汉潮 All rights reserved.
 * @License http://www.hanchao9999.com
 * @Author lss <lss@qq.com>
 */
namespace Home\Controller;
class JimtestController extends BaseController {
   
    public function index(){
        $im= new \Common\Vendor\JimIM;
        
        $signature=$im->signature();
        // print_r($signature);exit;//获取客户端调用参数

        // $username='hc12';$password='hanhcao';$ret=$im->register($username,$password);
        // $arrh=array();
        // $arrh['nickname'] = '小悦';
        // $uret = $im->update($username,$arrh);

        // var_dump($uret); echo '8---'; die;
        // print_r($ret); echo '99966----';exit;//注册用户
        //$username='xuqijin110';$ret=$im->stat($username);print_r($ret);exit;//查询用户在线状态
        // $info = ['username' => 'admin6','password' => 'password'];
        // $ret=$im->registerAdmin($info);print_r($ret); echo '000-----';exit;//管理员注册
        $name='测试直播间1';$owner='hc202';
        $ret=$im->createRoom($name,$owner);
        print_r($ret);echo '8----';exit;//创建聊天室
        $chatroom_id= 17686889;        
        //$members[]='xuqijin110';$ret=$im->addMembersRoom($chatroom_id,$members);print_r($ret);exit;//添加聊天室成员
        /*$from=array('type'=>'admin','id'=>'admin');$target=array('type'=>'chatroom','id'=>$chatroom_id);
        $msg=array('text'=>'this is a test message!');
        $ret=$im->sendText($from,$target,$msg);print_r($ret);exit;//发送文本消息*/
        
        //$words=array('人民');$ret=$im->addWord($words);print_r($ret);exit;//添加敏感词
        // $ret=$im->listAllWord();print_r($ret);exit;//获取敏感词列表
    }
    public function roomid(){
        $result=D('Wxsmall/LiveAnchor')->chat_room_id(713,'LYM71');
        print_r($result);
    }
}