mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-13 21:17:08 +00:00
(improvement)(Headless) add ext info for model (#1019)
This commit is contained in:
@@ -9,6 +9,7 @@ import com.tencent.supersonic.headless.api.pojo.SchemaItem;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Data
|
||||
@@ -40,6 +41,8 @@ public class ModelReq extends SchemaItem {
|
||||
|
||||
private Long tagObjectId;
|
||||
|
||||
private Map<String, Object> ext;
|
||||
|
||||
public List<Dim> getTimeDimension() {
|
||||
if (modelDetail == null) {
|
||||
return Lists.newArrayList();
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.springframework.util.CollectionUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -54,6 +55,8 @@ public class ModelResp extends SchemaItem {
|
||||
|
||||
private String fullPath;
|
||||
|
||||
private Map<String, Object> ext;
|
||||
|
||||
public boolean openToAll() {
|
||||
return isOpen != null && isOpen == 1;
|
||||
}
|
||||
|
||||
@@ -58,4 +58,6 @@ public class ModelDO {
|
||||
|
||||
private String sourceType;
|
||||
|
||||
private String ext;
|
||||
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ public class DataSetServiceImpl
|
||||
DataSetResp dataSetResp = convert(dataSetDO);
|
||||
conflictCheck(dataSetResp);
|
||||
save(dataSetDO);
|
||||
dataSetResp.setId(dataSetDO.getId());
|
||||
return dataSetResp;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,9 @@ public class ModelConverter {
|
||||
modelDO.setStatus(StatusEnum.ONLINE.getCode());
|
||||
modelDO.setModelDetail(JSONObject.toJSONString(modelDetail));
|
||||
modelDO.setDrillDownDimensions(JSONObject.toJSONString(modelReq.getDrillDownDimensions()));
|
||||
if (modelReq.getExt() != null) {
|
||||
modelDO.setExt(JSONObject.toJSONString(modelReq.getExt()));
|
||||
}
|
||||
return modelDO;
|
||||
}
|
||||
|
||||
@@ -60,7 +63,8 @@ public class ModelConverter {
|
||||
modelResp.setViewOrgs(StringUtils.isBlank(modelDO.getViewOrg())
|
||||
? Lists.newArrayList() : Arrays.asList(modelDO.getViewOrg().split(",")));
|
||||
modelResp.setDrillDownDimensions(JsonUtil.toList(modelDO.getDrillDownDimensions(), DrillDownDimension.class));
|
||||
modelResp.setModelDetail(JSONObject.parseObject(modelDO.getModelDetail(), ModelDetail.class));
|
||||
modelResp.setModelDetail(JsonUtil.toObject(modelDO.getModelDetail(), ModelDetail.class));
|
||||
modelResp.setExt(JsonUtil.toObject(modelDO.getExt(), Map.class));
|
||||
return modelResp;
|
||||
}
|
||||
|
||||
@@ -81,6 +85,9 @@ public class ModelConverter {
|
||||
modelDO.setDrillDownDimensions(JSONObject.toJSONString(modelReq.getDrillDownDimensions()));
|
||||
}
|
||||
modelDO.setModelDetail(JSONObject.toJSONString((modelDetail)));
|
||||
if (modelReq.getExt() != null) {
|
||||
modelDO.setExt(JSONObject.toJSONString(modelReq.getExt()));
|
||||
}
|
||||
modelDO.setUpdatedBy(user.getName());
|
||||
modelDO.setUpdatedAt(new Date());
|
||||
return modelDO;
|
||||
|
||||
Reference in New Issue
Block a user