同步专业版Server SDK
This commit is contained in:
@@ -6,9 +6,12 @@ import cn.wildfirechat.sdk.model.IMResult;
|
||||
import cn.wildfirechat.sdk.utilities.AdminHttpUtils;
|
||||
|
||||
public class ConferenceAdmin {
|
||||
public static IMResult<PojoConferenceInfoList> listConferences() throws Exception {
|
||||
public static IMResult<PojoConferenceInfoList> listConferences(int count, int offset) throws Exception {
|
||||
String path = APIPath.Conference_List;
|
||||
return AdminHttpUtils.httpJsonPost(path, null, PojoConferenceInfoList.class);
|
||||
InputCountOffset inputCountOffset = new InputCountOffset();
|
||||
inputCountOffset.count = count;
|
||||
inputCountOffset.offset = offset;
|
||||
return AdminHttpUtils.httpJsonPost(path, inputCountOffset, PojoConferenceInfoList.class);
|
||||
}
|
||||
|
||||
public static IMResult<Boolean> existsConferences(String conferenceId) throws Exception {
|
||||
|
||||
@@ -82,6 +82,37 @@ public class GeneralAdmin {
|
||||
}
|
||||
|
||||
//以下仅专业版支持
|
||||
//如果是单聊会话,target和userId代表会话的2个用户。如果是其他会话userId无意义
|
||||
public static IMResult<FilesPojo> getConversationFiles(int conversationType, String target, int line, String userId, int offset, boolean desc, int count) throws Exception {
|
||||
String path = APIPath.Get_Conversation_Files;
|
||||
GetConversationFilesPojo input = new GetConversationFilesPojo();
|
||||
input.conversationType = conversationType;
|
||||
input.target = target;
|
||||
input.line = line;
|
||||
input.userId = userId;
|
||||
input.offset = offset;
|
||||
input.desc = desc;
|
||||
input.count = count;
|
||||
return AdminHttpUtils.httpJsonPost(path, input, FilesPojo.class);
|
||||
}
|
||||
|
||||
public static IMResult<FilesPojo> getUserFiles(String userId, int offset, boolean desc, int count) throws Exception {
|
||||
String path = APIPath.Get_User_Files;
|
||||
GetUserFilesPojo input = new GetUserFilesPojo();
|
||||
input.userId = userId;
|
||||
input.offset = offset;
|
||||
input.desc = desc;
|
||||
input.count = count;
|
||||
return AdminHttpUtils.httpJsonPost(path, input, FilesPojo.class);
|
||||
}
|
||||
|
||||
public static IMResult<FilesPojo.FilePojo> getFile(long messageId) throws Exception {
|
||||
String path = APIPath.Get_Message_File;
|
||||
LongPojo input = new LongPojo();
|
||||
input.value = messageId;
|
||||
return AdminHttpUtils.httpJsonPost(path, input, FilesPojo.FilePojo.class);
|
||||
}
|
||||
|
||||
public static IMResult<Void> setConversationTop(String userId, int conversationType, String target, int line, boolean isTop) throws Exception {
|
||||
String key = conversationType + "-" + line + "-" + target;
|
||||
String value = isTop?"1":"0";
|
||||
|
||||
@@ -2146,7 +2146,7 @@ public class Main {
|
||||
会议相关接口,仅音视频高级版服务支持
|
||||
*/
|
||||
public static void testConference() throws Exception {
|
||||
IMResult<PojoConferenceInfoList> listResult = ConferenceAdmin.listConferences();
|
||||
IMResult<PojoConferenceInfoList> listResult = ConferenceAdmin.listConferences(100, 0);
|
||||
if(listResult == null || listResult.getErrorCode() != ErrorCode.ERROR_CODE_SUCCESS) {
|
||||
System.out.println("get conference list failure");
|
||||
System.exit(-1);
|
||||
@@ -2164,7 +2164,7 @@ public class Main {
|
||||
}
|
||||
}
|
||||
|
||||
listResult = ConferenceAdmin.listConferences();
|
||||
listResult = ConferenceAdmin.listConferences(100, 0);
|
||||
if(listResult == null || listResult.getErrorCode() != ErrorCode.ERROR_CODE_SUCCESS) {
|
||||
System.out.println("get conference list failure");
|
||||
System.exit(-1);
|
||||
@@ -2204,7 +2204,7 @@ public class Main {
|
||||
System.out.println("recording conference success");
|
||||
}
|
||||
|
||||
listResult = ConferenceAdmin.listConferences();
|
||||
listResult = ConferenceAdmin.listConferences(100, 0);
|
||||
if(listResult == null || listResult.getErrorCode() != ErrorCode.ERROR_CODE_SUCCESS) {
|
||||
System.out.println("get conference list failure");
|
||||
System.exit(-1);
|
||||
|
||||
Reference in New Issue
Block a user