mirror of
https://github.com/dataease/dataease.git
synced 2026-05-23 22:08:34 +08:00
refactor: 模板管理模板市场合并为模板中心
This commit is contained in:
@@ -49,7 +49,7 @@ public class ChartDataServer implements ChartDataApi {
|
||||
@Override
|
||||
public ChartViewDTO getData(ChartViewDTO chartViewDTO) throws Exception {
|
||||
try {
|
||||
// 从模版数据获取
|
||||
// 从模板数据获取
|
||||
if(CommonConstants.VIEW_DATA_FROM.TEMPLATE.equalsIgnoreCase(chartViewDTO.getDataFrom())){
|
||||
return extendDataManage.getChartDataInfo(chartViewDTO.getId(),chartViewDTO);
|
||||
}else{
|
||||
|
||||
@@ -26,7 +26,7 @@ public class OptConstants {
|
||||
public static final int DATASET = 4;
|
||||
//数据源
|
||||
public static final int DATASOURCE = 5;
|
||||
//模版
|
||||
//模板
|
||||
public static final int TEMPLATE = 6;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class VisualizationTemplate implements Serializable {
|
||||
private Integer level;
|
||||
|
||||
/**
|
||||
* 模版种类 dataV or dashboard 目录或者文件夹
|
||||
* 模板种类 dataV or dashboard 目录或者文件夹
|
||||
*/
|
||||
private String dvType;
|
||||
|
||||
@@ -62,7 +62,7 @@ public class VisualizationTemplate implements Serializable {
|
||||
private String snapshot;
|
||||
|
||||
/**
|
||||
* 模版类型 system 系统内置 self 用户自建
|
||||
* 模板类型 system 系统内置 self 用户自建
|
||||
*/
|
||||
private String templateType;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.dataease.template.dao.ext;
|
||||
import io.dataease.api.template.dto.TemplateManageDTO;
|
||||
import io.dataease.api.template.request.TemplateManageRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -11,5 +12,6 @@ import java.util.List;
|
||||
public interface ExtVisualizationTemplateMapper{
|
||||
|
||||
List<TemplateManageDTO> findTemplateList(TemplateManageRequest request);
|
||||
List<TemplateManageDTO> findBaseTemplateList(@Param("nodeType") String nodeType);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.dataease.template.manage;
|
||||
|
||||
import io.dataease.api.template.dto.TemplateManageDTO;
|
||||
import io.dataease.api.template.dto.TemplateManageFileDTO;
|
||||
import io.dataease.api.template.dto.TemplateMarketDTO;
|
||||
import io.dataease.api.template.dto.TemplateMarketPreviewInfoDTO;
|
||||
@@ -10,9 +11,11 @@ import io.dataease.api.template.vo.TemplateCategoryVO;
|
||||
import io.dataease.exception.DEException;
|
||||
import io.dataease.operation.manage.CoreOptRecentManage;
|
||||
import io.dataease.system.manage.SysParameterManage;
|
||||
import io.dataease.template.dao.ext.ExtVisualizationTemplateMapper;
|
||||
import io.dataease.utils.HttpClientConfig;
|
||||
import io.dataease.utils.HttpClientUtil;
|
||||
import io.dataease.utils.JsonUtil;
|
||||
import io.dataease.utils.LogUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -25,7 +28,7 @@ import java.util.stream.Collectors;
|
||||
* Author: wangjiahao
|
||||
*/
|
||||
@Service
|
||||
public class TemplateMarketManage {
|
||||
public class TemplateCenterManage {
|
||||
|
||||
private final static String POSTS_API = "/api/content/posts?page=0&size=2000";
|
||||
|
||||
@@ -40,6 +43,9 @@ public class TemplateMarketManage {
|
||||
@Resource
|
||||
private CoreOptRecentManage coreOptRecentManage;
|
||||
|
||||
@Resource
|
||||
private ExtVisualizationTemplateMapper templateManageMapper;
|
||||
|
||||
/**
|
||||
* @param templateUrl template url
|
||||
* @Description Get template file from template market
|
||||
@@ -64,22 +70,45 @@ public class TemplateMarketManage {
|
||||
return HttpClientUtil.get(url, config);
|
||||
}
|
||||
|
||||
private MarketTemplateV2BaseResponse templateQuery(Map<String, String> templateParams){
|
||||
String result = marketGet(templateParams.get("template.url") + POSTS_API_V2, null);
|
||||
MarketTemplateV2BaseResponse postsResult = JsonUtil.parseObject(result, MarketTemplateV2BaseResponse.class);
|
||||
return postsResult;
|
||||
}
|
||||
private MarketTemplateV2BaseResponse templateQuery(Map<String, String> templateParams) {
|
||||
String result = marketGet(templateParams.get("template.url") + POSTS_API_V2, null);
|
||||
MarketTemplateV2BaseResponse postsResult = JsonUtil.parseObject(result, MarketTemplateV2BaseResponse.class);
|
||||
return postsResult;
|
||||
}
|
||||
|
||||
public MarketBaseResponse searchTemplate() {
|
||||
try {
|
||||
Map<String, String> templateParams = sysParameterManage.groupVal("template.");
|
||||
return baseResponseV2Trans(templateQuery(templateParams), templateParams.get("template.url"));
|
||||
return baseResponseV2Trans(templateQuery(templateParams), searchTemplateFromManage(), templateParams.get("template.url"));
|
||||
} catch (Exception e) {
|
||||
DEException.throwException(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<TemplateMarketDTO> searchTemplateFromManage() {
|
||||
try {
|
||||
List<TemplateManageDTO> manageResult = templateManageMapper.findBaseTemplateList("template");
|
||||
List<TemplateManageDTO> categories = templateManageMapper.findBaseTemplateList("folder");
|
||||
Map<String, String> categoryMap = categories.stream()
|
||||
.collect(Collectors.toMap(TemplateManageDTO::getId, TemplateManageDTO::getName));
|
||||
return baseManage2MarketTrans(manageResult, categoryMap);
|
||||
} catch (Exception e) {
|
||||
DEException.throwException(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<TemplateMarketDTO> baseManage2MarketTrans(List<TemplateManageDTO> manageResult, Map<String, String> categoryMap) {
|
||||
List<TemplateMarketDTO> result = new ArrayList<>();
|
||||
manageResult.stream().forEach(templateManageDTO -> {
|
||||
templateManageDTO.setCategoryName(categoryMap.get(templateManageDTO.getPid()));
|
||||
result.add(new TemplateMarketDTO(templateManageDTO));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public MarketBaseResponse searchTemplateRecommend() {
|
||||
try {
|
||||
Map<String, String> templateParams = sysParameterManage.groupVal("template.");
|
||||
@@ -93,7 +122,7 @@ public class TemplateMarketManage {
|
||||
public MarketPreviewBaseResponse searchTemplatePreview() {
|
||||
try {
|
||||
Map<String, String> templateParams = sysParameterManage.groupVal("template.");
|
||||
return basePreviewResponseV2Trans(templateQuery(templateParams), templateParams.get("template.url"));
|
||||
return basePreviewResponseV2Trans(templateQuery(templateParams), searchTemplateFromManage(), templateParams.get("template.url"));
|
||||
} catch (Exception e) {
|
||||
DEException.throwException(e);
|
||||
}
|
||||
@@ -106,76 +135,57 @@ public class TemplateMarketManage {
|
||||
List<TemplateMarketDTO> contents = new ArrayList<>();
|
||||
v2BaseResponse.getItems().stream().forEach(marketTemplateV2ItemResult -> {
|
||||
MarketApplicationSpecVO spec = marketTemplateV2ItemResult.getApplication().getSpec();
|
||||
if("Y".equalsIgnoreCase(spec.getSuggest())){
|
||||
contents.add(new TemplateMarketDTO(spec.getReadmeName(), spec.getDisplayName(), spec.getScreenshots().get(0).getUrl(), spec.getLinks().get(0).getUrl(), categoriesMap.get(spec.getLabel()), spec.getTemplateType(), useTime.get(spec.getReadmeName()),"Y"));
|
||||
if ("Y".equalsIgnoreCase(spec.getSuggest())) {
|
||||
contents.add(new TemplateMarketDTO(spec.getReadmeName(), spec.getDisplayName(), spec.getScreenshots().get(0).getUrl(), spec.getLinks().get(0).getUrl(), categoriesMap.get(spec.getLabel()), spec.getTemplateType(), useTime.get(spec.getReadmeName()), "Y"));
|
||||
}
|
||||
});
|
||||
// 最近使用排序
|
||||
Collections.sort(contents);
|
||||
return new MarketBaseResponse(url,contents);
|
||||
return new MarketBaseResponse(url, contents);
|
||||
}
|
||||
|
||||
private MarketBaseResponse baseResponseV2Trans(MarketTemplateV2BaseResponse v2BaseResponse, String url) {
|
||||
private MarketBaseResponse baseResponseV2Trans(MarketTemplateV2BaseResponse v2BaseResponse, List<TemplateMarketDTO> contents, String url) {
|
||||
Map<String, Long> useTime = coreOptRecentManage.findTemplateRecentUseTime();
|
||||
Map<String, String> categoriesMap = getCategoriesBaseV2();
|
||||
List<TemplateMarketDTO> contents = new ArrayList<>();
|
||||
v2BaseResponse.getItems().stream().forEach(marketTemplateV2ItemResult -> {
|
||||
MarketApplicationSpecVO spec = marketTemplateV2ItemResult.getApplication().getSpec();
|
||||
contents.add(new TemplateMarketDTO(spec.getReadmeName(), spec.getDisplayName(), spec.getScreenshots().get(0).getUrl(), spec.getLinks().get(0).getUrl(), categoriesMap.get(spec.getLabel()), spec.getTemplateType(), useTime.get(spec.getReadmeName()),spec.getSuggest()));
|
||||
contents.add(new TemplateMarketDTO(spec.getReadmeName(), spec.getDisplayName(), spec.getScreenshots().get(0).getUrl(), spec.getLinks().get(0).getUrl(), categoriesMap.get(spec.getLabel()), spec.getTemplateType(), useTime.get(spec.getReadmeName()), spec.getSuggest()));
|
||||
});
|
||||
// 最近使用排序
|
||||
Collections.sort(contents);
|
||||
return new MarketBaseResponse(url,contents);
|
||||
return new MarketBaseResponse(url, contents);
|
||||
}
|
||||
|
||||
private MarketPreviewBaseResponse basePreviewResponseV2Trans(MarketTemplateV2BaseResponse v2BaseResponse, String url) {
|
||||
private MarketPreviewBaseResponse basePreviewResponseV2Trans(MarketTemplateV2BaseResponse v2BaseResponse, List<TemplateMarketDTO> manageContents, String url) {
|
||||
Map<String, Long> useTime = coreOptRecentManage.findTemplateRecentUseTime();
|
||||
Map<String, String> categoriesMap = getCategoriesBaseV2();
|
||||
List<String> categories = new ArrayList<>();
|
||||
List<MarketMetaDataVO> categoryVO = getCategoriesV2();
|
||||
Map<String, String> categoriesMap = categoryVO.stream()
|
||||
.collect(Collectors.toMap(MarketMetaDataVO::getSlug, MarketMetaDataVO::getLabel));
|
||||
List<String> categories = categoryVO.stream().filter(node -> !"全部".equalsIgnoreCase(node.getLabel())).map(MarketMetaDataVO::getLabel)
|
||||
.collect(Collectors.toList());
|
||||
List<TemplateMarketPreviewInfoDTO> result = new ArrayList<>();
|
||||
categoriesMap.forEach((key,value)->{
|
||||
if(!"全部".equalsIgnoreCase(value)){
|
||||
categories.add(value);
|
||||
categoriesMap.forEach((key, value) -> {
|
||||
if (!"全部".equalsIgnoreCase(value)) {
|
||||
List<TemplateMarketDTO> contents = new ArrayList<>();
|
||||
v2BaseResponse.getItems().stream().forEach(marketTemplateV2ItemResult -> {
|
||||
MarketApplicationSpecVO spec = marketTemplateV2ItemResult.getApplication().getSpec();
|
||||
if(key.equalsIgnoreCase(spec.getLabel())){
|
||||
contents.add(new TemplateMarketDTO(spec.getReadmeName(), spec.getDisplayName(), spec.getScreenshots().get(0).getUrl(), spec.getLinks().get(0).getUrl(), categoriesMap.get(spec.getLabel()), spec.getTemplateType(), useTime.get(spec.getReadmeName()),spec.getSuggest()));
|
||||
if (key.equalsIgnoreCase(spec.getLabel())) {
|
||||
contents.add(new TemplateMarketDTO(spec.getReadmeName(), spec.getDisplayName(), spec.getScreenshots().get(0).getUrl(), spec.getLinks().get(0).getUrl(), categoriesMap.get(spec.getLabel()), spec.getTemplateType(), useTime.get(spec.getReadmeName()), spec.getSuggest()));
|
||||
}
|
||||
});
|
||||
manageContents.stream().forEach(templateMarketDTO -> {
|
||||
if (value.equalsIgnoreCase(templateMarketDTO.getMainCategory())) {
|
||||
contents.add(templateMarketDTO);
|
||||
}
|
||||
});
|
||||
Collections.sort(contents);
|
||||
result.add(new TemplateMarketPreviewInfoDTO(value,contents));
|
||||
result.add(new TemplateMarketPreviewInfoDTO(value, contents));
|
||||
}
|
||||
});
|
||||
// 最近使用排序
|
||||
return new MarketPreviewBaseResponse(url,categories,result);
|
||||
return new MarketPreviewBaseResponse(url, categories, result);
|
||||
}
|
||||
|
||||
public MarketBaseResponse searchTemplateV1() {
|
||||
try {
|
||||
Map<String, String> templateParams = sysParameterManage.groupVal("template.");
|
||||
String result = marketGet(templateParams.get("template.url") + POSTS_API, templateParams.get("template.accessKey"));
|
||||
MarketTemplateBaseResponse postsResult = JsonUtil.parseObject(result, MarketTemplateBaseResponse.class);
|
||||
MarketBaseResponse response = new MarketBaseResponse(templateParams.get("template.url"), postsResult.getData().getContent());
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
DEException.throwException(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<String> getCategoriesV1() {
|
||||
Map<String, String> templateParams = sysParameterManage.groupVal("template.");
|
||||
String resultStr = marketGet(templateParams.get("template.url") + CATEGORIES_API, templateParams.get("template.accessKey"));
|
||||
MarketCategoryBaseResponse categoryBaseResponse = JsonUtil.parseObject(resultStr, MarketCategoryBaseResponse.class);
|
||||
List<TemplateCategoryVO> categories = categoryBaseResponse.getData();
|
||||
if (CollectionUtils.isNotEmpty(categories)) {
|
||||
return categories.stream().filter(item -> !"应用系列".equals(item.getName())).sorted(Comparator.comparing(TemplateCategoryVO::getPriority)).map(TemplateCategoryVO::getName).collect(Collectors.toList());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<String> getCategories() {
|
||||
return getCategoriesV2().stream().map(MarketMetaDataVO::getLabel)
|
||||
@@ -196,10 +206,21 @@ public class TemplateMarketManage {
|
||||
}
|
||||
|
||||
public List<MarketMetaDataVO> getCategoriesV2() {
|
||||
Map<String, String> templateParams = sysParameterManage.groupVal("template.");
|
||||
String resultStr = marketGet(templateParams.get("template.url") + TEMPLATE_META_DATA_URL, null);
|
||||
MarketMetaDataBaseResponse metaData = JsonUtil.parseObject(resultStr, MarketMetaDataBaseResponse.class);
|
||||
List<MarketMetaDataVO> categories = metaData.getLabels();
|
||||
return categories;
|
||||
List<MarketMetaDataVO> allCategories = new ArrayList<>();
|
||||
List<TemplateManageDTO> manageCategories = templateManageMapper.findBaseTemplateList("folder");
|
||||
List<MarketMetaDataVO> manageCategoriesTrans = manageCategories.stream()
|
||||
.map(templateCategory -> new MarketMetaDataVO(templateCategory.getId(), templateCategory.getName()))
|
||||
.collect(Collectors.toList());
|
||||
try {
|
||||
Map<String, String> templateParams = sysParameterManage.groupVal("template.");
|
||||
String resultStr = marketGet(templateParams.get("template.url") + TEMPLATE_META_DATA_URL, null);
|
||||
MarketMetaDataBaseResponse metaData = JsonUtil.parseObject(resultStr, MarketMetaDataBaseResponse.class);
|
||||
allCategories.addAll(metaData.getLabels());
|
||||
} catch (Exception e) {
|
||||
LogUtil.error("模板市场分类获取错误", e);
|
||||
}
|
||||
allCategories.addAll(manageCategoriesTrans);
|
||||
return allCategories;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import io.dataease.api.template.TemplateMarketApi;
|
||||
import io.dataease.api.template.response.MarketBaseResponse;
|
||||
import io.dataease.api.template.response.MarketPreviewBaseResponse;
|
||||
import io.dataease.api.template.vo.MarketMetaDataVO;
|
||||
import io.dataease.template.manage.TemplateMarketManage;
|
||||
import io.dataease.template.manage.TemplateCenterManage;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -20,28 +20,28 @@ import java.util.List;
|
||||
public class TemplateMarketService implements TemplateMarketApi {
|
||||
|
||||
@Resource
|
||||
private TemplateMarketManage templateMarketManage;
|
||||
private TemplateCenterManage templateCenterManage;
|
||||
@Override
|
||||
public MarketBaseResponse searchTemplate() {
|
||||
return templateMarketManage.searchTemplate();
|
||||
return templateCenterManage.searchTemplate();
|
||||
}
|
||||
@Override
|
||||
public MarketBaseResponse searchTemplateRecommend() {
|
||||
return templateMarketManage.searchTemplateRecommend();
|
||||
return templateCenterManage.searchTemplateRecommend();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarketPreviewBaseResponse searchTemplatePreview() {
|
||||
return templateMarketManage.searchTemplatePreview();
|
||||
return templateCenterManage.searchTemplatePreview();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> categories() {
|
||||
return templateMarketManage.getCategories();
|
||||
return templateCenterManage.getCategories();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MarketMetaDataVO> categoriesObject() {
|
||||
return templateMarketManage.getCategoriesObject();
|
||||
return templateCenterManage.getCategoriesObject();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import io.dataease.api.visualization.request.VisualizationWorkbranchQueryRequest
|
||||
import io.dataease.api.visualization.vo.DataVisualizationVO;
|
||||
import io.dataease.api.visualization.vo.VisualizationResourceVO;
|
||||
import io.dataease.chart.dao.auto.entity.CoreChartView;
|
||||
import io.dataease.chart.dao.auto.mapper.CoreChartViewMapper;
|
||||
import io.dataease.chart.manage.ChartDataManage;
|
||||
import io.dataease.chart.manage.ChartViewManege;
|
||||
import io.dataease.commons.constants.DataVisualizationConstants;
|
||||
@@ -26,7 +25,7 @@ import io.dataease.template.dao.auto.entity.VisualizationTemplate;
|
||||
import io.dataease.template.dao.auto.entity.VisualizationTemplateExtendData;
|
||||
import io.dataease.template.dao.auto.mapper.VisualizationTemplateExtendDataMapper;
|
||||
import io.dataease.template.dao.auto.mapper.VisualizationTemplateMapper;
|
||||
import io.dataease.template.manage.TemplateMarketManage;
|
||||
import io.dataease.template.manage.TemplateCenterManage;
|
||||
import io.dataease.utils.AuthUtils;
|
||||
import io.dataease.utils.BeanUtils;
|
||||
import io.dataease.utils.IDUtils;
|
||||
@@ -73,7 +72,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
private VisualizationTemplateMapper templateMapper;
|
||||
|
||||
@Resource
|
||||
private TemplateMarketManage templateMarketManage;
|
||||
private TemplateCenterManage templateCenterManage;
|
||||
|
||||
@Resource
|
||||
private StaticResourceServer staticResourceServer;
|
||||
@@ -251,7 +250,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
name = request.getName();
|
||||
dvType = request.getType();
|
||||
} else if (DataVisualizationConstants.NEW_PANEL_FROM.NEW_MARKET_TEMPLATE.equals(newFrom)) {
|
||||
TemplateManageFileDTO templateFileInfo = templateMarketManage.getTemplateFromMarket(request.getTemplateUrl());
|
||||
TemplateManageFileDTO templateFileInfo = templateCenterManage.getTemplateFromMarket(request.getTemplateUrl());
|
||||
if (templateFileInfo == null) {
|
||||
DEException.throwException("Can't find the template's info from market,please check");
|
||||
}
|
||||
@@ -261,7 +260,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
staticResource = templateFileInfo.getStaticResource();
|
||||
name = templateFileInfo.getName();
|
||||
dvType = templateFileInfo.getDvType();
|
||||
// 模版市场记录
|
||||
// 模板市场记录
|
||||
coreOptRecentManage.saveOpt(request.getResourceName(), OptConstants.OPT_RESOURCE_TYPE.TEMPLATE,OptConstants.OPT_TYPE.NEW);
|
||||
}
|
||||
// 解析动态数据
|
||||
@@ -286,7 +285,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
extendDataInfo.put(newViewId, extendDataDTO);
|
||||
templateData = templateData.replaceAll(originViewId, newViewId.toString());
|
||||
canvasViewInfo.put(chartView.getId(), chartView);
|
||||
//插入模版数据 此处预先插入减少数据交互量
|
||||
//插入模板数据 此处预先插入减少数据交互量
|
||||
VisualizationTemplateExtendData extendData = new VisualizationTemplateExtendData();
|
||||
templateExtendDataMapper.insert(BeanUtils.copyBean(extendData, extendDataDTO));
|
||||
}
|
||||
|
||||
@@ -4,12 +4,12 @@ CREATE TABLE `visualization_template` (
|
||||
`name` varchar(255) DEFAULT NULL COMMENT '名称',
|
||||
`pid` varchar(255) DEFAULT NULL COMMENT '父级id',
|
||||
`level` int(10) DEFAULT NULL COMMENT '层级',
|
||||
`dv_type` varchar(255) DEFAULT NULL COMMENT '模版种类 dataV or dashboard 目录或者文件夹',
|
||||
`dv_type` varchar(255) DEFAULT NULL COMMENT '模板种类 dataV or dashboard 目录或者文件夹',
|
||||
`node_type` varchar(255) DEFAULT NULL COMMENT '节点类型 folder or panel 目录或者文件夹',
|
||||
`create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` bigint(13) DEFAULT NULL COMMENT '创建时间',
|
||||
`snapshot` longtext COMMENT '缩略图',
|
||||
`template_type` varchar(255) DEFAULT NULL COMMENT '模版类型 system 系统内置 self 用户自建 ',
|
||||
`template_type` varchar(255) DEFAULT NULL COMMENT '模板类型 system 系统内置 self 用户自建 ',
|
||||
`template_style` longtext COMMENT 'template 样式',
|
||||
`template_data` longtext COMMENT 'template 数据',
|
||||
`dynamic_data` longtext COMMENT '预存数据',
|
||||
|
||||
@@ -5,12 +5,12 @@ CREATE TABLE `visualization_template`
|
||||
`name` varchar(255) DEFAULT NULL COMMENT '名称',
|
||||
`pid` varchar(255) DEFAULT NULL COMMENT '父级id',
|
||||
`level` int(10) DEFAULT NULL COMMENT '层级',
|
||||
`dv_type` varchar(255) DEFAULT NULL COMMENT '模版种类 dataV or dashboard 目录或者文件夹',
|
||||
`dv_type` varchar(255) DEFAULT NULL COMMENT '模板种类 dataV or dashboard 目录或者文件夹',
|
||||
`node_type` varchar(255) DEFAULT NULL COMMENT '节点类型 folder or panel 目录或者文件夹',
|
||||
`create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` bigint(13) DEFAULT NULL COMMENT '创建时间',
|
||||
`snapshot` longtext COMMENT '缩略图',
|
||||
`template_type` varchar(255) DEFAULT NULL COMMENT '模版类型 system 系统内置 self 用户自建 ',
|
||||
`template_type` varchar(255) DEFAULT NULL COMMENT '模板类型 system 系统内置 self 用户自建 ',
|
||||
`template_style` longtext COMMENT 'template 样式',
|
||||
`template_data` longtext COMMENT 'template 数据',
|
||||
`dynamic_data` longtext COMMENT '预存数据',
|
||||
|
||||
@@ -30,6 +30,19 @@
|
||||
visualization_template.template_style, visualization_template.template_data, visualization_template.dynamic_data
|
||||
</sql>
|
||||
|
||||
<select id="findBaseTemplateList" resultMap="BaseResultMapDTO">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM
|
||||
visualization_template
|
||||
<where>
|
||||
<if test="nodeType != null">
|
||||
and visualization_template.node_type = #{nodeType}
|
||||
</if>
|
||||
</where>
|
||||
order by visualization_template.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="findTemplateList" resultMap="BaseResultMapDTO">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
|
||||
Reference in New Issue
Block a user