feat(接口测试): 引用关系连调

This commit is contained in:
wxg0103 2024-03-12 16:29:43 +08:00 committed by Craftsman
parent 1717198ca8
commit 23b792bac5
4 changed files with 20 additions and 17 deletions

View File

@ -10,6 +10,7 @@ import {
DebugDefinitionUrl,
DefinitionMockPageUrl,
DefinitionPageUrl,
DefinitionReferenceUrl,
DeleteDefinitionScheduleUrl,
DeleteDefinitionUrl,
DeleteMockUrl,
@ -55,6 +56,7 @@ import {
CreateImportApiDefinitionScheduleParams,
DefinitionHistoryItem,
DefinitionHistoryPageParams,
DefinitionReferencePageParams,
EnvModule,
ImportApiDefinitionParams,
mockParams,
@ -230,6 +232,11 @@ export function recoverOperationHistory(data: RecoverDefinitionParams) {
return MSR.post({ url: RecoverOperationHistoryUrl, data });
}
// 接口定义-引用关系
export function getDefinitionReference(data: DefinitionReferencePageParams) {
return MSR.post({ url: DefinitionReferenceUrl, data });
}
/**
* Mock
*/

View File

@ -41,3 +41,8 @@ export const RecoverOperationHistoryUrl = '/api/definition/operation-history/rec
export const DefinitionMockPageUrl = '/api/definition/mock/page'; // mock列表
export const UpdateMockStatusUrl = '/api/definition/mock/enable/'; // 更新mock状态
export const DeleteMockUrl = '/api/definition/mock/delete'; // 刪除mock
/**
*
*/
export const DefinitionReferenceUrl = '/api/definition/get-reference'; // 获取接口引用关系

View File

@ -257,3 +257,8 @@ export interface RecoverDefinitionParams {
sourceId: string | number;
versionId?: string;
}
// 引用关系列表查询参数
export interface DefinitionReferencePageParams extends TableQueryParams {
resourceId: string;
}

View File

@ -24,6 +24,7 @@
import { MsTableColumn } from '@/components/pure/ms-table/type';
import useTable from '@/components/pure/ms-table/useTable';
import { getDefinitionReference } from '@/api/modules/api-test/management';
import { useI18n } from '@/hooks/useI18n';
import useAppStore from '@/store/modules/app';
@ -78,20 +79,7 @@
},
];
const { propsRes, propsEvent, loadList, setLoadListParams } = useTable(
() =>
Promise.resolve({
list: [
{
id: '1',
resourceName: '资源名称',
resourceType: '资源类型',
quoteType: '引用类型',
belongOrg: '所属组织',
belongProject: '所属项目',
},
],
total: 1,
}),
getDefinitionReference,
{
columns,
scroll: { x: '100%' },
@ -106,9 +94,7 @@
function loadQuoteList() {
setLoadListParams({
projectId: appStore.currentProjectId,
sourceId: props.sourceId,
keyword: keyword.value,
resourceId: props.sourceId,
});
loadList();
}