fix(log):日志检索模块,删除历史activesys ,修改logSource数据类型为int。增加NTC_IP_LOG 日志检索测试服务接口。后续删除历史遗留日志检索功能及其相关对象

This commit is contained in:
doufenghu
2018-06-10 16:18:34 +08:00
parent 7991707445
commit ea327b17d7
18 changed files with 314 additions and 5723 deletions

View File

@@ -40,14 +40,7 @@ public class DefaultRestErrorResolver implements RestErrorResolver,InitializingB
RestResult error = new RestResult();
error.setStatus(this.getHttpStatusByEx(ex));// 设置http状态
//获取日志源[只有日志需要返回日志源和ActiveSys]
String logSource = ((RestServiceException) ex).getLogSource();
String activeSys = ((RestServiceException) ex).getActiveSys();
if(logSource != null ){
error.setLogSource(logSource);
}
if(activeSys != null ){
error.setActiveSys(activeSys);
}
int logSource = ((RestServiceException) ex).getLogSource();
//RestServiceException 包含有错误code
if(ex instanceof RestServiceException){
@@ -71,8 +64,9 @@ public class DefaultRestErrorResolver implements RestErrorResolver,InitializingB
if(this.exceptionMappingDefinitions.containsKey(ex.getClass().getName())){
return HttpStatus.valueOf(Integer.parseInt(this.exceptionMappingDefinitions.get(ex.getClass()
.getName())));
} else {
return HttpStatus.INTERNAL_SERVER_ERROR;
}
else return HttpStatus.INTERNAL_SERVER_ERROR;
}

View File

@@ -48,7 +48,7 @@ public class RestResult {
/**
* 日志数据来源本地0 数据中心1
*/
private String logSource;
private Integer logSource;
/**
* 追踪状态码
@@ -59,14 +59,13 @@ public class RestResult {
}
public RestResult(HttpStatus status, RestBusinessCode businessCode, String msg,String fromUri,String activeSys,String fromSign,String traceCode) {
public RestResult(HttpStatus status, RestBusinessCode businessCode, String msg, String fromUri, Integer logSource,String traceCode) {
super();
this.status = status;
this.businessCode = businessCode;
this.msg = msg;
this.fromUri = fromUri;
this.activeSys=activeSys;
this.logSource=logSource;
this.logSource= logSource;
this.traceCode=traceCode;
}
@@ -137,14 +136,15 @@ public class RestResult {
this.activeSys = activeSys;
}
public String getLogSource() {
public Integer getLogSource() {
return logSource;
}
public void setLogSource(String logSource) {
public void setLogSource(Integer logSource) {
this.logSource = logSource;
}
/**
/**
* @return data
*/
public Object getData() {
@@ -166,7 +166,9 @@ public class RestResult {
this.traceCode = traceCode;
}
@Override
public String toString() {
return new StringBuilder().append("HttpStatus:").append(getStatus().value())
.append(" errorcode:")
.append(this.getBusinessCode().getValue())

View File

@@ -8,9 +8,7 @@ public class RestServiceException extends RuntimeException{
private int errorCode;
private String logSource;
private String activeSys;
private int logSource;
private String traceCode;
/**
@@ -33,8 +31,10 @@ public class RestServiceException extends RuntimeException{
this.traceCode = thread.getTraceCode();
thread.setConsumerTime(time);
thread.setBusinessCode(this.getErrorCode());
if(StringUtils.isEmpty(thread.getExceptionInfo()))
thread.setExceptionInfo(message);
if(StringUtils.isEmpty(thread.getExceptionInfo())) {
thread.setExceptionInfo(message);
}
new Thread(thread).start();
}
@@ -48,8 +48,10 @@ public class RestServiceException extends RuntimeException{
this.traceCode = thread.getTraceCode();
thread.setConsumerTime(time);
thread.setBusinessCode(this.getErrorCode());
if(StringUtils.isEmpty(thread.getExceptionInfo()))
thread.setExceptionInfo(message);
if(StringUtils.isEmpty(thread.getExceptionInfo())) {
thread.setExceptionInfo(message);
}
new Thread(thread).start();
}
@@ -61,19 +63,14 @@ public class RestServiceException extends RuntimeException{
public void setErrorCode(int errorCode) {
this.errorCode = errorCode;
}
public String getLogSource() {
return logSource;
}
public void setLogSource(String logSource) {
this.logSource = logSource;
}
public String getActiveSys() {
return activeSys;
}
public void setActiveSys(String activeSys) {
this.activeSys = activeSys;
}
public int getLogSource() {
return logSource;
}
public void setLogSource(int logSource) {
this.logSource = logSource;
}
public String getTraceCode() {
return traceCode;