feat: 将阿成信任内容迁移为品牌数据
This commit is contained in:
1 parent
55989a5dfe
commit
774ae2c8e3
19 files changed
+142
-35
No files matched your search
@@ -12,7 +12,12 @@ import {
|
||||
getDefaultVisualTemplateKey,
|
||||
getTemplatePackageManifestForVisualKey,
|
||||
} from "@personal-brand/config";
|
||||
import type { RuntimeInquiryField, RuntimeOffering, RuntimeWorkspace } from "@personal-brand/types";
|
||||
import type {
|
||||
RuntimeInquiryField,
|
||||
RuntimeOffering,
|
||||
RuntimeTrustItem,
|
||||
RuntimeWorkspace,
|
||||
} from "@personal-brand/types";
|
||||
|
||||
@Controller("public/workspace")
|
||||
export class PublicWorkspaceController {
|
||||
@@ -39,6 +44,7 @@ export class PublicWorkspaceController {
|
||||
visualTemplate: null,
|
||||
offerings: [],
|
||||
inquiryForms: [],
|
||||
trustItems: [],
|
||||
capabilities: [],
|
||||
trustPresentation: {},
|
||||
navigation: { tabs: [] },
|
||||
@@ -246,6 +252,19 @@ export class PublicWorkspaceController {
|
||||
if (item.type === "profile" && typeof result.bio !== "string") result.bio = item.content;
|
||||
return result;
|
||||
}, {});
|
||||
const trustItems: RuntimeTrustItem[] = trustData.flatMap((raw) => {
|
||||
const item = this.jsonObject(raw);
|
||||
if (typeof item.type !== "string" || typeof item.title !== "string") return [];
|
||||
return [
|
||||
{
|
||||
type: item.type,
|
||||
title: item.title,
|
||||
summary: typeof item.summary === "string" ? item.summary : null,
|
||||
content: typeof item.content === "string" ? item.content : "",
|
||||
config: this.jsonObject(item.config),
|
||||
},
|
||||
];
|
||||
});
|
||||
const runtimeWorkspace: RuntimeWorkspace = {
|
||||
schemaVersion: "1.0.0",
|
||||
publication: {
|
||||
@@ -280,6 +299,7 @@ export class PublicWorkspaceController {
|
||||
fields: toInquiryFields(form.fieldsSnapshot as Prisma.JsonValue),
|
||||
};
|
||||
}),
|
||||
trustItems,
|
||||
trustPresentation,
|
||||
capabilities: runtimeCapabilities,
|
||||
plugins: runtimeCapabilities
|
||||
|
||||
Reference in new issue
Block a user