com.hn.im.easemob.api.ChatGroupAPI Maven / Gradle / Ivy
package com.hn.im.easemob.api;
import com.hn.im.easemob.comm.body.ModifyChatGroupMuteBody;
/**
* This interface is created for RestAPI of Chat Group, it should be
* synchronized with the API list.
* http://docs.easemob.com/doku.php?id=start:100serverintegration:
* @author Eric23 2016-01-05
*/
public interface ChatGroupAPI {
/**
* 获取群组,参数为空时获取所有群组
* GET
*
* @param limit
* 单页数量
* @param cursor
* 游标,存在更多记录时产生
* @return Object 群组
*/
Object getChatGroups(Long limit, String cursor);
/**
* 获取一个或者多个群组的详情
* GET
*
* @param groupIds
* 群组ID数组
* @return 群组的详情
*/
Object getChatGroupDetails(String[] groupIds);
/**
* 创建一个群组
* POST
*
* @param payload
* {"groupname":"testrestgrp12","desc":"server create group","public":true,"maxusers":300,"approval":true,"owner":"jma1","members":["jma2","jma3"]}
* @return Object
*/
Object createChatGroup(Object payload);
/**
* 修改群组信息
* PUT
*
* @param groupId
* 群组标识
* @param payload
* {"groupname":"testrestgrp12",description":"update groupinfo","maxusers":300}
* @return Object
*/
Object modifyChatGroup(String groupId, Object payload);
/**
* 删除群组
* DELETE
*
* @param groupId
* 群组标识
* @return Object
*/
Object deleteChatGroup(String groupId);
/**
* 获取群组所有用户
* GET
*
* @param groupId
* 群组标识
* @return Object
*/
Object getChatGroupUsers(String groupId);
/**
* 群组加人[单个]
* POST
*
* @param groupId
* 群组标识
* @param userId
* 用户ID或用户名
* @return Object
*/
Object addSingleUserToChatGroup(String groupId, String userId);
/**
* 群组加人[批量]
* POST
*
* @param groupId
* 群组标识
* @param payload
* 用户ID或用户名,数组形式
* @return Object
*/
Object addBatchUsersToChatGroup(String groupId, Object payload);
/**
* 群组减人[单个]
* DELETE
*
* @param groupId
* 群组标识
* @param userId
* 用户ID或用户名
* @return Object
*/
Object removeSingleUserFromChatGroup(String groupId, String userId);
/**
* 群组减人[批量]
* DELETE
*
* @param groupId
* 群组标识
* @param userIds
* 用户ID或用户名,数组形式
* @return Object
*/
Object removeBatchUsersFromChatGroup(String groupId, String[] userIds);
/**
* 群组转让
* PUT
*
* @param groupId
* 群组标识
* @param payload
* 新群主ID或用户名
* @return Object
*/
Object transferChatGroupOwner(String groupId, Object payload);
/**
* 查询群组黑名单
* GET
*
* @param groupId
* 群组标识
* @return Object
*/
Object getChatGroupBlockUsers(String groupId);
/**
* 群组黑名单个添加
* POST
*
* @param groupId
* 群组标识
* @param userId
* 用户ID或用户名
* @return Object
*/
Object addSingleBlockUserToChatGroup(String groupId, String userId);
/**
* 群组黑名单批量添加
* POST
*
* @param groupId
* 群组标识
* @param payload
* 用户ID或用户名,数组形式
* @return Object
*/
Object addBatchBlockUsersToChatGroup(String groupId, Object payload);
/**
* 群组黑名单单个删除
* DELETE
*
* @param groupId
* 群组标识
* @param userId
* 用户ID或用户名
* @return Object
*/
Object removeSingleBlockUserFromChatGroup(String groupId, String userId);
/**
* 群组黑名单批量删除
* DELETE
*
* @param groupId
* 群组标识
* @param userIds
* 用户ID或用户名,数组形式
* @return Object
*/
Object removeBatchBlockUsersFromChatGroup(String groupId, String[] userIds);
/**
* 禁言
* @param groupId 群组标识
* @param payload {@link ModifyChatGroupMuteBody}
* @return Object
*/
Object mute(String groupId, Object payload);
/**
* 取消禁言
* @param groupNum 群组标识
* @param userNums userNums
* @return Object
*/
Object removeMute(String groupNum, String[] userNums);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy