同步专业版Server SDK
This commit is contained in:
@@ -114,6 +114,9 @@ public interface APIPath {
|
|||||||
String Put_System_Setting = "/admin/system/put_setting";
|
String Put_System_Setting = "/admin/system/put_setting";
|
||||||
String GET_CUSTOMER = "/admin/customer";
|
String GET_CUSTOMER = "/admin/customer";
|
||||||
String Health = "/admin/health";
|
String Health = "/admin/health";
|
||||||
|
String Get_Conversation_Files = "/admin/file/conversation_files";
|
||||||
|
String Get_User_Files = "/admin/file/user_files";
|
||||||
|
String Get_Message_File = "/admin/file/message_file";
|
||||||
|
|
||||||
String Conference_List = "/admin/conference/list";
|
String Conference_List = "/admin/conference/list";
|
||||||
String Conference_Exist = "/admin/conference/exist";
|
String Conference_Exist = "/admin/conference/exist";
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the Wildfire Chat package.
|
||||||
|
* (c) Heavyrain2012 <[email protected]>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package cn.wildfirechat.pojos;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class FilesPojo {
|
||||||
|
public int total;
|
||||||
|
public List<FilePojo> files;
|
||||||
|
public static class FilePojo {
|
||||||
|
public long messageId;
|
||||||
|
public String sender;
|
||||||
|
public int conversationType;
|
||||||
|
public String target;
|
||||||
|
public int line;
|
||||||
|
public String name;
|
||||||
|
public String url;
|
||||||
|
public int size;
|
||||||
|
public int downloadCount;
|
||||||
|
public long timestamp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package cn.wildfirechat.pojos;
|
||||||
|
|
||||||
|
public class GetConversationFilesPojo {
|
||||||
|
public int conversationType;
|
||||||
|
public String target;
|
||||||
|
public int line;
|
||||||
|
public String userId;
|
||||||
|
public int offset;
|
||||||
|
public boolean desc;
|
||||||
|
public int count;
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ public class GetOnlineUserResult {
|
|||||||
public String userId;
|
public String userId;
|
||||||
public String clientId;
|
public String clientId;
|
||||||
public int platform;
|
public int platform;
|
||||||
|
public String ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<GetOnlineUserResult.UserClient> userClients;
|
public ArrayList<GetOnlineUserResult.UserClient> userClients;
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package cn.wildfirechat.pojos;
|
||||||
|
|
||||||
|
public class GetUserFilesPojo {
|
||||||
|
public String userId;
|
||||||
|
public int offset;
|
||||||
|
public boolean desc;
|
||||||
|
public int count;
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package cn.wildfirechat.pojos;
|
||||||
|
|
||||||
|
public class InputCountOffset {
|
||||||
|
public int count;
|
||||||
|
public int offset;
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package cn.wildfirechat.pojos;
|
||||||
|
|
||||||
|
public class LongPojo {
|
||||||
|
public long value;
|
||||||
|
}
|
||||||
@@ -2,11 +2,8 @@ package cn.wildfirechat.pojos;
|
|||||||
|
|
||||||
public class PojoConferenceInfo {
|
public class PojoConferenceInfo {
|
||||||
public String roomId;
|
public String roomId;
|
||||||
public String serverId;
|
|
||||||
public String description;
|
public String description;
|
||||||
public int max_publishers;
|
public int max_publishers;
|
||||||
public int num_publishers;
|
|
||||||
public int bitrate;
|
|
||||||
public boolean advance;
|
public boolean advance;
|
||||||
public boolean recording;
|
public boolean recording;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,12 @@ import cn.wildfirechat.sdk.model.IMResult;
|
|||||||
import cn.wildfirechat.sdk.utilities.AdminHttpUtils;
|
import cn.wildfirechat.sdk.utilities.AdminHttpUtils;
|
||||||
|
|
||||||
public class ConferenceAdmin {
|
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;
|
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 {
|
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 {
|
public static IMResult<Void> setConversationTop(String userId, int conversationType, String target, int line, boolean isTop) throws Exception {
|
||||||
String key = conversationType + "-" + line + "-" + target;
|
String key = conversationType + "-" + line + "-" + target;
|
||||||
String value = isTop?"1":"0";
|
String value = isTop?"1":"0";
|
||||||
|
|||||||
@@ -2146,7 +2146,7 @@ public class Main {
|
|||||||
会议相关接口,仅音视频高级版服务支持
|
会议相关接口,仅音视频高级版服务支持
|
||||||
*/
|
*/
|
||||||
public static void testConference() throws Exception {
|
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) {
|
if(listResult == null || listResult.getErrorCode() != ErrorCode.ERROR_CODE_SUCCESS) {
|
||||||
System.out.println("get conference list failure");
|
System.out.println("get conference list failure");
|
||||||
System.exit(-1);
|
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) {
|
if(listResult == null || listResult.getErrorCode() != ErrorCode.ERROR_CODE_SUCCESS) {
|
||||||
System.out.println("get conference list failure");
|
System.out.println("get conference list failure");
|
||||||
System.exit(-1);
|
System.exit(-1);
|
||||||
@@ -2204,7 +2204,7 @@ public class Main {
|
|||||||
System.out.println("recording conference success");
|
System.out.println("recording conference success");
|
||||||
}
|
}
|
||||||
|
|
||||||
listResult = ConferenceAdmin.listConferences();
|
listResult = ConferenceAdmin.listConferences(100, 0);
|
||||||
if(listResult == null || listResult.getErrorCode() != ErrorCode.ERROR_CODE_SUCCESS) {
|
if(listResult == null || listResult.getErrorCode() != ErrorCode.ERROR_CODE_SUCCESS) {
|
||||||
System.out.println("get conference list failure");
|
System.out.println("get conference list failure");
|
||||||
System.exit(-1);
|
System.exit(-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user