chore: 类型同步
- 后端CMS为问题/文档添加类型字段,前端同步更改
This commit is contained in:
@ -1,3 +1,19 @@
|
|||||||
|
export interface AiPrompt {
|
||||||
|
/** @primaryKey */
|
||||||
|
id: string;
|
||||||
|
sort?: number | null;
|
||||||
|
date_created?: string | null;
|
||||||
|
user_created?: DirectusUser | string | null;
|
||||||
|
date_updated?: string | null;
|
||||||
|
user_updated?: DirectusUser | string | null;
|
||||||
|
/** @required */
|
||||||
|
name: string;
|
||||||
|
status?: 'published' | 'draft' | 'archived' | null;
|
||||||
|
description?: string | null;
|
||||||
|
system_prompt?: string | null;
|
||||||
|
messages?: Array<{ role: 'user' | 'assistant'; text: string }> | null;
|
||||||
|
}
|
||||||
|
|
||||||
export interface CompanyProfile {
|
export interface CompanyProfile {
|
||||||
/** @primaryKey */
|
/** @primaryKey */
|
||||||
id: number;
|
id: number;
|
||||||
@ -26,6 +42,20 @@ export interface ContactInfoTranslation {
|
|||||||
content?: string | null;
|
content?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface DocumentType {
|
||||||
|
/** @primaryKey */
|
||||||
|
id: number;
|
||||||
|
translations?: DocumentTypesTranslation[] | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DocumentTypesTranslation {
|
||||||
|
/** @primaryKey */
|
||||||
|
id: number;
|
||||||
|
document_types_id?: DocumentType | string | null;
|
||||||
|
languages_code?: Language | string | null;
|
||||||
|
name?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Homepage {
|
export interface Homepage {
|
||||||
/** @primaryKey */
|
/** @primaryKey */
|
||||||
id: number;
|
id: number;
|
||||||
@ -75,8 +105,9 @@ export interface ProductDocument {
|
|||||||
id: number;
|
id: number;
|
||||||
status?: 'published' | 'draft' | 'archived';
|
status?: 'published' | 'draft' | 'archived';
|
||||||
file?: DirectusFile | string | null;
|
file?: DirectusFile | string | null;
|
||||||
products?: ProductsProductDocument[] | string[];
|
type?: DocumentType | string | null;
|
||||||
translations?: ProductDocumentsTranslation[] | null;
|
translations?: ProductDocumentsTranslation[] | null;
|
||||||
|
products?: ProductsProductDocument[] | string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ProductDocumentsTranslation {
|
export interface ProductDocumentsTranslation {
|
||||||
@ -209,10 +240,25 @@ export interface ProductsTranslation {
|
|||||||
description?: string | null;
|
description?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface QuestionType {
|
||||||
|
/** @primaryKey */
|
||||||
|
id: number;
|
||||||
|
translations?: QuestionTypesTranslation[] | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface QuestionTypesTranslation {
|
||||||
|
/** @primaryKey */
|
||||||
|
id: number;
|
||||||
|
question_types_id?: QuestionType | string | null;
|
||||||
|
languages_code?: Language | string | null;
|
||||||
|
name?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Question {
|
export interface Question {
|
||||||
/** @primaryKey */
|
/** @primaryKey */
|
||||||
id: number;
|
id: number;
|
||||||
status?: 'published' | 'draft' | 'archived';
|
status?: 'published' | 'draft' | 'archived';
|
||||||
|
type?: QuestionType | string | null;
|
||||||
/** @description i18n字段 */
|
/** @description i18n字段 */
|
||||||
translations?: QuestionsTranslation[] | null;
|
translations?: QuestionsTranslation[] | null;
|
||||||
products?: ProductsQuestion[] | string[];
|
products?: ProductsQuestion[] | string[];
|
||||||
@ -741,10 +787,13 @@ export interface DirectusExtension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface Schema {
|
export interface Schema {
|
||||||
|
ai_prompts: AiPrompt[];
|
||||||
company_profile: CompanyProfile;
|
company_profile: CompanyProfile;
|
||||||
company_profile_translations: CompanyProfileTranslation[];
|
company_profile_translations: CompanyProfileTranslation[];
|
||||||
contact_info: ContactInfo;
|
contact_info: ContactInfo;
|
||||||
contact_info_translations: ContactInfoTranslation[];
|
contact_info_translations: ContactInfoTranslation[];
|
||||||
|
document_types: DocumentType[];
|
||||||
|
document_types_translations: DocumentTypesTranslation[];
|
||||||
homepage: Homepage;
|
homepage: Homepage;
|
||||||
homepage_files: HomepageFile[];
|
homepage_files: HomepageFile[];
|
||||||
languages: Language[];
|
languages: Language[];
|
||||||
@ -765,6 +814,8 @@ export interface Schema {
|
|||||||
products_product_images: ProductsProductImage[];
|
products_product_images: ProductsProductImage[];
|
||||||
products_questions: ProductsQuestion[];
|
products_questions: ProductsQuestion[];
|
||||||
products_translations: ProductsTranslation[];
|
products_translations: ProductsTranslation[];
|
||||||
|
question_types: QuestionType[];
|
||||||
|
question_types_translations: QuestionTypesTranslation[];
|
||||||
questions: Question[];
|
questions: Question[];
|
||||||
questions_translations: QuestionsTranslation[];
|
questions_translations: QuestionsTranslation[];
|
||||||
solution_types: SolutionType[];
|
solution_types: SolutionType[];
|
||||||
@ -801,10 +852,13 @@ export interface Schema {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export enum CollectionNames {
|
export enum CollectionNames {
|
||||||
|
ai_prompts = 'ai_prompts',
|
||||||
company_profile = 'company_profile',
|
company_profile = 'company_profile',
|
||||||
company_profile_translations = 'company_profile_translations',
|
company_profile_translations = 'company_profile_translations',
|
||||||
contact_info = 'contact_info',
|
contact_info = 'contact_info',
|
||||||
contact_info_translations = 'contact_info_translations',
|
contact_info_translations = 'contact_info_translations',
|
||||||
|
document_types = 'document_types',
|
||||||
|
document_types_translations = 'document_types_translations',
|
||||||
homepage = 'homepage',
|
homepage = 'homepage',
|
||||||
homepage_files = 'homepage_files',
|
homepage_files = 'homepage_files',
|
||||||
languages = 'languages',
|
languages = 'languages',
|
||||||
@ -825,6 +879,8 @@ export enum CollectionNames {
|
|||||||
products_product_images = 'products_product_images',
|
products_product_images = 'products_product_images',
|
||||||
products_questions = 'products_questions',
|
products_questions = 'products_questions',
|
||||||
products_translations = 'products_translations',
|
products_translations = 'products_translations',
|
||||||
|
question_types = 'question_types',
|
||||||
|
question_types_translations = 'question_types_translations',
|
||||||
questions = 'questions',
|
questions = 'questions',
|
||||||
questions_translations = 'questions_translations',
|
questions_translations = 'questions_translations',
|
||||||
solution_types = 'solution_types',
|
solution_types = 'solution_types',
|
||||||
|
|||||||
Reference in New Issue
Block a user