diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java index bdc2562abc..7c00ff765c 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java @@ -41,13 +41,13 @@ public class ApiDefinitionExecResultService { saveResult.setStartTime(item.getStartTime()); saveResult.setType(type); saveResult.setEndTime(item.getResponseResult().getResponseTime()); - saveResult.setStatus(item.getResponseResult().getResponseCode().equals("200") ? "success" : "error"); + saveResult.setStatus(item.isSuccess() ? "success" : "error"); apiDefinitionExecResultMapper.insert(saveResult); }); } public void deleteByResourceId(String resourceId) { - ApiDefinitionExecResultExample example = new ApiDefinitionExecResultExample(); + ApiDefinitionExecResultExample example = new ApiDefinitionExecResultExample(); example.createCriteria().andResourceIdEqualTo(resourceId); apiDefinitionExecResultMapper.deleteByExample(example); } @@ -64,10 +64,10 @@ public class ApiDefinitionExecResultService { Date firstTime = startAndEndDateInWeek.get("firstTime"); Date lastTime = startAndEndDateInWeek.get("lastTime"); - if(firstTime==null || lastTime == null){ - return 0; - }else { - return extApiDefinitionExecResultMapper.countByProjectIDAndCreateInThisWeek(projectId,firstTime.getTime(),lastTime.getTime()); + if (firstTime == null || lastTime == null) { + return 0; + } else { + return extApiDefinitionExecResultMapper.countByProjectIDAndCreateInThisWeek(projectId, firstTime.getTime(), lastTime.getTime()); } } @@ -79,18 +79,18 @@ public class ApiDefinitionExecResultService { public List findFaliureCaseInfoByProjectIDAndLimitNumberInSevenDays(String projectId, int limitNumber) { //获取7天之前的日期 - Date startDay = DateUtils.dateSum(new Date(),-6); + Date startDay = DateUtils.dateSum(new Date(), -6); //将日期转化为 00:00:00 的时间戳 Date startTime = null; - try{ + try { startTime = DateUtils.getDayStartTime(startDay); - }catch (Exception e){ + } catch (Exception e) { } - if(startTime==null){ - return new ArrayList<>(0); - }else { - return extApiDefinitionExecResultMapper.findFaliureCaseInfoByProjectIDAndExecuteTimeAndLimitNumber(projectId,startTime.getTime(),limitNumber); + if (startTime == null) { + return new ArrayList<>(0); + } else { + return extApiDefinitionExecResultMapper.findFaliureCaseInfoByProjectIDAndExecuteTimeAndLimitNumber(projectId, startTime.getTime(), limitNumber); } } } diff --git a/frontend/src/business/components/api/automation/scenario/ApiComponent.vue b/frontend/src/business/components/api/automation/scenario/ApiComponent.vue index 3e1dd54499..f982f29274 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiComponent.vue @@ -129,9 +129,13 @@ if (response.data) { Object.assign(this.request, JSON.parse(response.data.request)); this.request.name = response.data.name; - this.request.path = response.data.path; - this.request.method = response.data.method; - this.request.url = response.data.path; + if (response.data.path && response.data.path != null) { + this.request.path = response.data.path; + this.request.url = response.data.path; + } + if (response.data.method && response.data.method != null) { + this.request.method = response.data.method; + } this.request.requestResult = requestResult; this.request.id = response.data.id; this.reload(); diff --git a/frontend/src/business/components/api/automation/scenario/Jsr233Processor.vue b/frontend/src/business/components/api/automation/scenario/Jsr233Processor.vue index d0a346b054..2bd2ca58a6 100644 --- a/frontend/src/business/components/api/automation/scenario/Jsr233Processor.vue +++ b/frontend/src/business/components/api/automation/scenario/Jsr233Processor.vue @@ -31,7 +31,7 @@ @@ -94,10 +94,10 @@ ], isCodeEditAlive: true, languages: [ - 'java', "python" + 'beanshell', "python" ], codeEditModeMap: { - beanshell: 'java', + beanshell: 'beanshell', python: 'python' } } diff --git a/frontend/src/business/components/api/automation/scenario/MsInputTag.vue b/frontend/src/business/components/api/automation/scenario/MsInputTag.vue index f9f5c26ff6..bee4e07e71 100644 --- a/frontend/src/business/components/api/automation/scenario/MsInputTag.vue +++ b/frontend/src/business/components/api/automation/scenario/MsInputTag.vue @@ -1,5 +1,5 @@