Home > DMT_Folder > getFolderInfo
DMT_Folder.getFolderInfo() method
获取文件夹详细属性
签名
typescript
function getFolderInfo(teamUuid: string, folderUuid: string): Promise<IDMT_FolderItem | undefined>;1
参数名
参数 | 类型 | 描述 |
|---|---|---|
teamUuid | string | 团队 UUID |
folderUuid | string | 文件夹 UUID |
返回值
Promise<IDMT_FolderItem | undefined>
文件夹属性,如若为 undefined 则获取失败
备注
当 parentFolderUuid 等于 teamUuid 时,代表当前文件夹为指定团队下的一级文件夹
示例
javascript
// 1. 取当前工程所属团队
const projectInfo = await eda.dmt_Project.getCurrentProjectInfo();
const teamUuid = projectInfo.teamUuid;
// 2. 创建带描述的测试文件夹,等 1.5s 让工作区同步
const folderUuid = await eda.dmt_Folder.createFolder('嘉立创示例_查询', teamUuid, undefined, '嘉立创示例:初始描述');
await new Promise(r => setTimeout(r, 1500));
// 3. 查询文件夹详细属性
const folderInfo = await eda.dmt_Folder.getFolderInfo(teamUuid, folderUuid);
console.log('folderUuid:', folderUuid);
console.log('folderInfo:', JSON.stringify({
name: folderInfo?.name,
description: folderInfo?.description,
parentFolderUuid: folderInfo?.parentFolderUuid,
teamUuid: folderInfo?.teamUuid,
}));
// 4. 清理测试文件夹(查询类案例不留测试对象)
await eda.dmt_Folder.deleteFolder(teamUuid, folderUuid);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21