refactor: 模板管理模板市场合并为模板中心

This commit is contained in:
wangjiahao
2023-11-29 13:11:50 +08:00
parent dd51482a48
commit 6dc0ea250b
33 changed files with 324 additions and 128 deletions

View File

@@ -14,6 +14,10 @@ public class TemplateManageDTO extends VisualizationTemplateVO {
private Integer childrenCount;
private String categoryName;
private Long recentUseTime;
private List<TemplateManageDTO> children;

View File

@@ -4,9 +4,6 @@ import io.dataease.api.template.vo.MarketCategoryVO;
import io.dataease.api.template.vo.MarketMetasVO;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.ArrayUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -28,11 +25,30 @@ public class TemplateMarketDTO implements Comparable<TemplateMarketDTO> {
private Long recentUseTime = 0L;
private String templateType;
// 模板来源 market = 模板市场manage=模板管理
private String source = "market";
private List<MarketCategoryVO> categories;
private String mainCategory;
private MarketMetasVO metas;
public TemplateMarketDTO(String id, String title, String themeRepo, String templateUrl, String categoryName, String templateType, Long recentUseTime,String suggest) {
public TemplateMarketDTO(TemplateManageDTO manageDTO) {
this.id = manageDTO.getId();
this.title = manageDTO.getName();
this.mainCategory = manageDTO.getCategoryName();
this.categories = Arrays.asList(new MarketCategoryVO(manageDTO.getCategoryName()), new MarketCategoryVO("全部"));
this.metas = new MarketMetasVO(manageDTO.getSnapshot());
this.templateType = "dataV".equalsIgnoreCase("manageDTO.getTemplateType()") ? "SCREEN" : "PANEL";
this.thumbnail = manageDTO.getSnapshot();
this.source = "manage";
if (manageDTO.getRecentUseTime() != null) {
this.recentUseTime = manageDTO.getRecentUseTime();
}
}
public TemplateMarketDTO(String id, String title, String themeRepo, String templateUrl, String categoryName, String templateType, Long recentUseTime, String suggest) {
this.id = id;
this.title = title;
this.categories = Arrays.asList(new MarketCategoryVO(categoryName), new MarketCategoryVO("全部"));
@@ -42,8 +58,8 @@ public class TemplateMarketDTO implements Comparable<TemplateMarketDTO> {
if (recentUseTime != null) {
this.recentUseTime = recentUseTime;
}
if("Y".equalsIgnoreCase(suggest)){
this.suggest="Y";
if ("Y".equalsIgnoreCase(suggest)) {
this.suggest = "Y";
}
}

View File

@@ -17,5 +17,7 @@ public class MarketMetaDataVO {
public MarketMetaDataVO(String value, String label) {
this.label = label;
this.value = value;
this.slug = value;
}
}

View File

@@ -30,7 +30,7 @@ public class VisualizationTemplateVO {
private Integer level;
/**
* 模种类 dataV or dashboard 目录或者文件夹
* 模种类 dataV or dashboard 目录或者文件夹
*/
private String dvType;
@@ -55,7 +55,7 @@ public class VisualizationTemplateVO {
private String snapshot;
/**
* 模类型 system 系统内置 self 用户自建
* 模类型 system 系统内置 self 用户自建
*/
private String templateType;

View File

@@ -66,7 +66,7 @@ public interface DataVisualizationApi {
String findDvType(@PathVariable("dvId")Long dvId);
/**
* 从模解压可视化资源 模来源包括 模市场、内部模管理
* 从模解压可视化资源 模来源包括 模市场、内部模管理
*
* @return
*/
@@ -74,7 +74,7 @@ public interface DataVisualizationApi {
DataVisualizationVO decompression(@RequestBody DataVisualizationBaseRequest request) throws Exception;
/**
* 从模解压可视化资源 模来源包括本地上传
* 从模解压可视化资源 模来源包括本地上传
*
* @return
*/

View File

@@ -125,7 +125,7 @@ public class DataVisualizationVO implements Serializable {
private Map<Long, ChartViewDTO> canvasViewInfo = new HashMap<>();
/**
* 视图模数据
* 视图模数据
*/
private Map<Long, VisualizationTemplateExtendDataDTO> extendDataInfo = new HashMap<>();