mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-14 13:47:09 +00:00
(improvement) (semantic) query dimension value support specifying time range (#343)
Co-authored-by: jolunoluo
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user