refactor: 请求头加描述

This commit is contained in:
AnAngle 2021-09-14 15:01:57 +08:00 committed by jianxing
parent 07797ec3b5
commit 2bc85f3e86
4 changed files with 13 additions and 3 deletions

View File

@ -16,7 +16,6 @@ import io.metersphere.api.service.ApiModuleService;
import io.metersphere.base.domain.ApiDefinitionWithBLOBs;
import io.metersphere.base.domain.ApiModule;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.json.JSONSchemaGenerator;
import io.metersphere.commons.utils.CommonBeanFactory;
import io.metersphere.commons.utils.LogUtil;
import io.metersphere.commons.utils.XMLUtils;

View File

@ -537,6 +537,7 @@ public class ApiDefinitionService {
apiDefinition.setModuleId(sameRequest.get(0).getModuleId());
apiDefinition.setModulePath(sameRequest.get(0).getModulePath());
apiDefinition.setNum(sameRequest.get(0).getNum()); //id 不变
apiDefinition.setOrder(sameRequest.get(0).getOrder());
apiDefinitionMapper.updateByPrimaryKeyWithBLOBs(apiDefinition);
apiDefinition.setRequest(request);
importApiCase(apiDefinition, apiTestCaseMapper, apiTestImportRequest, false);
@ -553,6 +554,7 @@ public class ApiDefinitionService {
if (StringUtils.equalsAnyIgnoreCase(apiDefinition.getProtocol(), RequestType.TCP)) {
String request = setImportTCPHashTree(apiDefinition);
}
apiDefinition.setOrder(sameRequest.get(0).getOrder());
apiDefinitionMapper.updateByPrimaryKeyWithBLOBs(apiDefinition);
}
@ -640,6 +642,7 @@ public class ApiDefinitionService {
apiTestCase.setPriority(sameCase.getPriority());
apiTestCase.setCreateUserId(sameCase.getCreateUserId());
apiTestCase.setNum(sameCase.getNum());
apiTestCase.setOrder(sameCase.getOrder());
apiTestCase.setProjectId(sameCase.getProjectId());
apiTestCase.setVersion((sameCase.getVersion() == null ? 0 : sameCase.getVersion()) + 1);
apiTestCaseMapper.updateByPrimaryKeySelective(apiTestCase);

View File

@ -47,6 +47,13 @@
</el-autocomplete>
</div>
</el-col>
<el-col class="item" v-if="showDesc">
<el-input v-model="item.description" size="small" maxlength="200"
:placeholder="$t('commons.description')" show-word-limit>
</el-input>
</el-col>
<el-col class="item kv-delete">
<el-button size="mini" class="el-icon-delete-solid" circle @click="remove(index)"
:disabled="isDisable(index) || isReadOnly"/>
@ -84,7 +91,8 @@
needMock: {
type: Boolean,
default: false
}
},
showDesc: Boolean
},
data() {
return {

View File

@ -17,7 +17,7 @@
<el-row>
<el-link class="ms-el-link" @click="batchAdd" style="color: #783887"> {{ $t("commons.batch_add") }}</el-link>
</el-row>
<ms-api-key-value :is-read-only="isReadOnly" :isShowEnable="isShowEnable" :suggestions="headerSuggestions" :items="headers" :need-mock="true"/>
<ms-api-key-value :show-desc="true" :is-read-only="isReadOnly" :isShowEnable="isShowEnable" :suggestions="headerSuggestions" :items="headers" :need-mock="true"/>
</el-tab-pane>
<!--query 参数-->