diff --git a/de-xpack b/de-xpack index 0bfb0e20ea..c5a84a840c 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 0bfb0e20ead5a4711cb54957003b63388067eb8b +Subproject commit c5a84a840c83af6083d4e846d9e160b45d6df8b2 diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/xpack/plugin/PluginApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/xpack/plugin/PluginApi.java index a38b10a368..496316a1f1 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/xpack/plugin/PluginApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/xpack/plugin/PluginApi.java @@ -19,12 +19,13 @@ public interface PluginApi { @GetMapping("/query") List query(); - @PostMapping("/install") + @PostMapping(value = "/install", consumes = {"multipart/form-data"}) void install(@RequestPart(value = "file") MultipartFile file); @PostMapping("/uninstall/{id}") void uninstall(@PathVariable("id") String id); + @PostMapping(value = "/update", consumes = {"multipart/form-data"}) void update(@RequestPart("request") PluginEditor request, @RequestPart(value = "file") MultipartFile file); } diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/xpack/plugin/vo/PluginVO.java b/sdk/api/api-base/src/main/java/io/dataease/api/xpack/plugin/vo/PluginVO.java index 2447fe2ce6..60f6f3940d 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/xpack/plugin/vo/PluginVO.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/xpack/plugin/vo/PluginVO.java @@ -1,5 +1,7 @@ package io.dataease.api.xpack.plugin.vo; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -14,6 +16,7 @@ public class PluginVO implements Serializable { @Serial private static final long serialVersionUID = -3889122930435272191L; + @JsonSerialize(using= ToStringSerializer.class) private Long id; private String name; diff --git a/sdk/extensions/extensions-view/src/main/java/io/dataease/extensions/view/template/PluginsChartTemplate.java b/sdk/extensions/extensions-view/src/main/java/io/dataease/extensions/view/template/PluginsChartTemplate.java index 448ed34496..9adc90105f 100644 --- a/sdk/extensions/extensions-view/src/main/java/io/dataease/extensions/view/template/PluginsChartTemplate.java +++ b/sdk/extensions/extensions-view/src/main/java/io/dataease/extensions/view/template/PluginsChartTemplate.java @@ -1,5 +1,6 @@ package io.dataease.extensions.view.template; +import io.dataease.exception.DEException; import io.dataease.extensions.view.dto.ChartViewDTO; import io.dataease.extensions.view.dto.ChartViewFieldDTO; import io.dataease.extensions.view.dto.DatasetTableFieldDTO; @@ -23,9 +24,16 @@ public abstract class PluginsChartTemplate implements DataEasePlugin { public XpackPluginsViewVO getConfig() { - DataEasePluginVO pluginInfo = getPluginInfo(); + DataEasePluginVO pluginInfo = null; + try { + pluginInfo = getPluginInfo(); + } catch (Exception e) { + DEException.throwException(e); + } String config = pluginInfo.getConfig(); - return JsonUtil.parseObject(config, XpackPluginsViewVO.class); + XpackPluginsViewVO vo = JsonUtil.parseObject(config, XpackPluginsViewVO.class); + vo.setIcon(pluginInfo.getIcon()); + return vo; }