api
This commit is contained in:
@@ -6,6 +6,7 @@ import cn.wildfirechat.proto.ProtoConstants;
|
||||
import cn.wildfirechat.sdk.model.IMResult;
|
||||
import cn.wildfirechat.sdk.utilities.AdminHttpUtils;
|
||||
import cn.wildfirechat.sdk.utilities.RobotHttpUtils;
|
||||
import io.netty.util.internal.StringUtil;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -903,5 +904,13 @@ public class Main {
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
IMResult<OutputDeviceHost> getDeviceHost = UserAdmin.getDeviceHost("deviceId1");
|
||||
if (getDeviceHost != null && getDeviceHost.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS && !StringUtil.isNullOrEmpty(getDeviceHost.getResult().getHost())) {
|
||||
System.out.println("Get user device success");
|
||||
} else {
|
||||
System.out.println("Get device failure");
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,4 +91,10 @@ public class UserAdmin {
|
||||
return AdminHttpUtils.httpJsonPost(path, inputUserId, OutputDeviceList.class);
|
||||
}
|
||||
|
||||
public static IMResult<OutputDeviceHost> getDeviceHost(String deviceId) throws Exception {
|
||||
String path = APIPath.Get_Device_Host;
|
||||
InputDeviceId inputUserId = new InputDeviceId();
|
||||
inputUserId.setDeviceId(deviceId);
|
||||
return AdminHttpUtils.httpJsonPost(path, inputUserId, OutputDeviceHost.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user