Browse Source

测试工具下载

master
zhouyl 1 year ago
parent
commit
4282678803
  1. 6
      tp-admin/src/main/java/com/inscloudtech/web/controller/system/ToolManageController.java
  2. 2
      tp-system/src/main/java/com/inscloudtech/system/domain/vo/DownloadToolRequest.java
  3. 6
      tp-system/src/main/java/com/inscloudtech/system/service/impl/ToolManageServiceImpl.java

6
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);
}

2
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;
}

6
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("非法下载类型!");
}

Loading…
Cancel
Save