水木接口修改

This commit is contained in:
even 2025-07-07 09:37:24 +08:00
parent 4e5676ce4e
commit 92fa95b91f
3 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,6 @@
package cd.casic.ci.process.engine.constant; package cd.casic.ci.process.engine.constant;
public class ShuiMuConstant { public class ShuiMuConstant {
public static final String SHUI_MU_PROJECT_ID_KEY="projectId"; public static final String SHUI_MU_PROJECT_ID_KEY="id";
public static final String SHUI_MU_FUZZ_MINUTES = "fuzzMinutes"; public static final String SHUI_MU_FUZZ_MINUTES = "fuzzMinutes";
} }

View File

@ -34,10 +34,15 @@ public class ShuiMuWorker extends BaseWorker {
ShuiMuProjectResourceResp projectResource = shuiMuService.getProjectResource(projectId); ShuiMuProjectResourceResp projectResource = shuiMuService.getProjectResource(projectId);
append(context,"当前执行情况:"); append(context,"当前执行情况:");
append(context, JSON.toJSONString(projectResource)); append(context, JSON.toJSONString(projectResource));
if (projectResource.getTestResource()==0) { if (projectResource.getTestResource()+projectResource.getQueueResource()==0) {
append(context,"水木模糊测试执行完毕"); append(context,"水木模糊测试执行完毕");
break; break;
} }
try {
Thread.sleep(1000L);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
} }
} }
} }

View File

@ -207,11 +207,11 @@ public class ShuiMuServiceImpl implements ShuiMuService {
public void uploadWfuzzJson(ShuiMuUpdateWFuzzJsonReq req) { public void uploadWfuzzJson(ShuiMuUpdateWFuzzJsonReq req) {
ShuiMuProjectInfoResp projectInfo = getProjectInfo(req.getProjectId()); ShuiMuProjectInfoResp projectInfo = getProjectInfo(req.getProjectId());
String projectName = projectInfo.getName(); String projectName = projectInfo.getName();
Map<String,String> restReq = new HashMap<>(); Map<String,Object> restReq = new HashMap<>();
restReq.put("project",projectName); restReq.put("project",projectName);
restReq.put("product",projectInfo.getProduct()); restReq.put("product",projectInfo.getProduct());
restReq.put("language",projectInfo.getLanguage()); restReq.put("language",projectInfo.getLanguage());
restReq.put("build",req.getBuild()); restReq.put("build",JSON.parseObject(req.getBuild()));
String tempDir = System.getProperty("java.io.tmpdir"); String tempDir = System.getProperty("java.io.tmpdir");
File tempFile = new File(tempDir,"wfuzz.json"); File tempFile = new File(tempDir,"wfuzz.json");