fix(接口测试): 接口详情变更历史无变更详情日志

--bug=1009209 --user=王孝刚 [ github#8776]接口详情-变更历史无变更详情日志
https://www.tapd.cn/55049933/s/1086916
This commit is contained in:
wxg0103 2021-12-24 14:08:13 +08:00 committed by fit2-zhao
parent 18c199aa72
commit b3427b0714
4 changed files with 31 additions and 0 deletions

View File

@ -324,6 +324,11 @@ public class ApiDefinitionDiffUtil {
}
private static void diffDubbo(MsDubboSampler dubboNew, MsDubboSampler dubboOld, JsonDiff jsonDiff, Map<String, String> diffMap) {
// Config对比
List<DetailColumn> interfaceColumns = getColumn(ReflexObjectUtil.getColumns(dubboNew.get_interface()), ReflexObjectUtil.getColumns(dubboOld.get_interface()));
if (CollectionUtils.isNotEmpty(interfaceColumns)) {
diffMap.put("interface", JSON.toJSONString(interfaceColumns));
}
// Config对比
List<DetailColumn> diffColumns = getColumn(ReflexObjectUtil.getColumns(dubboNew.getConfigCenter()), ReflexObjectUtil.getColumns(dubboOld.getConfigCenter()));
if (CollectionUtils.isNotEmpty(diffColumns)) {

View File

@ -29,6 +29,7 @@ public class DefinitionReference {
definitionColumns.put("response", "返回参数");
definitionColumns.put("description", "描述");
definitionColumns.put("followPeople", "关注人");
definitionColumns.put("remark", "备注");
// 需要深度对比的字段可以支持多个req1,req2
definitionColumns.put("ms-dff-col", "request,response,tags");

View File

@ -1,6 +1,25 @@
<template>
<div>
<el-tabs v-model="activeName">
<el-tab-pane label="Interface" name="interface" v-if="request.interface && request.interface.length > 0">
<el-table :data="request.interface">
<el-table-column prop="columnTitle" :label="$t('operating_log.change_field')"/>
<el-table-column prop="originalValue" :label="$t('operating_log.before_change')">
<template v-slot:default="scope">
<el-tooltip :content="scope.row.originalValue">
<div class="current-value ms-tag-del">{{ scope.row.originalValue }}</div>
</el-tooltip>
</template>
</el-table-column>
<el-table-column prop="newValue" :label="$t('operating_log.after_change')">
<template v-slot:default="scope">
<el-tooltip :content="scope.row.newValue">
<div class="current-value ms-tag-add">{{ scope.row.newValue }}</div>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="Config Center" name="config" v-if="request.config && request.config.length > 0">
<el-table :data="request.config">
<el-table-column prop="columnTitle" :label="$t('operating_log.change_field')"/>
@ -91,6 +110,8 @@ export default {
this.activeName = "args";
} else if (this.request.attachment && this.request.attachment.length > 0) {
this.activeName = "attachment";
} else if (this.request.interface && this.request.interface.length > 0) {
this.activeName = "interface";
}
},
watch: {

View File

@ -218,6 +218,10 @@ export default {
}
},
formatDubbo(diffValue) {
if (diffValue.interface) {
this.detail.interface = JSON.parse(diffValue.interface);
this.detail.headerId = getUUID();
}
if (diffValue.config) {
this.detail.config = JSON.parse(diffValue.config);
this.detail.headerId = getUUID();