添加server sdk检查server api的工具
This commit is contained in:
@@ -29,6 +29,11 @@
|
||||
<directory>../systemd/</directory>
|
||||
<outputDirectory>/systemd</outputDirectory>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<directory>src/main/checker/</directory>
|
||||
<outputDirectory>checker/</outputDirectory>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
|
||||
<files>
|
||||
@@ -75,6 +80,11 @@
|
||||
<outputDirectory>server_sdk/</outputDirectory>
|
||||
<destName>common-${project.version}.jar</destName>
|
||||
</file>
|
||||
|
||||
<file>
|
||||
<source>../sdk/target/checker.jar</source>
|
||||
<outputDirectory>checker/</outputDirectory>
|
||||
</file>
|
||||
</files>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
部署IM服务后,可以使用Server SDK通过API来检查服务的部署情况,可以执行:
|
||||
```shell
|
||||
java -jar checker.jar http://127.0.0.1:18080 123456 http://127.0.0.1 true false
|
||||
```
|
||||
来检查。检查之后会产生垃圾数据,请在检查之后停掉IM服务后,再删除掉IM服务数据库。此检查仅检查API,检查通过并不代表部署肯定成功,还需要客户端来验证。
|
||||
+32
@@ -81,4 +81,36 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}-${version}</finalName>
|
||||
<defaultGoal>install</defaultGoal>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
<finalName>checker</finalName>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>cn.wildfirechat.sdk.Main</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>assemble-all</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@@ -31,6 +31,20 @@ public class Main {
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (args.length == 5) {
|
||||
AdminUrl = args[0];
|
||||
AdminSecret = args[1];
|
||||
IMUrl = args[2];
|
||||
commercialServer = Boolean.parseBoolean(args[3]);
|
||||
advanceVoip = Boolean.parseBoolean(args[4]);
|
||||
} else {
|
||||
System.out.println("Usage: java -jar checker.jar adminUrl adminSecret imUrl commercialServer advanceVoip \n e.g. java -jar checker.jar http://192.168.1.80:18080 123456 http://192.168.1.80 false false");
|
||||
System.out.println();
|
||||
System.out.println();
|
||||
System.out.println("Use default value: java -jar checker.jar http://127.0.0.1:18080 123456 http://127.0.0.1 false false");
|
||||
}
|
||||
|
||||
|
||||
//admin使用的是18080端口,超级管理接口,理论上不能对外开放端口,也不能让非内部服务知悉密钥。
|
||||
testAdmin();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user