From 80b9a3f4f7af8d5cc6bc07cd888f62e0c30a2dd0 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 28 Aug 2024 11:16:40 +0800 Subject: [PATCH] =?UTF-8?q?perf(X-Pack):=20=E4=BC=81=E4=B8=9A=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- de-xpack | 2 +- .../java/io/dataease/api/communicate/api/CommunicateApi.java | 4 ++++ .../src/main/java/io/dataease/utils/WhitelistUtils.java | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/de-xpack b/de-xpack index 3609b67779..114cb68167 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 3609b67779d4f92da4e1e037e2d3e98defeefe40 +Subproject commit 114cb68167079cb84eeaff060db9dd971166738f diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/communicate/api/CommunicateApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/communicate/api/CommunicateApi.java index a5036fe717..fb180b4926 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/communicate/api/CommunicateApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/communicate/api/CommunicateApi.java @@ -3,6 +3,7 @@ package io.dataease.api.communicate.api; import io.dataease.api.communicate.dto.MessageDTO; import io.swagger.v3.oas.annotations.Hidden; import org.springframework.core.io.ByteArrayResource; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -17,4 +18,7 @@ public interface CommunicateApi { @GetMapping("/down/{fileId}/{fileName}/{suffix}") ResponseEntity down(@PathVariable("fileId") String fileId, @PathVariable("fileName") String fileName, @PathVariable("suffix") String suffix) throws Exception; + + @GetMapping(value = "/image/{imageId}", produces = {MediaType.IMAGE_JPEG_VALUE, MediaType.IMAGE_PNG_VALUE}) + ResponseEntity image(@PathVariable("imageId") String imageId); } diff --git a/sdk/common/src/main/java/io/dataease/utils/WhitelistUtils.java b/sdk/common/src/main/java/io/dataease/utils/WhitelistUtils.java index 63b98c8b13..d365c9e0fa 100644 --- a/sdk/common/src/main/java/io/dataease/utils/WhitelistUtils.java +++ b/sdk/common/src/main/java/io/dataease/utils/WhitelistUtils.java @@ -70,6 +70,7 @@ public class WhitelistUtils { || StringUtils.startsWithAny(requestURI, "/map/") || StringUtils.startsWithAny(requestURI, "/typeface/download") || StringUtils.startsWithAny(requestURI, "/typeface/defaultFont") + || StringUtils.startsWithAny(requestURI, "/communicate/image/") || StringUtils.startsWithAny(requestURI, "/communicate/down/"); } }