refactor: 模板注册与默认模板收敛到目录驱动
This commit is contained in:
1 parent
f87b26b201
commit
89fdfd7d83
25 files changed
+122
-96
No files matched your search
@@ -130,15 +130,15 @@ const personalSampleContent: TemplateSampleContent = {
|
||||
capabilityKey: "inquiry",
|
||||
};
|
||||
|
||||
export const templateSampleContent: Record<BrandTemplateKey, TemplateSampleContent> = {
|
||||
export const templateSampleContent = {
|
||||
personal: personalSampleContent,
|
||||
food: foodSampleContent,
|
||||
doors: doorsSampleContent,
|
||||
};
|
||||
} as const;
|
||||
|
||||
export function getTemplateSampleContent(templateKey: string): TemplateSampleContent | undefined {
|
||||
const packageSample = templatePackageRegistry.find((item) =>
|
||||
item.supportedIndustryTemplates.includes(templateKey as BrandTemplateKey),
|
||||
)?.sampleContent?.[templateKey as BrandTemplateKey];
|
||||
item.supportedIndustryTemplates.includes(templateKey),
|
||||
)?.sampleContent?.[templateKey];
|
||||
return packageSample ?? templateSampleContent[templateKey as keyof typeof templateSampleContent];
|
||||
}
|
||||
Reference in new issue
Block a user