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,
@RequestPart("moduleName") String moduleName,
@RequestPart("toolName") String toolName,
@RequestPart("toolManageId") Long toolManageId) {
@RequestPart("toolManageId") Long toolManageId, String toolPath, String tipsPath) {
if (StrUtil.isEmpty(moduleName)) {
return R.fail("模块名不能为空!");
@ -104,7 +104,7 @@ public class ToolManageController extends BaseController {
if (StrUtil.isEmpty(toolName)) {
return R.fail("文件名不能为空!");
}
iToolManageService.uploadToolAndTips(file,tipsFile,toolName,moduleName, toolManageId);
iToolManageService.uploadToolAndTips(file,tipsFile,toolName,moduleName, toolManageId,toolPath,tipsPath);
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 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);
}

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

@ -128,7 +128,7 @@ public class ToolManageServiceImpl implements IToolManageService {
}
@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;
if(null != toolManageId && toolManageId != 0L){
toolManage = baseMapper.selectById(toolManageId);
@ -144,20 +144,20 @@ public class ToolManageServiceImpl implements IToolManageService {
}
try {
if(FileUploadUtils.checkFileValid(file)){
if(file != null && FileUploadUtils.checkFileValid(file)){
SysOssVo toolVo = iSysOssService.upload(file);
toolManage.setToolOssId(toolVo.getOssId());
toolManage.setToolPath(toolVo.getOriginalName());
}else if(null != toolManageId && toolManageId != 0L){
}else if(null != toolManageId && toolManageId != 0L && StrUtil.isEmpty(toolPath)){
toolManage.setToolOssId(0L);
toolManage.setToolPath("");
}
if(FileUploadUtils.checkFileValid(tipsFile)){
if(tipsFile != null && FileUploadUtils.checkFileValid(tipsFile)){
SysOssVo tipsVo = iSysOssService.upload(tipsFile);
toolManage.setTipsOssId(tipsVo.getOssId());
toolManage.setTipsPath(tipsVo.getOriginalName());
}else if(null != toolManageId && toolManageId != 0L){
}else if(null != toolManageId && toolManageId != 0L && StrUtil.isEmpty(tipsPath) ){
toolManage.setTipsOssId(0L);
toolManage.setTipsPath("");
}

Loading…
Cancel
Save