|
@@ -24,6 +24,8 @@ class Easemob {
|
|
$this->user = new User($this->auth);
|
|
$this->user = new User($this->auth);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /////////////////////////////////管理用户/////////////////////////////
|
|
|
|
+
|
|
//注册用户
|
|
//注册用户
|
|
/*
|
|
/*
|
|
array(6) {
|
|
array(6) {
|
|
@@ -57,6 +59,7 @@ class Easemob {
|
|
|
|
|
|
//获取 app 中的聊天室
|
|
//获取 app 中的聊天室
|
|
//获取用户加入的聊天室
|
|
//获取用户加入的聊天室
|
|
|
|
+
|
|
//查询聊天室详情
|
|
//查询聊天室详情
|
|
public function room_getRoom($roomId){
|
|
public function room_getRoom($roomId){
|
|
$rs = $this->room->getRoom($roomId);
|
|
$rs = $this->room->getRoom($roomId);
|
|
@@ -67,22 +70,108 @@ class Easemob {
|
|
/*
|
|
/*
|
|
string(15) "230821166383116"
|
|
string(15) "230821166383116"
|
|
*/
|
|
*/
|
|
- public function room_create($name,$info,$user_id){
|
|
|
|
|
|
+ public function room_createRoom($name,$info,$user_id){
|
|
$user_id = '' . $user_id . '';
|
|
$user_id = '' . $user_id . '';
|
|
$room_id = $this->room->createRoom($name,$info,$user_id,[$user_id]);
|
|
$room_id = $this->room->createRoom($name,$info,$user_id,[$user_id]);
|
|
return $room_id;
|
|
return $room_id;
|
|
}
|
|
}
|
|
|
|
|
|
//修改聊天室信息
|
|
//修改聊天室信息
|
|
|
|
+ /*
|
|
|
|
+ bool(true)
|
|
|
|
+ */
|
|
|
|
+ public function room_updateRoom($room_id,$name,$description,$maxusers = false){
|
|
|
|
+ $data = [
|
|
|
|
+ 'room_id' => $room_id,
|
|
|
|
+ 'name' => $name,
|
|
|
|
+ 'description'=>$description,
|
|
|
|
+ ];
|
|
|
|
+ if($maxusers !== false){
|
|
|
|
+ $data['maxusers'] = $maxusers;
|
|
|
|
+ }
|
|
|
|
+ $rs = $this->room->updateRoom($data);
|
|
|
|
+ return $rs;
|
|
|
|
+ }
|
|
|
|
|
|
//删除聊天室
|
|
//删除聊天室
|
|
//获取聊天室公告
|
|
//获取聊天室公告
|
|
//修改聊天室公告
|
|
//修改聊天室公告
|
|
//设置聊天室自定义属性
|
|
//设置聊天室自定义属性
|
|
|
|
+
|
|
//获取聊天室自定义属性
|
|
//获取聊天室自定义属性
|
|
|
|
+ /*
|
|
|
|
+ array(14) {
|
|
|
|
+ ["seat4"] => string(3) "555"
|
|
|
|
+ ["seat3"] => string(3) "555"
|
|
|
|
+ ["seat2"] => string(3) "555"
|
|
|
|
+ ["seat1"] => string(3) "555"
|
|
|
|
+ ["seat8"] => string(3) "555"
|
|
|
|
+ ["sate1"] => string(1) "5"
|
|
|
|
+ ["seat7"] => string(3) "555"
|
|
|
|
+ ["sate2"] => string(1) "6"
|
|
|
|
+ ["seat6"] => string(3) "555"
|
|
|
|
+ ["seat5"] => string(3) "555"
|
|
|
|
+ ["sate3"] => string(1) "7"
|
|
|
|
+ ["seat9"] => string(3) "555"
|
|
|
|
+ ["sate4"] => string(1) "8"
|
|
|
|
+ ["seat10"] => string(3) "555"
|
|
|
|
+ }
|
|
|
|
+ */
|
|
|
|
+ public function room_getRoomCustomAttribute($room_id,$keys){
|
|
|
|
+ $rs = $this->room->getRoomCustomAttribute($room_id,$keys);
|
|
|
|
+ return $rs;
|
|
|
|
+ }
|
|
//删除聊天室自定义属性
|
|
//删除聊天室自定义属性
|
|
|
|
+
|
|
//强制设置聊天室自定义属性
|
|
//强制设置聊天室自定义属性
|
|
|
|
+ //初次设置新增,或修改都可用,一次请求的数组大小为10,可多次设置,共100个
|
|
|
|
+ /*
|
|
|
|
+ array(2) {
|
|
|
|
+ ["successKeys"] => array(10) {
|
|
|
|
+ [0] => string(5) "seat1"
|
|
|
|
+ [1] => string(5) "seat2"
|
|
|
|
+ [2] => string(5) "seat3"
|
|
|
|
+ [3] => string(5) "seat4"
|
|
|
|
+ [4] => string(5) "seat5"
|
|
|
|
+ [5] => string(5) "seat6"
|
|
|
|
+ [6] => string(5) "seat7"
|
|
|
|
+ [7] => string(5) "seat8"
|
|
|
|
+ [8] => string(5) "seat9"
|
|
|
|
+ [9] => string(6) "seat10"
|
|
|
|
+ }
|
|
|
|
+ ["errorKeys"] => array(0) {
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ */
|
|
|
|
+ public function room_setRoomCustomAttributeForced($room_id,$owner_id,$matedata){
|
|
|
|
+ $owner_id = ''.$owner_id.'';
|
|
|
|
+ $rs = $this->room->setRoomCustomAttributeForced($room_id,$owner_id,$matedata);
|
|
|
|
+ return $rs;
|
|
|
|
+ }
|
|
|
|
+
|
|
//强制删除聊天室自定义属性
|
|
//强制删除聊天室自定义属性
|
|
|
|
+ /*
|
|
|
|
+ array(2) {
|
|
|
|
+ ["successKeys"] => array(1) {
|
|
|
|
+ [0] => string(5) "sate1" //被删除的keys
|
|
|
|
+ }
|
|
|
|
+ ["errorKeys"] => array(0) {
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //再次删除同一个
|
|
|
|
+ array(2) {
|
|
|
|
+ ["successKeys"] => array(0) {
|
|
|
|
+ }
|
|
|
|
+ ["errorKeys"] => array(1) {
|
|
|
|
+ ["sate1"] => string(33) "properties key sate1 is not exist"
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ */
|
|
|
|
+ public function room_deleteRoomCustomAttributeForced($room_id,$owner_id,$keys){
|
|
|
|
+ $owner_id = ''.$owner_id.'';
|
|
|
|
+ $rs = $this->room->deleteRoomCustomAttributeForced($room_id,$owner_id,$keys);
|
|
|
|
+ return $rs;
|
|
|
|
+ }
|
|
|
|
|
|
///////////////管理聊天室成员//////////////////
|
|
///////////////管理聊天室成员//////////////////
|
|
|
|
|