From 4282678803ea6c35979501a7defa9c3ae0691361 Mon Sep 17 00:00:00 2001 From: zhouyl <583641232@qq.com> Date: Mon, 9 Sep 2024 10:50:31 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E6=B5=8B=E8=AF=95=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/system/ToolManageController.java | 6 ++++-- .../inscloudtech/system/domain/vo/DownloadToolRequest.java | 2 +- .../system/service/impl/ToolManageServiceImpl.java | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tp-admin/src/main/java/com/inscloudtech/web/controller/system/ToolManageController.java b/tp-admin/src/main/java/com/inscloudtech/web/controller/system/ToolManageController.java index ff40b8d..9da5299 100644 --- a/tp-admin/src/main/java/com/inscloudtech/web/controller/system/ToolManageController.java +++ b/tp-admin/src/main/java/com/inscloudtech/web/controller/system/ToolManageController.java @@ -10,6 +10,7 @@ import com.inscloudtech.common.core.domain.PageQuery; import com.inscloudtech.common.core.domain.R; import com.inscloudtech.common.core.page.TableDataInfo; import com.inscloudtech.common.core.validate.AddGroup; +import com.inscloudtech.common.encrypt.annotation.ApiEncrypt; import com.inscloudtech.common.enums.BusinessType; import com.inscloudtech.common.utils.poi.ExcelUtil; import com.inscloudtech.system.domain.ToolManage; @@ -110,8 +111,9 @@ public class ToolManageController extends BaseController { /** * 根据测试模块名称-工具名称下载测试工具/工具操作手册 */ - @GetMapping("/downloadTool") - public void downloadTool(DownloadToolRequest downloadToolRequest , HttpServletResponse response) throws IOException { + @ApiEncrypt + @PostMapping("/downloadTool") + public void downloadTool(@RequestBody DownloadToolRequest downloadToolRequest , HttpServletResponse response) throws IOException { iToolManageService.downloadByToolName(downloadToolRequest,response); } diff --git a/tp-system/src/main/java/com/inscloudtech/system/domain/vo/DownloadToolRequest.java b/tp-system/src/main/java/com/inscloudtech/system/domain/vo/DownloadToolRequest.java index e067904..5dd1dd7 100644 --- a/tp-system/src/main/java/com/inscloudtech/system/domain/vo/DownloadToolRequest.java +++ b/tp-system/src/main/java/com/inscloudtech/system/domain/vo/DownloadToolRequest.java @@ -22,5 +22,5 @@ public class DownloadToolRequest { * 下载类型-0工具/1操作手册 */ @NotNull(message = "下载类型不能为空") - private String type; + private Integer type; } diff --git a/tp-system/src/main/java/com/inscloudtech/system/service/impl/ToolManageServiceImpl.java b/tp-system/src/main/java/com/inscloudtech/system/service/impl/ToolManageServiceImpl.java index 810009f..e52e0ec 100644 --- a/tp-system/src/main/java/com/inscloudtech/system/service/impl/ToolManageServiceImpl.java +++ b/tp-system/src/main/java/com/inscloudtech/system/service/impl/ToolManageServiceImpl.java @@ -195,10 +195,10 @@ public class ToolManageServiceImpl implements IToolManageService { throw new ServiceException("文件数据不存在!"); } - if(request.getType().equals("0")){ - iSysOssService.download(dbObj.getToolOssId(),response); - }else if(request.getType().equals("1")){ + if(request.getType() == 0){ iSysOssService.download(dbObj.getToolOssId(),response); + }else if(request.getType() == 1){ + iSysOssService.download(dbObj.getTipsOssId(),response); }else { throw new ServiceException("非法下载类型!"); }