From 44b8a1cca249c737d8cc64377a715ff177d1c4f0 Mon Sep 17 00:00:00 2001 From: jsy Date: Thu, 15 Jun 2023 14:00:48 +0800 Subject: [PATCH] refactor: optimize conditinos of queryFacadeImpl (#507) --- .../server/home/biz/service/TenantInitService.java | 2 +- .../home/biz/service/impl/DefaultTenantInitServiceImpl.java | 2 +- .../server/home/web/controller/QueryFacadeImpl.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/TenantInitService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/TenantInitService.java index 6800b5883..dfdb6d05d 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/TenantInitService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/TenantInitService.java @@ -59,7 +59,7 @@ public interface TenantInitService { */ String getTsdbTenant(String tenant); - Boolean checkConditions(String workspace, List filters); + Boolean checkConditions(String workspace, String metric, List filters); /** diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/DefaultTenantInitServiceImpl.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/DefaultTenantInitServiceImpl.java index 1b16aa2a9..7fb062f2f 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/DefaultTenantInitServiceImpl.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/DefaultTenantInitServiceImpl.java @@ -51,7 +51,7 @@ public String getTsdbTenant(String tenant) { } @Override - public Boolean checkConditions(String workspace, List filters) { + public Boolean checkConditions(String workspace, String metric, List filters) { return true; } diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/QueryFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/QueryFacadeImpl.java index 9abf09be1..08dd585ad 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/QueryFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/QueryFacadeImpl.java @@ -460,8 +460,8 @@ public QueryProto.QueryRequest convertRequest(DataQueryRequest request) { QueryProto.Datasource.Builder datasourceBuilder = QueryProto.Datasource.newBuilder(); toProtoBean(datasourceBuilder, d); - Boolean aBoolean = - tenantInitService.checkConditions(ms.getWorkspace(), datasourceBuilder.getFiltersList()); + Boolean aBoolean = tenantInitService.checkConditions(ms.getWorkspace(), + datasourceBuilder.getMetric(), datasourceBuilder.getFiltersList()); if (!aBoolean) { throw new MonitorException("workspace is illegal"); }