This commit is contained in:
Guangdong Liu
2024-03-21 14:04:21 +08:00
committed by GitHub
parent 449ad8b117
commit 031b2bff5f

View File

@@ -339,16 +339,16 @@ public class TagMetaServiceImpl implements TagMetaService {
DimensionResp dimension = dimensionService.getDimension(tagReq.getItemId()); DimensionResp dimension = dimensionService.getDimension(tagReq.getItemId());
ModelResp model = modelService.getModel(dimension.getModelId()); ModelResp model = modelService.getModel(dimension.getModelId());
if (Objects.isNull(model.getTagObjectId())) { if (Objects.isNull(model.getTagObjectId())) {
throw new RuntimeException(String.format("this dimension:%s is not supported to create tag, no related tag object", throw new RuntimeException(String.format("this dimension:%s is not supported to create tag,"
tagReq.getItemId())); + " no related tag object", tagReq.getItemId()));
} }
} }
if (TagDefineType.METRIC.equals(tagReq.getTagDefineType())) { if (TagDefineType.METRIC.equals(tagReq.getTagDefineType())) {
MetricResp metric = metricService.getMetric(tagReq.getItemId()); MetricResp metric = metricService.getMetric(tagReq.getItemId());
ModelResp model = modelService.getModel(metric.getModelId()); ModelResp model = modelService.getModel(metric.getModelId());
if (Objects.isNull(model.getTagObjectId())) { if (Objects.isNull(model.getTagObjectId())) {
throw new RuntimeException(String.format("this metric:%s is not supported to create tag, no related tag object", throw new RuntimeException(String.format("this metric:%s is not supported to create tag,"
tagReq.getItemId())); + " no related tag object", tagReq.getItemId()));
} }
} }
} }