channel api添加检查是否是订阅者的接口
This commit is contained in:
@@ -50,10 +50,10 @@ public class Main {
|
||||
|
||||
|
||||
//admin使用的是18080端口,超级管理接口,理论上不能对外开放端口,也不能让非内部服务知悉密钥。
|
||||
testAdmin();
|
||||
// testAdmin();
|
||||
|
||||
//Robot和Channel都是使用的80端口,第三方可以创建或者为第三方创建,第三方可以使用robot或者channel与IM系统进行对接。
|
||||
testRobot();
|
||||
// testRobot();
|
||||
testChannel();
|
||||
}
|
||||
|
||||
@@ -1443,6 +1443,14 @@ public class Main {
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
IMResult<Boolean> booleanIMResult = channelServiceApi.isSubscriber("userId2");
|
||||
if(booleanIMResult != null && booleanIMResult.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS && booleanIMResult.getResult()) {
|
||||
System.out.println("is subscriber success");
|
||||
} else {
|
||||
System.out.println("is subscriber failure");
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
resultVoid = channelServiceApi.unsubscribe("userId2");
|
||||
if (resultVoid != null && resultVoid.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
||||
System.out.println("unsubscriber done");
|
||||
|
||||
Reference in New Issue
Block a user