Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
8c768895d4
|
@ -80,8 +80,8 @@ public class ApiAutomationController {
|
|||
}
|
||||
|
||||
@PostMapping("/reduction")
|
||||
public void reduction(@RequestBody List<SaveApiScenarioRequest> requests) {
|
||||
apiAutomationService.reduction(requests);
|
||||
public void reduction(@RequestBody List<String> ids) {
|
||||
apiAutomationService.reduction(ids);
|
||||
}
|
||||
|
||||
@GetMapping("/getApiScenario/{id}")
|
||||
|
|
|
@ -128,8 +128,8 @@ public class ApiDefinitionController {
|
|||
}
|
||||
|
||||
@PostMapping("/reduction")
|
||||
public void reduction(@RequestBody List<SaveApiDefinitionRequest> requests) {
|
||||
apiDefinitionService.reduction(requests);
|
||||
public void reduction(@RequestBody ApiBatchRequest request) {
|
||||
apiDefinitionService.reduction(request);
|
||||
}
|
||||
|
||||
@GetMapping("/get/{id}")
|
||||
|
|
|
@ -316,13 +316,8 @@ public class ApiAutomationService {
|
|||
}
|
||||
}
|
||||
|
||||
public void reduction(List<SaveApiScenarioRequest> requests) {
|
||||
List<String> apiIds = new ArrayList<>();
|
||||
requests.forEach(item -> {
|
||||
checkNameExist(item);
|
||||
apiIds.add(item.getId());
|
||||
});
|
||||
extApiScenarioMapper.reduction(apiIds);
|
||||
public void reduction(List<String> ids) {
|
||||
extApiScenarioMapper.reduction(ids);
|
||||
}
|
||||
|
||||
private void checkNameExist(SaveApiScenarioRequest request) {
|
||||
|
|
|
@ -136,10 +136,11 @@ public class ApiDefinitionService {
|
|||
public ApiDefinitionWithBLOBs getBLOBs(String id) {
|
||||
return apiDefinitionMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public List<ApiDefinitionWithBLOBs> getBLOBs(List<String> idList) {
|
||||
if(idList == null || idList.isEmpty()){
|
||||
return new ArrayList<>(0);
|
||||
}else{
|
||||
if (idList == null || idList.isEmpty()) {
|
||||
return new ArrayList<>(0);
|
||||
} else {
|
||||
ApiDefinitionExample example = new ApiDefinitionExample();
|
||||
example.createCriteria().andIdIn(idList);
|
||||
example.setOrderByClause("create_time DESC ");
|
||||
|
@ -189,13 +190,8 @@ public class ApiDefinitionService {
|
|||
extApiDefinitionMapper.removeToGc(apiIds);
|
||||
}
|
||||
|
||||
public void reduction(List<SaveApiDefinitionRequest> requests) {
|
||||
List<String> apiIds = new ArrayList<>();
|
||||
requests.forEach(item -> {
|
||||
checkNameExist(item);
|
||||
apiIds.add(item.getId());
|
||||
});
|
||||
extApiDefinitionMapper.reduction(apiIds);
|
||||
public void reduction(ApiBatchRequest request) {
|
||||
extApiDefinitionMapper.reduction(request.getIds());
|
||||
}
|
||||
|
||||
public void deleteBodyFiles(String apiId) {
|
||||
|
@ -243,7 +239,7 @@ public class ApiDefinitionService {
|
|||
|
||||
private ApiDefinition updateTest(SaveApiDefinitionRequest request) {
|
||||
checkNameExist(request);
|
||||
if(StringUtils.equals(request.getMethod(),"ESB")){
|
||||
if (StringUtils.equals(request.getMethod(), "ESB")) {
|
||||
//ESB的接口类型数据,采用TCP方式去发送。并将方法类型改为TCP。 并修改发送数据
|
||||
request = esbApiParamService.handleEsbRequest(request);
|
||||
}
|
||||
|
@ -272,7 +268,7 @@ public class ApiDefinitionService {
|
|||
|
||||
private ApiDefinition createTest(SaveApiDefinitionRequest request) {
|
||||
checkNameExist(request);
|
||||
if(StringUtils.equals(request.getMethod(),"ESB")){
|
||||
if (StringUtils.equals(request.getMethod(), "ESB")) {
|
||||
//ESB的接口类型数据,采用TCP方式去发送。并将方法类型改为TCP。 并修改发送数据
|
||||
request = esbApiParamService.handleEsbRequest(request);
|
||||
}
|
||||
|
@ -709,6 +705,7 @@ public class ApiDefinitionService {
|
|||
calculateResult(resList);
|
||||
return resList;
|
||||
}
|
||||
|
||||
public List<ApiDefinitionResult> listRelevanceReview(ApiDefinitionRequest request) {
|
||||
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
|
||||
List<ApiDefinitionResult> resList = extApiDefinitionMapper.listRelevanceReview(request);
|
||||
|
@ -740,7 +737,7 @@ public class ApiDefinitionService {
|
|||
res.setCaseStatus("-");
|
||||
}
|
||||
|
||||
if(StringUtils.equals("ESB",res.getMethod())){
|
||||
if (StringUtils.equals("ESB", res.getMethod())) {
|
||||
esbApiParamService.handleApiEsbParams(res);
|
||||
}
|
||||
}
|
||||
|
@ -827,8 +824,7 @@ public class ApiDefinitionService {
|
|||
((MsApiExportResult) apiExportResult).setProtocol(request.getProtocol());
|
||||
((MsApiExportResult) apiExportResult).setProjectId(request.getProjectId());
|
||||
((MsApiExportResult) apiExportResult).setVersion(System.getenv("MS_VERSION"));
|
||||
}
|
||||
else { // 导出为 Swagger 格式
|
||||
} else { // 导出为 Swagger 格式
|
||||
Swagger3Parser swagger3Parser = new Swagger3Parser();
|
||||
System.out.println(apiDefinitionMapper.selectByExampleWithBLOBs(example));
|
||||
apiExportResult = swagger3Parser.swagger3Export(apiDefinitionMapper.selectByExampleWithBLOBs(example));
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
<el-table-column v-if="!referenced" width="30" min-width="30" :resizable="false" align="center">
|
||||
<template v-slot:default="scope">
|
||||
<show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectDataCounts" v-tester/>
|
||||
<show-more-btn :is-show="scope.row.showMore" :buttons="trashEnable ? trashButtons: buttons" :size="selectDataCounts" v-tester/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
|
@ -286,6 +286,12 @@
|
|||
{name: this.$t('api_test.definition.request.batch_delete'), handleClick: this.handleDeleteBatch},
|
||||
|
||||
],
|
||||
trashButtons: [
|
||||
{name: this.$t('api_test.definition.request.batch_delete'), handleClick: this.handleDeleteBatch},
|
||||
{
|
||||
name: "批量恢复", handleClick: this.handleBatchRestore
|
||||
},
|
||||
],
|
||||
isSelectAllDate: false,
|
||||
selectRows: new Set(),
|
||||
selectDataCounts: 0,
|
||||
|
@ -592,10 +598,14 @@
|
|||
this.$emit('edit', data);
|
||||
},
|
||||
reductionApi(row) {
|
||||
row.scenarioDefinition = null;
|
||||
row.tags = null;
|
||||
let rows = [row];
|
||||
this.$post("/api/automation/reduction", rows, response => {
|
||||
this.$post("/api/automation/reduction", [row.id], response => {
|
||||
this.$success(this.$t('commons.save_success'));
|
||||
this.search();
|
||||
})
|
||||
},
|
||||
handleBatchRestore() {
|
||||
let ids = Array.from(this.selectRows).map(row => row.id);
|
||||
this.$post("/api/automation/reduction", ids, response => {
|
||||
this.$success(this.$t('commons.save_success'));
|
||||
this.search();
|
||||
})
|
||||
|
|
|
@ -135,7 +135,6 @@
|
|||
}
|
||||
// 加载引用对象数据
|
||||
this.getApiInfo();
|
||||
console.log(JSON.stringify(this.request));
|
||||
if (this.request.protocol === 'HTTP') {
|
||||
this.setUrl(this.request.url);
|
||||
this.setUrl(this.request.path);
|
||||
|
|
|
@ -230,7 +230,8 @@
|
|||
}
|
||||
data.message = true;
|
||||
data.request.useEnvironment = this.environment;
|
||||
this.saveTestCase(data);
|
||||
//this.saveTestCase(data);
|
||||
|
||||
this.$emit('singleRun', data);
|
||||
},
|
||||
copyCase(data) {
|
||||
|
|
|
@ -222,7 +222,7 @@
|
|||
}
|
||||
|
||||
this.result = this.$post("/api/testcase/list", this.condition, response => {
|
||||
if(response.data){
|
||||
if (response.data) {
|
||||
this.apiCaseList = response.data;
|
||||
}
|
||||
this.apiCaseList.forEach(apiCase => {
|
||||
|
@ -260,7 +260,7 @@
|
|||
if (!request.hashTree) {
|
||||
request.hashTree = [];
|
||||
}
|
||||
if(request.backScript != null){
|
||||
if (request.backScript != null) {
|
||||
request.hashTree.push(request.backScript);
|
||||
}
|
||||
let uuid = getUUID();
|
||||
|
@ -290,14 +290,11 @@
|
|||
this.singleLoading = true;
|
||||
this.singleRunId = row.id;
|
||||
row.request.name = row.id;
|
||||
this.$get('/api/definition/get/' + row.request.id, response => {
|
||||
row.request.path = response.data.path; // 取的path是对应接口的path,因此查库以获得
|
||||
row.request.useEnvironment = this.environment;
|
||||
row.request.projectId = getCurrentProjectID();
|
||||
this.runData.push(row.request);
|
||||
/*触发执行操作*/
|
||||
this.reportId = getUUID().substring(0, 8);
|
||||
});
|
||||
row.request.useEnvironment = this.environment;
|
||||
row.request.projectId = getCurrentProjectID();
|
||||
this.runData.push(row.request);
|
||||
/*触发执行操作*/
|
||||
this.reportId = getUUID().substring(0, 8);
|
||||
},
|
||||
|
||||
batchRun() {
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<el-table-column width="30" :resizable="false" align="center">
|
||||
<template v-slot:default="scope">
|
||||
<!-- 选中记录后浮现的按钮,提供对记录的批量操作 -->
|
||||
<show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectDataCounts" v-tester/>
|
||||
<show-more-btn :is-show="scope.row.showMore" :buttons="trashEnable ? trashButtons : buttons" :size="selectDataCounts" v-tester/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
|
@ -289,6 +289,12 @@
|
|||
name: this.$t('api_test.definition.request.batch_move'), handleClick: this.handleBatchMove
|
||||
}
|
||||
],
|
||||
trashButtons: [
|
||||
{name: this.$t('api_test.definition.request.batch_delete'), handleClick: this.handleDeleteBatch},
|
||||
{
|
||||
name: "批量恢复", handleClick: this.handleBatchRestore
|
||||
},
|
||||
],
|
||||
typeArr: [
|
||||
{id: 'status', name: this.$t('api_test.definition.api_status')},
|
||||
{id: 'method', name: this.$t('api_test.definition.api_type')},
|
||||
|
@ -564,17 +570,18 @@
|
|||
},
|
||||
reductionApi(row) {
|
||||
let tmp = JSON.parse(JSON.stringify(row));
|
||||
tmp.request = null;
|
||||
tmp.response = null;
|
||||
if (tmp.tags instanceof Array) {
|
||||
tmp.tags = JSON.stringify(tmp.tags);
|
||||
}
|
||||
let rows = [tmp];
|
||||
let rows = {ids: [tmp.id]};
|
||||
this.$post('/api/definition/reduction/', rows, () => {
|
||||
this.$success(this.$t('commons.save_success'));
|
||||
this.search();
|
||||
});
|
||||
},
|
||||
handleBatchRestore() {
|
||||
this.$post('/api/definition/reduction/', buildBatchParam(this), () => {
|
||||
this.$success(this.$t('commons.save_success'));
|
||||
this.search();
|
||||
});
|
||||
},
|
||||
handleDeleteBatch() {
|
||||
if (this.trashEnable) {
|
||||
this.$alert(this.$t('api_test.definition.request.delete_confirm') + "?", '', {
|
||||
|
|
|
@ -26,6 +26,11 @@
|
|||
row: Object,
|
||||
size: Number
|
||||
},
|
||||
created() {
|
||||
if (this.trashEnable) {
|
||||
this.buttons.splice(1, 1);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(btn) {
|
||||
if (btn.handleClick instanceof Function) {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 3571feccf7c2bc68e4b619f6c367ac47d37c6723
|
||||
Subproject commit f63ebb68ebad78de42fd711f17e2671e34577a86
|
Loading…
Reference in New Issue