(improvement) (semantic) query dimension value support specifying time range (#343)

Co-authored-by: jolunoluo
This commit is contained in:
LXW
2023-11-09 11:50:19 +08:00
committed by GitHub
parent 41aa6ff8e4
commit 2aeeb1a14e
5 changed files with 27 additions and 4 deletions

View File

@@ -235,6 +235,16 @@ public class MetricServiceImpl implements MetricService {
return metricResps.get(0);
}
@Override
public MetricResp getMetric(Long id, User user) {
MetricResp metricResp = getMetric(id);
if (metricResp == null) {
return null;
}
fillAdminRes(Lists.newArrayList(metricResp), user);
return metricResp;
}
private MetricResp getMetric(Long id) {
MetricDO metricDO = metricRepository.getMetricById(id);
if (metricDO == null) {

View File

@@ -30,6 +30,8 @@ public interface MetricService {
MetricResp getMetric(Long modelId, String bizName);
MetricResp getMetric(Long id, User user);
List<String> mockAlias(MetricReq metricReq, String mockType, User user);
Set<String> getMetricTags();

View File

@@ -92,11 +92,18 @@ public class MetricController {
return metricService.queryMetric(pageMetricReq, user);
}
@Deprecated
@GetMapping("getMetric/{modelId}/{bizName}")
public MetricResp getMetric(@PathVariable("modelId") Long modelId, @PathVariable("bizName") String bizName) {
return metricService.getMetric(modelId, bizName);
}
@GetMapping("getMetric/{id}")
public MetricResp getMetric(@PathVariable("id") Long id,
HttpServletRequest request, HttpServletResponse response) {
User user = UserHolder.findUser(request, response);
return metricService.getMetric(id, user);
}
@DeleteMapping("deleteMetric/{id}")
public Boolean deleteMetric(@PathVariable("id") Long id,