feat(apifox): 为接口查询方法添加projectId参数支持
允许在查询接口详情时指定项目ID,提高多项目环境下的灵活性
This commit is contained in:
1 parent
ae684d83b1
commit
4386beea66
2 files changed
+14
-6
No files matched your search
@@ -276,7 +276,10 @@ export class ApifoxService {
|
||||
};
|
||||
}
|
||||
|
||||
async getApiDetailByPath(path) {
|
||||
async getApiDetailByPath(path, projectId) {
|
||||
if (projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
const apiDetails = await this.getApiDetails();
|
||||
const apiDetail = apiDetails.find((item) => item.path === path);
|
||||
if (!apiDetail) {
|
||||
@@ -285,7 +288,10 @@ export class ApifoxService {
|
||||
return this.getApiDetailResp(apiDetail);
|
||||
}
|
||||
|
||||
async getApiDetailsById(apiId) {
|
||||
async getApiDetailsById(apiId, projectId) {
|
||||
if (projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
const apiDetails = await this.getApiDetails();
|
||||
const apiDetail = apiDetails.find((item) => item.id === apiId);
|
||||
if (!apiDetail) {
|
||||
|
||||
Reference in new issue
Block a user