diff --git a/src/main/java/com/ly/ckibana/handlers/ParamHandler.java b/src/main/java/com/ly/ckibana/handlers/ParamHandler.java index 2be7fbc..088fe7b 100644 --- a/src/main/java/com/ly/ckibana/handlers/ParamHandler.java +++ b/src/main/java/com/ly/ckibana/handlers/ParamHandler.java @@ -140,7 +140,7 @@ public String doHandle(RequestContext context) { } String body = proxyConfigLoader.getYaml().dumpAs(kibanaProperty, Tag.MAP, DumperOptions.FlowStyle.BLOCK); - String response = EsClientUtil.saveOne(proxyConfigLoader.getMetadataRestClient(), proxyConfigLoader.getSettingsIndexName(), + String response = EsClientUtil.saveOne(proxyConfigLoader.getMetadataRestClient(), proxyConfigLoader.getSettingsIndexName(), "kibana", Map.of( "key", "kibana", diff --git a/src/main/java/com/ly/ckibana/util/DateUtils.java b/src/main/java/com/ly/ckibana/util/DateUtils.java index 4a0427e..86b102b 100644 --- a/src/main/java/com/ly/ckibana/util/DateUtils.java +++ b/src/main/java/com/ly/ckibana/util/DateUtils.java @@ -29,7 +29,6 @@ import java.util.Date; import java.util.List; import java.util.Locale; -import java.sql.Timestamp; @Slf4j public class DateUtils { diff --git a/src/main/java/com/ly/ckibana/util/ProxyUtils.java b/src/main/java/com/ly/ckibana/util/ProxyUtils.java index 0d285e6..dc9485a 100644 --- a/src/main/java/com/ly/ckibana/util/ProxyUtils.java +++ b/src/main/java/com/ly/ckibana/util/ProxyUtils.java @@ -279,7 +279,7 @@ public static Range getRangeWrappedBySqlFunction(Range orgRange, boolean isTimeF */ public static String generateTimeFieldSqlWithFormatDateTime64ZoneShangHai(Object value, String ckFieldType) { if (SqlUtils.isDateTime64(ckFieldType)) { - return String.format("toDateTime64(%s/1000,%d)", value.toString(),SqlUtils.getDateTime64Scale(ckFieldType)); + return String.format("toDateTime64(%s/1000,%d)", value.toString(), SqlUtils.getDateTime64Scale(ckFieldType)); } else if (SqlUtils.isDateTime(ckFieldType)) { return String.format("toDateTime(%s/1000)", value.toString()); } else { diff --git a/src/main/java/com/ly/ckibana/util/RestUtils.java b/src/main/java/com/ly/ckibana/util/RestUtils.java index 6f7b15a..066dbe5 100644 --- a/src/main/java/com/ly/ckibana/util/RestUtils.java +++ b/src/main/java/com/ly/ckibana/util/RestUtils.java @@ -87,7 +87,7 @@ public static RestClient initEsRestClient(String host, Map heade if (each.contains(":")) { String[] splits = each.split(":"); hosts[i] = new HttpHost(splits[0], Integer.parseInt(splits[1])); - }else { + } else { hosts[i] = new HttpHost(host); } } diff --git a/src/main/java/com/ly/ckibana/util/SqlUtils.java b/src/main/java/com/ly/ckibana/util/SqlUtils.java index 1949923..73c4f63 100644 --- a/src/main/java/com/ly/ckibana/util/SqlUtils.java +++ b/src/main/java/com/ly/ckibana/util/SqlUtils.java @@ -407,7 +407,6 @@ public static String getSelectTemplate(String selectSql, String table) { return String.format("SELECT %s FROM %s", selectSql, table); } - /** * 是否为DateTime64时间类型. * @@ -418,17 +417,16 @@ public static boolean isDateTime64(String ckFieldType) { return StringUtils.startsWith(ckFieldType, SqlConstants.TYPE_DATETIME64); } - /** - * DateTime64时间类型,提取精度 + * DateTime64时间类型,提取精度. * * @param ckFieldType ck字段类型,如DateTime64(3) * @return 精度,如3 */ public static int getDateTime64Scale(String ckFieldType) { - String scale= ckFieldType.replace(SqlConstants.TYPE_DATETIME64,StringUtils.EMPTY) - .replace(Constants.Symbol.LEFT_PARENTHESIS,StringUtils.EMPTY) - .replace(Constants.Symbol.RIGHT_PARENTHESIS,StringUtils.EMPTY); + String scale = ckFieldType.replace(SqlConstants.TYPE_DATETIME64, StringUtils.EMPTY) + .replace(Constants.Symbol.LEFT_PARENTHESIS, StringUtils.EMPTY) + .replace(Constants.Symbol.RIGHT_PARENTHESIS, StringUtils.EMPTY); return Integer.parseInt(scale); } /**