feat: Refactor template handling and brand management

- Removed schema_json from article templates and related queries.
- Updated brand service to include website field in requests and responses.
- Simplified template wizard view by eliminating unused schema fields and related logic.
- Added tests for ark text format handling.
- Created migrations for dropping schema_json and adding website to brands.
This commit is contained in:
2026-04-02 11:38:08 +08:00
parent 7fa1809682
commit 111498a65f
25 changed files with 298 additions and 379 deletions
+2 -17
View File
@@ -86,29 +86,12 @@ export interface TemplateCard {
export type JsonPrimitive = string | number | boolean | null;
export type JsonValue = JsonPrimitive | JsonValue[] | { [key: string]: JsonValue };
export interface TemplateSchemaField {
name: string;
type: string;
label: string;
required?: boolean;
default?: JsonValue;
options?: Array<string | number | { label: string; value: string | number }>;
placeholder?: string;
help_text?: string;
}
export interface TemplateSchema {
fields?: TemplateSchemaField[];
[key: string]: JsonValue | TemplateSchemaField[] | undefined;
}
export interface TemplateListItem {
id: number;
scope: string;
origin_type: string;
template_key: string;
template_name: string;
schema_json: TemplateSchema;
prompt_visibility: string;
card_config: Record<string, JsonValue> | null;
status: string;
@@ -298,12 +281,14 @@ export interface ArticleVersion {
export interface BrandRequest {
name: string;
website?: string | null;
description?: string | null;
}
export interface Brand {
id: number;
name: string;
website: string | null;
description: string | null;
status: string;
created_at: string;