|
@@ -1,12 +1,17 @@
|
|
|
|
|
|
|
|
import { writeFile } from 'fs/promises';
|
|
import { writeFile } from 'fs/promises';
|
|
|
-import { GetContentListParams, type GetContentDetailItem, type GetContentListItem } from '~/api/CommonContent';
|
|
|
|
|
-import ProjectsContent from '~/api/inheritor/ProjectsContent';
|
|
|
|
|
|
|
+import CommonContent, { GetContentListParams, type GetContentDetailItem, type GetContentListItem } from '../../api/CommonContent';
|
|
|
|
|
+import ProjectsContent from '../../api/inheritor/ProjectsContent';
|
|
|
|
|
+import InheritorContent from '../../api/inheritor/InheritorContent';
|
|
|
|
|
+import SeminarContent from '../../api/inheritor/SeminarContent';
|
|
|
|
|
+import UnitContent from '../../api/inheritor/UnitContent';
|
|
|
|
|
+import UnmoveableContent from '../../api/inheritor/UnmoveableContent';
|
|
|
|
|
+import path from 'path';
|
|
|
|
|
+import fs from 'fs';
|
|
|
|
|
+import { argv, cwd } from 'process';
|
|
|
|
|
|
|
|
const data = [] as Array<GetContentListItem & { detail?: GetContentDetailItem }>;
|
|
const data = [] as Array<GetContentListItem & { detail?: GetContentDetailItem }>;
|
|
|
|
|
|
|
|
-const markdownText = ref('');
|
|
|
|
|
-
|
|
|
|
|
// HTML转Markdown的简单实现
|
|
// HTML转Markdown的简单实现
|
|
|
function htmlToMarkdown(html: string): string {
|
|
function htmlToMarkdown(html: string): string {
|
|
|
if (!html) return '';
|
|
if (!html) return '';
|
|
@@ -57,24 +62,37 @@ function htmlToMarkdown(html: string): string {
|
|
|
return html.trim();
|
|
return html.trim();
|
|
|
}
|
|
}
|
|
|
// 生成Markdown文本
|
|
// 生成Markdown文本
|
|
|
-function generateMarkdown(): string {
|
|
|
|
|
- let md = '';
|
|
|
|
|
|
|
+async function generateMarkdownIch(subDir: string, type: string) {
|
|
|
|
|
|
|
|
- data.forEach((item, index) => {
|
|
|
|
|
- if (index > 0) {
|
|
|
|
|
- md += '\n\n---\n\n';
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ for (const item of data) {
|
|
|
|
|
|
|
|
|
|
+ let md = '';
|
|
|
// 基本信息
|
|
// 基本信息
|
|
|
md += `# ${item.title}\n\n`;
|
|
md += `# ${item.title}\n\n`;
|
|
|
- md += `${item.desc || '无描述'}\n\n`;
|
|
|
|
|
|
|
+ if (item.desc)
|
|
|
|
|
+ md += `${item.desc}\n\n`;
|
|
|
md += `## 基本信息\n\n`;
|
|
md += `## 基本信息\n\n`;
|
|
|
- md += `- 非遗级别: ${item.levelText || '无'}\n`;
|
|
|
|
|
- md += `- 非遗类别: ${item.ichTypeText || '无'}\n`;
|
|
|
|
|
- md += `- 地区: ${item.district || '无'}\n`;
|
|
|
|
|
- md += `- 批次: ${item.batchText || '无'}\n`;
|
|
|
|
|
- md += `- 保护单位: ${item.unit || '无'}\n\n`;
|
|
|
|
|
|
|
+ md += `类型:${type}\n\n`;
|
|
|
|
|
+
|
|
|
|
|
+ function addRow(key: string, value: any) {
|
|
|
|
|
+ if (value)
|
|
|
|
|
+ md += `- ${key}: ${value}\n`;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ addRow('级别', item.levelText);
|
|
|
|
|
+ addRow('类别', item.ichTypeText);
|
|
|
|
|
+ addRow('地区', item.regionText);
|
|
|
|
|
+ addRow('批次', item.batchText);
|
|
|
|
|
+ addRow('保护单位', item.unit);
|
|
|
|
|
+ addRow('地址', item.address);
|
|
|
|
|
+ addRow('字号名称', item.fontName);
|
|
|
|
|
+ addRow('认定类型', item.brandType);
|
|
|
|
|
+ addRow('其他级别保护单位', item.detail?.otherLevel && item.detail.otherLevel.length > 0 ? `${item.detail.otherLevel.length}个` : '');
|
|
|
|
|
|
|
|
|
|
+ md += `\n## 数据库索引ID\n\n`;
|
|
|
|
|
+ md += `- 类型: intangible\n`;
|
|
|
|
|
+ md += `- ID: ${item.id || '无'}\n\n`;
|
|
|
|
|
+
|
|
|
// 图片
|
|
// 图片
|
|
|
if (item.images && item.images.length > 0) {
|
|
if (item.images && item.images.length > 0) {
|
|
|
md += `## 图片\n\n`;
|
|
md += `## 图片\n\n`;
|
|
@@ -85,22 +103,45 @@ function generateMarkdown(): string {
|
|
|
|
|
|
|
|
// 详细信息
|
|
// 详细信息
|
|
|
if (item.detail) {
|
|
if (item.detail) {
|
|
|
|
|
+ const detail = item.detail as GetContentDetailItem;
|
|
|
// 简介
|
|
// 简介
|
|
|
- if (item.detail.intro) {
|
|
|
|
|
|
|
+ if (detail.intro) {
|
|
|
md += `## 简介\n\n`;
|
|
md += `## 简介\n\n`;
|
|
|
- md += htmlToMarkdown(item.detail.intro) + '\n\n';
|
|
|
|
|
|
|
+ md += htmlToMarkdown(detail.intro) + '\n\n';
|
|
|
|
|
+ }
|
|
|
|
|
+ // 内容
|
|
|
|
|
+ if (detail.content) {
|
|
|
|
|
+ md += `## 内容\n\n`;
|
|
|
|
|
+ md += htmlToMarkdown(detail.content) + '\n\n';
|
|
|
}
|
|
}
|
|
|
|
|
+ // 传承谱系
|
|
|
|
|
+ if (detail.pedigree) {
|
|
|
|
|
+ md += `## 传承谱系\n\n`;
|
|
|
|
|
+ md += htmlToMarkdown(detail.pedigree as string) + '\n\n';
|
|
|
|
|
+ }
|
|
|
|
|
+ // 视频
|
|
|
|
|
+ if (detail.video) {
|
|
|
|
|
+ md += `## 视频\n\n`;
|
|
|
|
|
+ md += `[视频](${detail.video})\n\n`;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (detail.publishVideo)
|
|
|
|
|
+ md += `[介绍视频](${detail.publishVideo})\n\n`;
|
|
|
|
|
|
|
|
// 传承人
|
|
// 传承人
|
|
|
- if (item.detail.inheritorsList && item.detail.inheritorsList.length > 0) {
|
|
|
|
|
|
|
+ if (detail.inheritorsList && detail.inheritorsList.length > 0) {
|
|
|
md += `## 相关传承人\n\n`;
|
|
md += `## 相关传承人\n\n`;
|
|
|
- if (item.detail.inheritor) {
|
|
|
|
|
- md += htmlToMarkdown(item.detail.inheritor) + '\n\n';
|
|
|
|
|
|
|
+ if (detail.inheritor) {
|
|
|
|
|
+ md += htmlToMarkdown(detail.inheritor) + '\n\n';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- item.detail.inheritorsList.forEach(inheritor => {
|
|
|
|
|
|
|
+ detail.inheritorsList.forEach(inheritor => {
|
|
|
md += `### ${inheritor.title}\n\n`;
|
|
md += `### ${inheritor.title}\n\n`;
|
|
|
md += `级别:${inheritor.levelLext || '无'}\n\n`;
|
|
md += `级别:${inheritor.levelLext || '无'}\n\n`;
|
|
|
|
|
+
|
|
|
|
|
+ md += `#### 数据库索引ID\n\n`;
|
|
|
|
|
+ md += `- 类型: inheritor\n`;
|
|
|
|
|
+ md += `- ID: ${inheritor.id || '无'}\n\n`;
|
|
|
|
|
+
|
|
|
if (inheritor.image) {
|
|
if (inheritor.image) {
|
|
|
md += `\n\n`;
|
|
md += `\n\n`;
|
|
|
}
|
|
}
|
|
@@ -108,29 +149,277 @@ function generateMarkdown(): string {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 传习所
|
|
// 传习所
|
|
|
- if (item.detail.ichSitesList && item.detail.ichSitesList.length > 0) {
|
|
|
|
|
|
|
+ if (detail.ichSitesList && detail.ichSitesList.length > 0) {
|
|
|
md += `## 相关传习所\n\n`;
|
|
md += `## 相关传习所\n\n`;
|
|
|
- item.detail.ichSitesList.forEach(site => {
|
|
|
|
|
|
|
+ detail.ichSitesList.forEach(site => {
|
|
|
md += `### ${site.title}\n\n`;
|
|
md += `### ${site.title}\n\n`;
|
|
|
md += `级别:${site.levelLext || '无'}\n\n`;
|
|
md += `级别:${site.levelLext || '无'}\n\n`;
|
|
|
md += `地址:${site.address || '无'}\n\n`;
|
|
md += `地址:${site.address || '无'}\n\n`;
|
|
|
|
|
+
|
|
|
|
|
+ md += `#### 数据库索引ID\n\n`;
|
|
|
|
|
+ md += `- 类型: seminar\n`;
|
|
|
|
|
+ md += `- ID: ${site.id || '无'}\n\n`;
|
|
|
|
|
+
|
|
|
if (site.image) {
|
|
if (site.image) {
|
|
|
md += `\n\n`;
|
|
md += `\n\n`;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 同级别项目
|
|
|
|
|
+ if (detail.otherLevel && detail.otherLevel.length > 0) {
|
|
|
|
|
+ md += `## 其他级别非遗项目\n\n`;
|
|
|
|
|
+ detail.otherLevel.forEach(project => {
|
|
|
|
|
+ md += `### ${project.title}\n\n`;
|
|
|
|
|
+ md += `级别:${project.levelLext || '无'}\n\n`;
|
|
|
|
|
+ md += `保护单位:${project.unit || '无'}\n\n`;
|
|
|
|
|
+
|
|
|
|
|
+ md += `#### 数据库索引ID\n\n`;
|
|
|
|
|
+ md += `- 类型: intangible\n`;
|
|
|
|
|
+ md += `- ID: ${project.id || '无'}\n\n`;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+
|
|
|
|
|
+ await writeFile(path.join(subDir, `${item.id}.md`), md);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+async function generateMarkdownInheritor(subDir: string) {
|
|
|
|
|
|
|
|
- return md;
|
|
|
|
|
|
|
+ for (const item of data) {
|
|
|
|
|
+
|
|
|
|
|
+ let md = '';
|
|
|
|
|
+ // 基本信息
|
|
|
|
|
+ md += `# ${item.title}\n\n`;
|
|
|
|
|
+ if (item.desc)
|
|
|
|
|
+ md += `${item.desc}\n\n`;
|
|
|
|
|
+ md += `## 基本信息\n\n`;
|
|
|
|
|
+ md += `类型:非遗传承人\n\n`;
|
|
|
|
|
+
|
|
|
|
|
+ function addRow(key: string, value: any) {
|
|
|
|
|
+ if (value)
|
|
|
|
|
+ md += `- ${key}: ${value}\n`;
|
|
|
|
|
+ }
|
|
|
|
|
+ addRow('民族', item.detail?.nation);
|
|
|
|
|
+ addRow('性别', item.detail?.gender == '1'? '男' : '女');
|
|
|
|
|
+ addRow('出生日期', item.detail?.dateBirth);
|
|
|
|
|
+ addRow('出生地区', item.detail?.birthplace);
|
|
|
|
|
+ addRow('单位', item.detail?.unit);
|
|
|
|
|
+ addRow('传承项目', item.detail?.associationMeList[0]?.title);
|
|
|
|
|
+ addRow('传承人级别', item.detail?.batchText);
|
|
|
|
|
+ addRow('公布批次', item.detail?.batchText);
|
|
|
|
|
+
|
|
|
|
|
+ md += `\n## 数据库索引ID\n\n`;
|
|
|
|
|
+ md += `- 类型: inheritor\n`;
|
|
|
|
|
+ md += `- ID: ${item.id || '无'}\n\n`;
|
|
|
|
|
+
|
|
|
|
|
+ // 图片
|
|
|
|
|
+ if (item.images && item.images.length > 0) {
|
|
|
|
|
+ md += `## 图片\n\n`;
|
|
|
|
|
+ item.images.forEach(image => {
|
|
|
|
|
+ md += `\n\n`;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 详细信息
|
|
|
|
|
+ if (item.detail) {
|
|
|
|
|
+ const detail = item.detail as GetContentDetailItem;
|
|
|
|
|
+ // 简介
|
|
|
|
|
+ if (detail.intro) {
|
|
|
|
|
+ md += `## 简介\n\n`;
|
|
|
|
|
+ md += htmlToMarkdown(detail.intro) + '\n\n';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (detail.content) {
|
|
|
|
|
+ md += `## 详情\n\n`;
|
|
|
|
|
+ md += htmlToMarkdown(detail.content) + '\n\n';
|
|
|
|
|
+ }
|
|
|
|
|
+ // 奖项
|
|
|
|
|
+ if (detail.prize) {
|
|
|
|
|
+ md += `## 奖项\n\n`;
|
|
|
|
|
+ md += htmlToMarkdown(detail.prize as string) + '\n\n';
|
|
|
|
|
+ }
|
|
|
|
|
+ // 相关项目
|
|
|
|
|
+ if (detail.associationMeList && detail.associationMeList.length > 0) {
|
|
|
|
|
+ md += `## 相关项目\n\n`;
|
|
|
|
|
+ detail.associationMeList.forEach(inheritor => {
|
|
|
|
|
+ md += `### ${inheritor.title}\n\n`;
|
|
|
|
|
+
|
|
|
|
|
+ md += `#### 数据库索引ID\n\n`;
|
|
|
|
|
+ md += `- 类型: intangible\n`;
|
|
|
|
|
+ md += `- ID: ${inheritor.id || '无'}\n\n`;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ // 传习所
|
|
|
|
|
+ if (detail.ichSitesList && detail.ichSitesList.length > 0) {
|
|
|
|
|
+ md += `## 相关传习所\n\n`;
|
|
|
|
|
+ detail.ichSitesList.forEach(site => {
|
|
|
|
|
+ md += `### ${site.title}\n\n`;
|
|
|
|
|
+ md += `级别:${site.levelLext || '无'}\n\n`;
|
|
|
|
|
+ md += `地址:${site.address || '无'}\n\n`;
|
|
|
|
|
+
|
|
|
|
|
+ md += `##### 数据库索引ID\n\n`;
|
|
|
|
|
+ md += `- 类型: seminar\n`;
|
|
|
|
|
+ md += `- ID: ${site.id || '无'}\n\n`;
|
|
|
|
|
+
|
|
|
|
|
+ if (site.image) {
|
|
|
|
|
+ md += `\n\n`;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ await writeFile(path.join(subDir, `${item.id}.md`), md);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+async function generateMarkdownArtifact(subDir: string) {
|
|
|
|
|
+
|
|
|
|
|
+ for (const item of data) {
|
|
|
|
|
+
|
|
|
|
|
+ let md = '';
|
|
|
|
|
+ // 基本信息
|
|
|
|
|
+ md += `# ${item.title}\n\n`;
|
|
|
|
|
+ if (item.desc)
|
|
|
|
|
+ md += `${item.desc}\n\n`;
|
|
|
|
|
+ md += `## 基本信息\n\n`;
|
|
|
|
|
+ md += `类型:非遗传承人\n\n`;
|
|
|
|
|
+
|
|
|
|
|
+ function addRow(key: string, value: any) {
|
|
|
|
|
+ if (value)
|
|
|
|
|
+ md += `- ${key}: ${value}\n`;
|
|
|
|
|
+ }
|
|
|
|
|
+ addRow('开放时间', item.detail?.openStatusText);
|
|
|
|
|
+ addRow('年代', item.age);
|
|
|
|
|
+ addRow('级别', item.levelText);
|
|
|
|
|
+ addRow('所属区域', item.regionText);
|
|
|
|
|
+ addRow('文物类型', item.crTypeText);
|
|
|
|
|
+ addRow('单位', item.detail?.unit);
|
|
|
|
|
+
|
|
|
|
|
+ md += `\n## 数据库索引ID\n\n`;
|
|
|
|
|
+ md += `- 类型: artifact\n`;
|
|
|
|
|
+ md += `- ID: ${item.id || '无'}\n\n`;
|
|
|
|
|
|
|
|
-(await ProjectsContent.getContentList(new GetContentListParams(), 1, 1000)).list.forEach(item => {
|
|
|
|
|
- data.push(item);
|
|
|
|
|
-});
|
|
|
|
|
-for (const item of data) {
|
|
|
|
|
- item.detail = (await ProjectsContent.getContentDetail(item.id)) as GetContentDetailItem;
|
|
|
|
|
|
|
+ // 图片
|
|
|
|
|
+ if (item.images && item.images.length > 0) {
|
|
|
|
|
+ md += `## 图片\n\n`;
|
|
|
|
|
+ item.images.forEach(image => {
|
|
|
|
|
+ md += `\n\n`;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.video) {
|
|
|
|
|
+ md += `## 视频\n\n`;
|
|
|
|
|
+ md += `\n\n`;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 详细信息
|
|
|
|
|
+ if (item.detail) {
|
|
|
|
|
+ const detail = item.detail as GetContentDetailItem;
|
|
|
|
|
+ // 简介
|
|
|
|
|
+ if (detail.intro) {
|
|
|
|
|
+ md += `## 简介\n\n`;
|
|
|
|
|
+ md += htmlToMarkdown(detail.intro) + '\n\n';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (detail.content) {
|
|
|
|
|
+ md += `## 详情\n\n`;
|
|
|
|
|
+ md += htmlToMarkdown(detail.content) + '\n\n';
|
|
|
|
|
+ }
|
|
|
|
|
+ // 奖项
|
|
|
|
|
+ if (detail.protectedArea) {
|
|
|
|
|
+ md += `## 保护范围\n\n`;
|
|
|
|
|
+ md += htmlToMarkdown(detail.protectedArea as string) + '\n\n';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (detail.environment) {
|
|
|
|
|
+ md += `## 建筑环境\n\n`;
|
|
|
|
|
+ md += htmlToMarkdown(detail.environment as string) + '\n\n';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (detail.价值评估) {
|
|
|
|
|
+ md += `## 价值评估\n\n`;
|
|
|
|
|
+ md += htmlToMarkdown(detail.价值评估 as string) + '\n\n';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ await writeFile(path.join(subDir, `${item.id}.md`), md);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
-// 生成Markdown文本
|
|
|
|
|
-markdownText.value = generateMarkdown();
|
|
|
|
|
-await writeFile('非遗项目数据.md', markdownText.value);
|
|
|
|
|
|
|
+
|
|
|
|
|
+async function main() {
|
|
|
|
|
+
|
|
|
|
|
+ const type = argv[2];
|
|
|
|
|
+
|
|
|
|
|
+ function makeDir(nanme: string) {
|
|
|
|
|
+ const dir = path.join(cwd(), `dist/${nanme}`);
|
|
|
|
|
+ if (!fs.existsSync(dir))
|
|
|
|
|
+ fs.mkdirSync(dir, { recursive: true });
|
|
|
|
|
+ return dir;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ switch (type) {
|
|
|
|
|
+ case 'ich': {
|
|
|
|
|
+ const dir = makeDir('ich');
|
|
|
|
|
+ (await ProjectsContent.getContentList(new GetContentListParams(), 1, 1000)).list.forEach(item => {
|
|
|
|
|
+ data.push(item);
|
|
|
|
|
+ });
|
|
|
|
|
+ for (const item of data)
|
|
|
|
|
+ item.detail = (await ProjectsContent.getContentDetail(item.id)) as GetContentDetailItem;
|
|
|
|
|
+ generateMarkdownIch(dir, '非遗项目');
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ case 'seminar': {
|
|
|
|
|
+ const dir = makeDir('seminar');
|
|
|
|
|
+ (await SeminarContent.getContentList(new GetContentListParams(), 1, 1000)).list.forEach(item => {
|
|
|
|
|
+ data.push(item);
|
|
|
|
|
+ });
|
|
|
|
|
+ for (const item of data)
|
|
|
|
|
+ item.detail = (await SeminarContent.getContentDetail(item.id)) as GetContentDetailItem;
|
|
|
|
|
+ generateMarkdownIch(dir, '非遗传习所');
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ case 'old': {
|
|
|
|
|
+ const dir = makeDir('old');
|
|
|
|
|
+ (await CommonContent.getContentList(new GetContentListParams()
|
|
|
|
|
+ .setModelId(17)
|
|
|
|
|
+ .setMainBodyColumnId(312)
|
|
|
|
|
+ , 1, 1000)).list.forEach(item => {
|
|
|
|
|
+ data.push(item);
|
|
|
|
|
+ });
|
|
|
|
|
+ for (const item of data)
|
|
|
|
|
+ item.detail = (await CommonContent.getContentDetail(item.id)) as GetContentDetailItem;
|
|
|
|
|
+ generateMarkdownIch(dir, '老字号');
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ case 'unit': {
|
|
|
|
|
+ const dir = makeDir('unit');
|
|
|
|
|
+ (await UnitContent.getContentList(new GetContentListParams(), 1, 1000)).list.forEach(item => {
|
|
|
|
|
+ data.push(item);
|
|
|
|
|
+ });
|
|
|
|
|
+ for (const item of data)
|
|
|
|
|
+ item.detail = (await UnitContent.getContentDetail(item.id)) as GetContentDetailItem;
|
|
|
|
|
+ generateMarkdownIch(dir, '非遗保护单位');
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ case 'inheritor': {
|
|
|
|
|
+ const dir = makeDir('inheritor');
|
|
|
|
|
+ (await InheritorContent.getContentList(new GetContentListParams(), 1, 1000)).list.forEach(item => {
|
|
|
|
|
+ data.push(item);
|
|
|
|
|
+ });
|
|
|
|
|
+ for (const item of data)
|
|
|
|
|
+ item.detail = (await InheritorContent.getContentDetail(item.id)) as GetContentDetailItem;
|
|
|
|
|
+ generateMarkdownInheritor(dir);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ case 'artifact': {
|
|
|
|
|
+ const dir = makeDir('artifact');
|
|
|
|
|
+ (await UnmoveableContent.getContentList(new GetContentListParams(), 1, 1000)).list.forEach(item => {
|
|
|
|
|
+ data.push(item);
|
|
|
|
|
+ });
|
|
|
|
|
+ for (const item of data)
|
|
|
|
|
+ item.detail = (await UnmoveableContent.getContentDetail(item.id)) as GetContentDetailItem;
|
|
|
|
|
+ generateMarkdownArtifact(dir);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ default:
|
|
|
|
|
+ console.log('不支持的类型');
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+main();
|