fix: 场景导出代码冲突

This commit is contained in:
chenjianxing 2021-02-20 14:10:06 +08:00
parent ce7600bad4
commit 3e623dd0ad
4 changed files with 2 additions and 37 deletions

View File

@ -44,13 +44,6 @@ public class ApiAutomationController {
return PageUtils.setPageInfo(page, apiAutomationService.list(request));
}
@PostMapping("/list/all")
@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER}, logical = Logical.OR)
public List<ApiScenarioWithBLOBs> list(@RequestBody ApiScenarioRequest request) {
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
return apiAutomationService.get(request);
}
@PostMapping(value = "/create")
public ApiScenario create(@RequestPart("request") SaveApiScenarioRequest request, @RequestPart(value = "files") List<MultipartFile> bodyFiles) {
return apiAutomationService.create(request, bodyFiles);

View File

@ -720,16 +720,6 @@ public class ApiAutomationService {
}
}
public List<ApiScenarioWithBLOBs> get(ApiScenarioRequest request) {
ApiScenarioExample example = new ApiScenarioExample();
if (CollectionUtils.isNotEmpty(request.getIds())) {
example.createCriteria().andIdIn(request.getIds());
} else {
example.createCriteria().andProjectIdEqualTo(request.getProjectId());
}
return apiScenarioMapper.selectByExampleWithBLOBs(example);
}
public List<ApiScenarioWithBLOBs> getWithBLOBs(ApiScenarioWithBLOBs request) {
ApiScenarioExample example = new ApiScenarioExample();
example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId()).andStatusNotEqualTo("Trash").andIdNotEqualTo(request.getId());

View File

@ -131,25 +131,7 @@
},
methods: {
exportAPI() {
let obj = {projectName: localStorage.getItem(PROJECT_NAME)}
let condition = {projectId: getCurrentProjectID(), ids: this.$refs.apiScenarioList.selection};
let url = "/api/automation/list/all";
this.loading = true;
this.$post(url, condition, response => {
obj.data = response.data;
this.buildApiPath(obj.data);
this.loading = false;
downloadFile("Metersphere_Scenario_" + localStorage.getItem(PROJECT_NAME) + ".json", JSON.stringify(obj));
});
},
buildApiPath(apis) {
apis.forEach((api) => {
this.moduleOptions.forEach(item => {
if (api.moduleId === item.id) {
api.modulePath = item.path;
}
});
});
this.$refs.apiScenarioList.exportApi();
},
checkRedirectEditPage(redirectParam) {
if (redirectParam != null) {

View File

@ -187,7 +187,7 @@ import {PROJECT_NAME} from "../../../../../common/js/constants";
import EnvironmentSelect from "../../definition/components/environment/EnvironmentSelect";
import BatchMove from "../../../track/case/components/BatchMove";
import {_sort} from "@/common/js/tableUtils";
import {Api_Scenario_List, Track_Test_Case} from "@/business/components/common/model/JsonData";
import {Api_Scenario_List} from "@/business/components/common/model/JsonData";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import {
_filter,