Browse Source

测试包管理

master
zhouyl 1 year ago
parent
commit
399d068c1d
  1. 4
      tp-admin/src/main/java/com/inscloudtech/web/controller/system/ToolManageController.java
  2. 2
      tp-system/src/main/java/com/inscloudtech/system/service/IToolManageService.java
  3. 10
      tp-system/src/main/java/com/inscloudtech/system/service/impl/ToolManageServiceImpl.java

4
tp-admin/src/main/java/com/inscloudtech/web/controller/system/ToolManageController.java

@ -96,7 +96,7 @@ public class ToolManageController extends BaseController {
MultipartFile tipsFile, MultipartFile tipsFile,
@RequestPart("moduleName") String moduleName, @RequestPart("moduleName") String moduleName,
@RequestPart("toolName") String toolName, @RequestPart("toolName") String toolName,
@RequestPart("toolManageId") Long toolManageId) {
@RequestPart("toolManageId") Long toolManageId, String toolPath, String tipsPath) {
if (StrUtil.isEmpty(moduleName)) { if (StrUtil.isEmpty(moduleName)) {
return R.fail("模块名不能为空!"); return R.fail("模块名不能为空!");
@ -104,7 +104,7 @@ public class ToolManageController extends BaseController {
if (StrUtil.isEmpty(toolName)) { if (StrUtil.isEmpty(toolName)) {
return R.fail("文件名不能为空!"); return R.fail("文件名不能为空!");
} }
iToolManageService.uploadToolAndTips(file,tipsFile,toolName,moduleName, toolManageId);
iToolManageService.uploadToolAndTips(file,tipsFile,toolName,moduleName, toolManageId,toolPath,tipsPath);
return R.ok("操作成功!"); return R.ok("操作成功!");
} }

2
tp-system/src/main/java/com/inscloudtech/system/service/IToolManageService.java

@ -52,7 +52,7 @@ public interface IToolManageService {
*/ */
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
Boolean uploadToolAndTips(MultipartFile file, MultipartFile tipsFile, String toolName,String moduleName,Long toolManageId);
Boolean uploadToolAndTips(MultipartFile file, MultipartFile tipsFile, String toolName,String moduleName,Long toolManageId,String toolPath,String tipsPath);
void downloadByToolName(DownloadToolRequest downloadToolRequest,HttpServletResponse response); void downloadByToolName(DownloadToolRequest downloadToolRequest,HttpServletResponse response);
} }

10
tp-system/src/main/java/com/inscloudtech/system/service/impl/ToolManageServiceImpl.java

@ -128,7 +128,7 @@ public class ToolManageServiceImpl implements IToolManageService {
} }
@Override @Override
public Boolean uploadToolAndTips(MultipartFile file, MultipartFile tipsFile, String toolName,String moduleName,Long toolManageId) {
public Boolean uploadToolAndTips(MultipartFile file, MultipartFile tipsFile, String toolName,String moduleName,Long toolManageId,String toolPath,String tipsPath) {
ToolManage toolManage; ToolManage toolManage;
if(null != toolManageId && toolManageId != 0L){ if(null != toolManageId && toolManageId != 0L){
toolManage = baseMapper.selectById(toolManageId); toolManage = baseMapper.selectById(toolManageId);
@ -144,20 +144,20 @@ public class ToolManageServiceImpl implements IToolManageService {
} }
try { try {
if(FileUploadUtils.checkFileValid(file)){
if(file != null && FileUploadUtils.checkFileValid(file)){
SysOssVo toolVo = iSysOssService.upload(file); SysOssVo toolVo = iSysOssService.upload(file);
toolManage.setToolOssId(toolVo.getOssId()); toolManage.setToolOssId(toolVo.getOssId());
toolManage.setToolPath(toolVo.getOriginalName()); toolManage.setToolPath(toolVo.getOriginalName());
}else if(null != toolManageId && toolManageId != 0L){
}else if(null != toolManageId && toolManageId != 0L && StrUtil.isEmpty(toolPath)){
toolManage.setToolOssId(0L); toolManage.setToolOssId(0L);
toolManage.setToolPath(""); toolManage.setToolPath("");
} }
if(FileUploadUtils.checkFileValid(tipsFile)){
if(tipsFile != null && FileUploadUtils.checkFileValid(tipsFile)){
SysOssVo tipsVo = iSysOssService.upload(tipsFile); SysOssVo tipsVo = iSysOssService.upload(tipsFile);
toolManage.setTipsOssId(tipsVo.getOssId()); toolManage.setTipsOssId(tipsVo.getOssId());
toolManage.setTipsPath(tipsVo.getOriginalName()); toolManage.setTipsPath(tipsVo.getOriginalName());
}else if(null != toolManageId && toolManageId != 0L){
}else if(null != toolManageId && toolManageId != 0L && StrUtil.isEmpty(tipsPath) ){
toolManage.setTipsOssId(0L); toolManage.setTipsOssId(0L);
toolManage.setTipsPath(""); toolManage.setTipsPath("");
} }

Loading…
Cancel
Save