使用REST API测试服务器端上线,发现一直是offline不知道为啥?
/**
* 注册IM用户[单个]
*/
ObjectNode datanode = JsonNodeFactory.instance.objectNode();
datanode.put("username","imarketuser_1");
datanode.put("password", Constants.DEFAULT_PASSWORD);
// ObjectNode createNewIMUserSingleNode = createNewIMUserSingle(datanode);
// if (null != createNewIMUserSingleNode) {
// LOGGER.info("注册IM用户[单个]: " + createNewIMUserSingleNode.toString());
// }
/**
* IM用户登录
*/
ObjectNode imUserLoginNode = imUserLogin(datanode.get("username").asText(), datanode.get("password").asText());
if (null != imUserLoginNode) {
LOGGER.info("IM用户登录: " + imUserLoginNode.toString());
}
// 检测用户是否在线
String targetUserName = "imarketuser_1";
ObjectNode usernode = getUserStatus(targetUserName);
if (null != usernode) {
LOGGER.info("检测用户是否在线: " + usernode.toString());
}
* 注册IM用户[单个]
*/
ObjectNode datanode = JsonNodeFactory.instance.objectNode();
datanode.put("username","imarketuser_1");
datanode.put("password", Constants.DEFAULT_PASSWORD);
// ObjectNode createNewIMUserSingleNode = createNewIMUserSingle(datanode);
// if (null != createNewIMUserSingleNode) {
// LOGGER.info("注册IM用户[单个]: " + createNewIMUserSingleNode.toString());
// }
/**
* IM用户登录
*/
ObjectNode imUserLoginNode = imUserLogin(datanode.get("username").asText(), datanode.get("password").asText());
if (null != imUserLoginNode) {
LOGGER.info("IM用户登录: " + imUserLoginNode.toString());
}
// 检测用户是否在线
String targetUserName = "imarketuser_1";
ObjectNode usernode = getUserStatus(targetUserName);
if (null != usernode) {
LOGGER.info("检测用户是否在线: " + usernode.toString());
}
没有找到相关结果
已邀请:
2 个回复
beyond - imgeek运营
现在再获取一下用户在线状态试试
jindez
[com.easemob.server.example.jersey.utils.JerseyUtils]检测用户是否在线: {"action":"get","uri":"http://a1.easemob.com/jindez/imarket/users/imarketuser_1/status","entities":,"data":{"imarketuser_1":"offline"},"timestamp":1435884865473,"duration":6,"statusCode":200}