feat: 增加可替换行业模板定义接口
This commit is contained in:
1 parent
2b1035dbc8
commit
c6785892ed
5 files changed
+61
No files matched your search
@@ -41,6 +41,7 @@ import type { TransformFnParams } from "class-transformer";
|
||||
import { IsBoolean, IsEnum, IsOptional, IsString } from "class-validator";
|
||||
import { readIdentity, signIdentity } from "./auth.js";
|
||||
import { ApiExceptionFilter, RequestIdMiddleware } from "./http.js";
|
||||
import { brandTemplates, type BrandTemplateKey } from "@personal-brand/config";
|
||||
|
||||
@Controller("health")
|
||||
export class HealthController {
|
||||
@@ -109,6 +110,16 @@ export class PublicTrustContentController {
|
||||
}
|
||||
}
|
||||
|
||||
@Controller("public/templates")
|
||||
export class PublicTemplateController {
|
||||
@Get(":key")
|
||||
get(@Param("key") key: string): unknown {
|
||||
const template = brandTemplates[key as BrandTemplateKey];
|
||||
if (!template) throw new BadRequestException("行业模板不存在");
|
||||
return template;
|
||||
}
|
||||
}
|
||||
|
||||
@Controller("customer/session")
|
||||
export class CustomerSessionController {
|
||||
constructor(
|
||||
@@ -441,6 +452,7 @@ export class AdminConfigController {
|
||||
HealthController,
|
||||
PublicController,
|
||||
PublicTrustContentController,
|
||||
PublicTemplateController,
|
||||
CustomerSessionController,
|
||||
AdminSessionController,
|
||||
CustomerBookingController,
|
||||
|
||||
Reference in new issue
Block a user