mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 20:19:16 +08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
128f98849c
@ -41,13 +41,13 @@ public class ApiDefinitionExecResultService {
|
|||||||
saveResult.setStartTime(item.getStartTime());
|
saveResult.setStartTime(item.getStartTime());
|
||||||
saveResult.setType(type);
|
saveResult.setType(type);
|
||||||
saveResult.setEndTime(item.getResponseResult().getResponseTime());
|
saveResult.setEndTime(item.getResponseResult().getResponseTime());
|
||||||
saveResult.setStatus(item.getResponseResult().getResponseCode().equals("200") ? "success" : "error");
|
saveResult.setStatus(item.isSuccess() ? "success" : "error");
|
||||||
apiDefinitionExecResultMapper.insert(saveResult);
|
apiDefinitionExecResultMapper.insert(saveResult);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteByResourceId(String resourceId) {
|
public void deleteByResourceId(String resourceId) {
|
||||||
ApiDefinitionExecResultExample example = new ApiDefinitionExecResultExample();
|
ApiDefinitionExecResultExample example = new ApiDefinitionExecResultExample();
|
||||||
example.createCriteria().andResourceIdEqualTo(resourceId);
|
example.createCriteria().andResourceIdEqualTo(resourceId);
|
||||||
apiDefinitionExecResultMapper.deleteByExample(example);
|
apiDefinitionExecResultMapper.deleteByExample(example);
|
||||||
}
|
}
|
||||||
@ -64,10 +64,10 @@ public class ApiDefinitionExecResultService {
|
|||||||
Date firstTime = startAndEndDateInWeek.get("firstTime");
|
Date firstTime = startAndEndDateInWeek.get("firstTime");
|
||||||
Date lastTime = startAndEndDateInWeek.get("lastTime");
|
Date lastTime = startAndEndDateInWeek.get("lastTime");
|
||||||
|
|
||||||
if(firstTime==null || lastTime == null){
|
if (firstTime == null || lastTime == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}else {
|
} else {
|
||||||
return extApiDefinitionExecResultMapper.countByProjectIDAndCreateInThisWeek(projectId,firstTime.getTime(),lastTime.getTime());
|
return extApiDefinitionExecResultMapper.countByProjectIDAndCreateInThisWeek(projectId, firstTime.getTime(), lastTime.getTime());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,18 +79,18 @@ public class ApiDefinitionExecResultService {
|
|||||||
public List<ExecutedCaseInfoResult> findFaliureCaseInfoByProjectIDAndLimitNumberInSevenDays(String projectId, int limitNumber) {
|
public List<ExecutedCaseInfoResult> findFaliureCaseInfoByProjectIDAndLimitNumberInSevenDays(String projectId, int limitNumber) {
|
||||||
|
|
||||||
//获取7天之前的日期
|
//获取7天之前的日期
|
||||||
Date startDay = DateUtils.dateSum(new Date(),-6);
|
Date startDay = DateUtils.dateSum(new Date(), -6);
|
||||||
//将日期转化为 00:00:00 的时间戳
|
//将日期转化为 00:00:00 的时间戳
|
||||||
Date startTime = null;
|
Date startTime = null;
|
||||||
try{
|
try {
|
||||||
startTime = DateUtils.getDayStartTime(startDay);
|
startTime = DateUtils.getDayStartTime(startDay);
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(startTime==null){
|
if (startTime == null) {
|
||||||
return new ArrayList<>(0);
|
return new ArrayList<>(0);
|
||||||
}else {
|
} else {
|
||||||
return extApiDefinitionExecResultMapper.findFaliureCaseInfoByProjectIDAndExecuteTimeAndLimitNumber(projectId,startTime.getTime(),limitNumber);
|
return extApiDefinitionExecResultMapper.findFaliureCaseInfoByProjectIDAndExecuteTimeAndLimitNumber(projectId, startTime.getTime(), limitNumber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,9 +129,13 @@
|
|||||||
if (response.data) {
|
if (response.data) {
|
||||||
Object.assign(this.request, JSON.parse(response.data.request));
|
Object.assign(this.request, JSON.parse(response.data.request));
|
||||||
this.request.name = response.data.name;
|
this.request.name = response.data.name;
|
||||||
this.request.path = response.data.path;
|
if (response.data.path && response.data.path != null) {
|
||||||
this.request.method = response.data.method;
|
this.request.path = response.data.path;
|
||||||
this.request.url = 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.requestResult = requestResult;
|
||||||
this.request.id = response.data.id;
|
this.request.id = response.data.id;
|
||||||
this.reload();
|
this.reload();
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
<el-col :span="20" class="script-content">
|
<el-col :span="20" class="script-content">
|
||||||
<ms-code-edit v-if="isCodeEditAlive" :mode="jsr223ProcessorData.scriptLanguage"
|
<ms-code-edit v-if="isCodeEditAlive" :mode="jsr223ProcessorData.scriptLanguage"
|
||||||
:read-only="isReadOnly"
|
:read-only="isReadOnly"
|
||||||
:data.sync="jsr223ProcessorData.script" theme="eclipse" :modes="['java','python']"
|
:data.sync="jsr223ProcessorData.script" theme="eclipse" :modes="[]"
|
||||||
ref="codeEdit"/>
|
ref="codeEdit"/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4" class="script-index">
|
<el-col :span="4" class="script-index">
|
||||||
@ -94,10 +94,10 @@
|
|||||||
],
|
],
|
||||||
isCodeEditAlive: true,
|
isCodeEditAlive: true,
|
||||||
languages: [
|
languages: [
|
||||||
'java', "python"
|
'beanshell', "python"
|
||||||
],
|
],
|
||||||
codeEditModeMap: {
|
codeEditModeMap: {
|
||||||
beanshell: 'java',
|
beanshell: 'beanshell',
|
||||||
python: 'python'
|
python: 'python'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<input-tag v-model="data"></input-tag>
|
<input-tag v-model="data" placeholder="输入回车添加"></input-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -13,7 +13,6 @@
|
|||||||
if (!this.currentScenario.tags) {
|
if (!this.currentScenario.tags) {
|
||||||
this.currentScenario.tags = [];
|
this.currentScenario.tags = [];
|
||||||
}
|
}
|
||||||
console.log(this.currentScenario.tags)
|
|
||||||
this.data = this.currentScenario.tags;
|
this.data = this.currentScenario.tags;
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
@ -183,6 +183,8 @@
|
|||||||
let bodyFiles = this.getBodyUploadFiles(row);
|
let bodyFiles = this.getBodyUploadFiles(row);
|
||||||
row.projectId = getCurrentProjectID();
|
row.projectId = getCurrentProjectID();
|
||||||
row.active = true;
|
row.active = true;
|
||||||
|
row.request.path = this.api.path;
|
||||||
|
row.request.method = this.api.method;
|
||||||
row.apiDefinitionId = row.apiDefinitionId || this.api.id;
|
row.apiDefinitionId = row.apiDefinitionId || this.api.id;
|
||||||
let url = "/api/testcase/create";
|
let url = "/api/testcase/create";
|
||||||
if (row.id) {
|
if (row.id) {
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<ms-environment-select v-if="isRelevanceModel" :project-id="relevanceProjectId" :is-read-only="isReadOnly" @setEnvironment="setEnvironment"/>
|
<ms-environment-select v-if="isRelevanceModel" :project-id="relevanceProjectId" :is-read-only="isReadOnly" @setEnvironment="setEnvironment"/>
|
||||||
|
|
||||||
<el-input v-if="!isPlanModel" placeholder="搜索" @blur="search" class="search-input" size="small" v-model="condition.name"/>
|
<el-input v-if="!isPlanModel" placeholder="搜索" @blur="search" @keyup.enter.native="search" class="search-input" size="small" v-model="condition.name"/>
|
||||||
|
|
||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
<test-plan-case-list-header
|
<test-plan-case-list-header
|
||||||
|
@ -318,6 +318,7 @@
|
|||||||
this.selectRows.clear();
|
this.selectRows.clear();
|
||||||
this.initTable();
|
this.initTable();
|
||||||
this.$success(this.$t('commons.delete_success'));
|
this.$success(this.$t('commons.delete_success'));
|
||||||
|
this.$refs.caseList.apiCaseClose();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -368,6 +369,7 @@
|
|||||||
this.$post('/api/definition/removeToGc/', ids, () => {
|
this.$post('/api/definition/removeToGc/', ids, () => {
|
||||||
this.$success(this.$t('commons.delete_success'));
|
this.$success(this.$t('commons.delete_success'));
|
||||||
this.initTable();
|
this.initTable();
|
||||||
|
this.$refs.caseList.apiCaseClose();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<el-col :span="20" class="script-content">
|
<el-col :span="20" class="script-content">
|
||||||
<ms-code-edit v-if="isCodeEditAlive" :mode="jsr223ProcessorData.scriptLanguage"
|
<ms-code-edit v-if="isCodeEditAlive" :mode="jsr223ProcessorData.scriptLanguage"
|
||||||
:read-only="isReadOnly"
|
:read-only="isReadOnly"
|
||||||
:data.sync="jsr223ProcessorData.script" theme="eclipse" :modes="['java','python']"
|
:data.sync="jsr223ProcessorData.script" theme="eclipse" :modes="[]"
|
||||||
ref="codeEdit"/>
|
ref="codeEdit"/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4" class="script-index">
|
<el-col :span="4" class="script-index">
|
||||||
@ -95,10 +95,10 @@
|
|||||||
],
|
],
|
||||||
isCodeEditAlive: true,
|
isCodeEditAlive: true,
|
||||||
languages: [
|
languages: [
|
||||||
'java', "python"
|
'beanshell', "python"
|
||||||
],
|
],
|
||||||
codeEditModeMap: {
|
codeEditModeMap: {
|
||||||
beanshell: 'java',
|
beanshell: 'beanshell',
|
||||||
python: 'python'
|
python: 'python'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user