fix(接口自动化) 增加单个导出jmx 文件方法

This commit is contained in:
fit2-zhao 2021-09-23 15:20:03 +08:00 committed by fit2-zhao
parent 9ce872e90f
commit 31ced8754a
2 changed files with 14 additions and 2 deletions

View File

@ -335,7 +335,7 @@ public class ApiAutomationController {
return apiAutomationService.setDomain(request.getDefinition());
}
@PostMapping(value = "/export/jmx")
@PostMapping(value = "/export/zip")
@RequiresPermissions(PermissionConstants.PROJECT_API_SCENARIO_READ_EXPORT_SCENARIO)
@MsAuditLog(module = "api_automation", type = OperLogConstants.EXPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId")
public ResponseEntity<byte[]> downloadBodyFiles(@RequestBody ApiScenarioBatchRequest request) {
@ -345,5 +345,13 @@ public class ApiAutomationController {
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + "场景JMX文件集.zip")
.body(bytes);
}
@PostMapping(value = "/export/jmx")
@RequiresPermissions(PermissionConstants.PROJECT_API_SCENARIO_READ_EXPORT_SCENARIO)
@MsAuditLog(module = "api_automation", type = OperLogConstants.EXPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId")
public List<ApiScenrioExportJmx> exportJmx(@RequestBody ApiScenarioBatchRequest request) {
return apiAutomationService.exportJmx(request);
}
}

View File

@ -253,6 +253,7 @@ import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOpe
import {editApiScenarioCaseOrder} from "@/business/components/api/automation/api-automation";
import {TYPE_TO_C} from "@/business/components/api/automation/scenario/Setting";
import axios from "axios";
import {error} from "@/common/js/message";
export default {
name: "MsApiScenarioList",
@ -1031,6 +1032,9 @@ export default {
link.download = "场景JMX文件集.zip";
this.result.loading = false;
link.click();
},error => {
this.result.loading = false;
this.$error("导出JMX文件失败");
});
},
@ -1042,7 +1046,7 @@ export default {
return;
}
this.result.loading = true;
this.fileDownload("/api/automation/export/jmx", param);
this.fileDownload("/api/automation/export/zip", param);
},
getConditions() {
return this.condition;