api/version和gettoken都添加节点信息
This commit is contained in:
@@ -20,6 +20,7 @@ import io.netty.handler.codec.http.FullHttpRequest;
|
||||
import cn.wildfirechat.common.ErrorCode;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import win.liyufan.im.GitRepositoryState;
|
||||
import win.liyufan.im.IMTopic;
|
||||
|
||||
import java.util.Base64;
|
||||
@@ -53,7 +54,7 @@ public class GetIMTokenAction extends AdminAction {
|
||||
|
||||
LOG.info("get im token success {},{},{}", userId, input.getClientId(), token.substring(0, Math.min(10, token.length())));
|
||||
|
||||
return new Result(errorCode1, new OutputGetIMTokenData(userId, token));
|
||||
return new Result(errorCode1, new OutputGetIMTokenData(userId, token, GitRepositoryState.globalLabel));
|
||||
} else {
|
||||
return new Result(errorCode1);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import io.moquette.server.Server;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.Properties;
|
||||
import java.util.UUID;
|
||||
|
||||
public class GitRepositoryState {
|
||||
public final String tags;
|
||||
@@ -28,6 +29,8 @@ public class GitRepositoryState {
|
||||
public final String commitMessageFull;
|
||||
public final String commitMessageShort;
|
||||
public final String commitTime;
|
||||
public static final String globalLabel = UUID.randomUUID().toString();
|
||||
public String label;
|
||||
public final String closestTagName;
|
||||
public final String closestTagCommitCount;
|
||||
|
||||
@@ -63,6 +66,7 @@ public class GitRepositoryState {
|
||||
this.buildHost = String.valueOf(properties.get("git.build.host"));
|
||||
this.buildVersion = String.valueOf(properties.get("git.build.version"));
|
||||
this.runTime = Server.getServer().getRunTime();
|
||||
this.label = globalLabel;
|
||||
}
|
||||
|
||||
public static GitRepositoryState getGitRepositoryState() throws IOException {
|
||||
|
||||
@@ -3,13 +3,15 @@ package cn.wildfirechat.pojos;
|
||||
public class OutputGetIMTokenData {
|
||||
private String userId;
|
||||
private String token;
|
||||
private String serverLabel;
|
||||
|
||||
public OutputGetIMTokenData() {
|
||||
}
|
||||
|
||||
public OutputGetIMTokenData(String userId, String imToken) {
|
||||
public OutputGetIMTokenData(String userId, String imToken, String label) {
|
||||
this.userId = userId;
|
||||
this.token = imToken;
|
||||
this.serverLabel = label;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
@@ -27,4 +29,12 @@ public class OutputGetIMTokenData {
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public String getServerLabel() {
|
||||
return serverLabel;
|
||||
}
|
||||
|
||||
public void setServerLabel(String serverLabel) {
|
||||
this.serverLabel = serverLabel;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user