mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-05 05:29:29 +08:00
refactor(工作台): 接口同步功能更新
--user=郭雨琦
This commit is contained in:
parent
1f6b1c159b
commit
8bd02d9422
@ -273,9 +273,12 @@ public class ApiDefinitionExecResultService {
|
||||
// 更新用例最后执行结果
|
||||
caseWithBLOBs.setLastResultId(reportId);
|
||||
caseWithBLOBs.setStatus(status);
|
||||
if (status.equals("success")) {
|
||||
if (status.equals(APITestStatus.Success.name())) {
|
||||
caseWithBLOBs.setToBeUpdated(false);
|
||||
}
|
||||
if (status.equals(APITestStatus.Error.name())) {
|
||||
caseWithBLOBs.setToBeUpdated(true);
|
||||
}
|
||||
caseWithBLOBs.setUpdateTime(System.currentTimeMillis());
|
||||
apiTestCaseMapper.updateByPrimaryKey(caseWithBLOBs);
|
||||
|
||||
|
@ -1013,25 +1013,7 @@ public class ApiDefinitionService {
|
||||
}
|
||||
|
||||
if (apiDefinition.getToBeUpdated() != null) {
|
||||
ApiSyncCaseRequest apiSyncCaseRequest = new ApiSyncCaseRequest();
|
||||
ApiDefinitionSyncService apiDefinitionSyncService = CommonBeanFactory.getBean(ApiDefinitionSyncService.class);
|
||||
if (apiDefinitionSyncService != null) {
|
||||
apiSyncCaseRequest = apiDefinitionSyncService.getApiSyncCaseRequest(apiDefinition.getProjectId());
|
||||
}
|
||||
if (apiSyncCaseRequest.getUnRun() != null && apiSyncCaseRequest.getUnRun() && apiTestCaseWithBLOBs.getStatus() != null && !apiTestCaseWithBLOBs.getStatus().equalsIgnoreCase("Trash")
|
||||
&& !apiTestCaseWithBLOBs.getStatus().equalsIgnoreCase("success") && !apiTestCaseWithBLOBs.getStatus().equalsIgnoreCase("error")
|
||||
&& !apiTestCaseWithBLOBs.getStatus().equalsIgnoreCase("Running") && !apiTestCaseWithBLOBs.getStatus().equalsIgnoreCase("errorReportResult")
|
||||
&& !apiTestCaseWithBLOBs.getStatus().equalsIgnoreCase("STOP")) {
|
||||
|
||||
apiTestCaseWithBLOBs.setToBeUpdated(true);
|
||||
|
||||
} else if (apiSyncCaseRequest.getRunError() != null && apiSyncCaseRequest.getRunError() && apiTestCaseWithBLOBs.getStatus() != null
|
||||
&& !apiTestCaseWithBLOBs.getStatus().equalsIgnoreCase("Trash")
|
||||
&& apiTestCaseWithBLOBs.getStatus().equalsIgnoreCase("error")) {
|
||||
apiTestCaseWithBLOBs.setToBeUpdated(true);
|
||||
} else {
|
||||
apiTestCaseWithBLOBs.setToBeUpdated(false);
|
||||
}
|
||||
apiTestCaseWithBLOBs.setToBeUpdated(apiDefinition.getToBeUpdated());
|
||||
}
|
||||
if (apiDefinition.getToBeUpdateTime() != null) {
|
||||
apiTestCaseWithBLOBs.setToBeUpdateTime(apiDefinition.getToBeUpdateTime());
|
||||
|
@ -865,20 +865,7 @@ public class ApiTestCaseService {
|
||||
String requestStr = JSON.toJSONString(req);
|
||||
apiTestCase.setRequest(requestStr);
|
||||
if (toBeUpdated != null) {
|
||||
if (apiSyncCaseRequest.getUnRun() != null && apiSyncCaseRequest.getUnRun() && apiTestCase.getStatus() != null && !apiTestCase.getStatus().equalsIgnoreCase("Trash")
|
||||
&& !apiTestCase.getStatus().equalsIgnoreCase("success") && !apiTestCase.getStatus().equalsIgnoreCase("error")
|
||||
&& !apiTestCase.getStatus().equalsIgnoreCase("Running") && !apiTestCase.getStatus().equalsIgnoreCase("errorReportResult")
|
||||
&& !apiTestCase.getStatus().equalsIgnoreCase("STOP")) {
|
||||
|
||||
apiTestCase.setToBeUpdated(true);
|
||||
|
||||
} else if (apiSyncCaseRequest.getRunError() != null && apiSyncCaseRequest.getRunError() && apiTestCase.getStatus() != null && !apiTestCase.getStatus().equalsIgnoreCase("Trash")
|
||||
&& apiTestCase.getStatus().equalsIgnoreCase("error")) {
|
||||
apiTestCase.setToBeUpdated(true);
|
||||
} else {
|
||||
apiTestCase.setToBeUpdated(false);
|
||||
}
|
||||
|
||||
apiTestCase.setToBeUpdated(toBeUpdated);
|
||||
if (toBeUpdated) {
|
||||
apiTestCase.setToBeUpdateTime(System.currentTimeMillis());
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
package io.metersphere.base.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ApiTestCase implements Serializable {
|
||||
private String id;
|
||||
|
@ -503,10 +503,10 @@
|
||||
and (t1.status is null or t1.status != 'Trash')
|
||||
</if>
|
||||
<if test="request.toBeUpdated !=null and request.toBeUpdated == true">
|
||||
and t1.to_be_updated = #{request.toBeUpdated}
|
||||
and ( t1.to_be_updated = #{request.toBeUpdated} or t1.status = 'error')
|
||||
</if>
|
||||
<if test="request.toBeUpdated !=null and request.toBeUpdated == true and request.toBeUpdateTime !=null">
|
||||
and (t1.to_be_update_time >= #{request.toBeUpdateTime})
|
||||
and (t1.to_be_update_time >= #{request.toBeUpdateTime} or t1.status = 'error')
|
||||
</if>
|
||||
<include refid="queryVersionCondition">
|
||||
<property name="versionTable" value="t1"/>
|
||||
|
@ -230,15 +230,15 @@
|
||||
<el-checkbox v-model="apiSyncCaseRequest.body">{{ $t('api_test.request.body') }}</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<span>{{ $t('commons.track') + $t('commons.setting') }}</span>
|
||||
<el-row>
|
||||
<el-col :span="4">{{ $t('project.code_segment.result') + ":" }}</el-col>
|
||||
<el-col :span="20" style="color: #783887">
|
||||
<el-checkbox v-model="apiSyncCaseRequest.runError">{{ $t('schedule.event_failed') }}</el-checkbox>
|
||||
<el-checkbox v-model="apiSyncCaseRequest.unRun">{{ $t('api_test.home_page.detail_card.unexecute') }}
|
||||
</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <span>{{ $t('commons.track') + $t('commons.setting') }}</span>
|
||||
<el-row>
|
||||
<el-col :span="4">{{ $t('project.code_segment.result') + ":" }}</el-col>
|
||||
<el-col :span="20" style="color: #783887">
|
||||
<el-checkbox v-model="apiSyncCaseRequest.runError">{{ $t('schedule.event_failed') }}</el-checkbox>
|
||||
<el-checkbox v-model="apiSyncCaseRequest.unRun">{{ $t('api_test.home_page.detail_card.unexecute') }}
|
||||
</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>-->
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="showRuleSetting = false">取 消</el-button>
|
||||
@ -410,8 +410,8 @@ export default {
|
||||
query: true,
|
||||
rest: true,
|
||||
body: true,
|
||||
runError: true,
|
||||
unRun: true
|
||||
runError: false,
|
||||
unRun: false
|
||||
}
|
||||
}
|
||||
this.apiSyncCaseRequest.protocol = true;
|
||||
|
Loading…
Reference in New Issue
Block a user