feat: 建立组件化模板预览基线并规划可视化编辑
This commit is contained in:
1 parent
c5af790554
commit
0b14b5a814
46 files changed
+1880
-427
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { Controller, Get, Query } from "@nestjs/common";
|
||||
import { Controller, Get, Injectable, Query } from "@nestjs/common";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { PrismaService } from "../../prisma.service.js";
|
||||
import { PublicBrandContextService } from "./public-brand-context.service.js";
|
||||
@@ -26,15 +26,11 @@ import {
|
||||
projectTrustPresentation,
|
||||
} from "@personal-brand/types";
|
||||
|
||||
@Controller("public/workspace")
|
||||
export class PublicWorkspaceController {
|
||||
constructor(
|
||||
private readonly prisma: PrismaService,
|
||||
private readonly brandContext: PublicBrandContextService,
|
||||
) {}
|
||||
@Get()
|
||||
async get(@Query("brandSlug") brandSlug?: string): Promise<unknown> {
|
||||
const brandId = await this.brandContext.resolveId(brandSlug);
|
||||
@Injectable()
|
||||
export class PublicWorkspaceService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
async getForBrandId(brandId: string): Promise<unknown> {
|
||||
const release = await this.prisma.brandRelease.findFirst({
|
||||
where: { brandId, status: "published" },
|
||||
orderBy: { version: "desc" },
|
||||
@@ -370,3 +366,17 @@ export class PublicWorkspaceController {
|
||||
return value === "create-booking" || value === "create-quote" ? value : "create-inquiry";
|
||||
}
|
||||
}
|
||||
|
||||
@Controller("public/workspace")
|
||||
export class PublicWorkspaceController {
|
||||
constructor(
|
||||
private readonly brandContext: PublicBrandContextService,
|
||||
private readonly workspaceService: PublicWorkspaceService,
|
||||
) {}
|
||||
|
||||
@Get()
|
||||
async get(@Query("brandSlug") brandSlug?: string): Promise<unknown> {
|
||||
const brandId = await this.brandContext.resolveId(brandSlug);
|
||||
return this.workspaceService.getForBrandId(brandId);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user