fix(接口定义): 修复dubbo类型错误问题

This commit is contained in:
fit2-zhao 2021-02-23 11:01:13 +08:00
parent d578acc9f2
commit 6b931b9777
5 changed files with 49 additions and 41 deletions

View File

@ -198,7 +198,6 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
private void convertDubboSample(MsDubboSampler elementNode, DubboSample sampler) {
elementNode.setName(sampler.getName());
elementNode.setType("DubboSampler");
elementNode.setProtocol("dubbo://");
elementNode.set_interface(sampler.getPropertyAsString("FIELD_DUBBO_INTERFACE"));
elementNode.setMethod(sampler.getPropertyAsString("FIELD_DUBBO_METHOD"));

View File

@ -33,7 +33,7 @@ public class MsDubboSampler extends MsTestElement {
private String type = "DubboSampler";
@JSONField(ordinal = 52)
private String protocol = "DUBBO";
private final String protocol = "dubbo://";
@JsonProperty(value = "interface")
@JSONField(ordinal = 53, name = "interface")
private String _interface;

View File

@ -130,6 +130,9 @@ public class ApiDefinitionService {
public void create(SaveApiDefinitionRequest request, List<MultipartFile> bodyFiles) {
List<String> bodyUploadIds = new ArrayList<>(request.getBodyUploadIds());
if (StringUtils.equals(request.getProtocol(), "DUBBO")) {
request.setMethod("dubbo://");
}
createTest(request);
FileUtils.createBodyFiles(bodyUploadIds, bodyFiles);
}
@ -140,6 +143,9 @@ public class ApiDefinitionService {
}
List<String> bodyUploadIds = request.getBodyUploadIds();
request.setBodyUploadIds(null);
if (StringUtils.equals(request.getProtocol(), "DUBBO")) {
request.setMethod("dubbo://");
}
updateTest(request);
FileUtils.createBodyFiles(bodyUploadIds, bodyFiles);
}
@ -618,7 +624,7 @@ public class ApiDefinitionService {
return example;
}
private List<String> getAllApiIdsByFontedSelect(Map<String, List<String>> filters, String name, List<String> moduleIds, String projectId, List<String> unSelectIds,String protocol) {
private List<String> getAllApiIdsByFontedSelect(Map<String, List<String>> filters, String name, List<String> moduleIds, String projectId, List<String> unSelectIds, String protocol) {
ApiDefinitionRequest request = new ApiDefinitionRequest();
request.setFilters(filters);
request.setName(name);

@ -1 +1 @@
Subproject commit b9042074b780205e275c674f64417799110519fd
Subproject commit 5e0b365f1080197e84055e80071165787e2e79c5

View File

@ -204,44 +204,44 @@
</template>
<script>
import {API_STATUS, PRIORITY} from "../../definition/model/JsonData";
import {WORKSPACE_ID} from '@/common/js/constants';
import {
Assertions,
ConstantTimer,
Extract,
IfController,
JSR223Processor,
LoopController
} from "../../definition/model/ApiTestModel";
import {parseEnvironment} from "../../definition/model/EnvironmentModel";
import {ELEMENT_TYPE, ELEMENTS} from "./Setting";
import MsApiCustomize from "./ApiCustomize";
import {getCurrentProjectID, getUUID} from "@/common/js/utils";
import ApiEnvironmentConfig from "../../definition/components/environment/ApiEnvironmentConfig";
import MsInputTag from "./MsInputTag";
import MsRun from "./DebugRun";
import MsApiReportDetail from "../report/ApiReportDetail";
import MsVariableList from "./variable/VariableList";
import ApiImport from "../../definition/components/import/ApiImport";
import "@/common/css/material-icons.css"
import OutsideClick from "@/common/js/outside-click";
import ScenarioApiRelevance from "./api/ApiRelevance";
import ScenarioRelevance from "./api/ScenarioRelevance";
import MsComponentConfig from "./component/ComponentConfig";
import {handleCtrlSEvent} from "../../../../../common/js/utils";
import {API_STATUS, PRIORITY} from "../../definition/model/JsonData";
import {WORKSPACE_ID} from '@/common/js/constants';
import {
Assertions,
ConstantTimer,
Extract,
IfController,
JSR223Processor,
LoopController
} from "../../definition/model/ApiTestModel";
import {parseEnvironment} from "../../definition/model/EnvironmentModel";
import {ELEMENT_TYPE, ELEMENTS} from "./Setting";
import MsApiCustomize from "./ApiCustomize";
import {getCurrentProjectID, getUUID} from "@/common/js/utils";
import ApiEnvironmentConfig from "../../definition/components/environment/ApiEnvironmentConfig";
import MsInputTag from "./MsInputTag";
import MsRun from "./DebugRun";
import MsApiReportDetail from "../report/ApiReportDetail";
import MsVariableList from "./variable/VariableList";
import ApiImport from "../../definition/components/import/ApiImport";
import "@/common/css/material-icons.css"
import OutsideClick from "@/common/js/outside-click";
import ScenarioApiRelevance from "./api/ApiRelevance";
import ScenarioRelevance from "./api/ScenarioRelevance";
import MsComponentConfig from "./component/ComponentConfig";
import {handleCtrlSEvent} from "../../../../../common/js/utils";
export default {
name: "EditApiScenario",
props: {
moduleOptions: Array,
currentScenario: {},
},
components: {
MsVariableList,
ScenarioRelevance,
ScenarioApiRelevance,
ApiEnvironmentConfig,
export default {
name: "EditApiScenario",
props: {
moduleOptions: Array,
currentScenario: {},
},
components: {
MsVariableList,
ScenarioRelevance,
ScenarioApiRelevance,
ApiEnvironmentConfig,
MsApiReportDetail,
MsInputTag, MsRun,
MsApiCustomize,
@ -596,6 +596,9 @@ export default {
if (item.protocol) {
request.protocol = item.protocol;
}
if (request.protocol === "DUBBO") {
request.protocol = "dubbo://";
}
request.id = item.id;
request.name = item.name;
request.refType = refType;