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 cn.wildfirechat.common.ErrorCode;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import win.liyufan.im.GitRepositoryState;
|
||||||
import win.liyufan.im.IMTopic;
|
import win.liyufan.im.IMTopic;
|
||||||
|
|
||||||
import java.util.Base64;
|
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())));
|
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 {
|
} else {
|
||||||
return new Result(errorCode1);
|
return new Result(errorCode1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import io.moquette.server.Server;
|
|||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class GitRepositoryState {
|
public class GitRepositoryState {
|
||||||
public final String tags;
|
public final String tags;
|
||||||
@@ -28,6 +29,8 @@ public class GitRepositoryState {
|
|||||||
public final String commitMessageFull;
|
public final String commitMessageFull;
|
||||||
public final String commitMessageShort;
|
public final String commitMessageShort;
|
||||||
public final String commitTime;
|
public final String commitTime;
|
||||||
|
public static final String globalLabel = UUID.randomUUID().toString();
|
||||||
|
public String label;
|
||||||
public final String closestTagName;
|
public final String closestTagName;
|
||||||
public final String closestTagCommitCount;
|
public final String closestTagCommitCount;
|
||||||
|
|
||||||
@@ -63,6 +66,7 @@ public class GitRepositoryState {
|
|||||||
this.buildHost = String.valueOf(properties.get("git.build.host"));
|
this.buildHost = String.valueOf(properties.get("git.build.host"));
|
||||||
this.buildVersion = String.valueOf(properties.get("git.build.version"));
|
this.buildVersion = String.valueOf(properties.get("git.build.version"));
|
||||||
this.runTime = Server.getServer().getRunTime();
|
this.runTime = Server.getServer().getRunTime();
|
||||||
|
this.label = globalLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GitRepositoryState getGitRepositoryState() throws IOException {
|
public static GitRepositoryState getGitRepositoryState() throws IOException {
|
||||||
|
|||||||
@@ -3,13 +3,15 @@ package cn.wildfirechat.pojos;
|
|||||||
public class OutputGetIMTokenData {
|
public class OutputGetIMTokenData {
|
||||||
private String userId;
|
private String userId;
|
||||||
private String token;
|
private String token;
|
||||||
|
private String serverLabel;
|
||||||
|
|
||||||
public OutputGetIMTokenData() {
|
public OutputGetIMTokenData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public OutputGetIMTokenData(String userId, String imToken) {
|
public OutputGetIMTokenData(String userId, String imToken, String label) {
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.token = imToken;
|
this.token = imToken;
|
||||||
|
this.serverLabel = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserId() {
|
public String getUserId() {
|
||||||
@@ -27,4 +29,12 @@ public class OutputGetIMTokenData {
|
|||||||
public void setToken(String token) {
|
public void setToken(String token) {
|
||||||
this.token = token;
|
this.token = token;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getServerLabel() {
|
||||||
|
return serverLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setServerLabel(String serverLabel) {
|
||||||
|
this.serverLabel = serverLabel;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user