feat: directus视图与转换函数
- views: 用于前端渲染的视图模型 - mapper: 用于视图模型转换的转换函数 - utils: 相关工具函数
This commit is contained in:
38
app/models/views/ProductView.ts
Normal file
38
app/models/views/ProductView.ts
Normal file
@ -0,0 +1,38 @@
|
||||
interface ImageView {
|
||||
id: number;
|
||||
image: string;
|
||||
caption: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品视图模型
|
||||
* 用于产品详情页(/products/[slug])渲染的数据结构
|
||||
*/
|
||||
export interface ProductView {
|
||||
/** 唯一标识符 **/
|
||||
id: number;
|
||||
|
||||
/** 产品名称 **/
|
||||
name: string;
|
||||
|
||||
/** 产品简介 **/
|
||||
summary: string;
|
||||
|
||||
/** 产品类型 **/
|
||||
product_type: string;
|
||||
|
||||
/** 产品图片 **/
|
||||
images: ImageView[];
|
||||
|
||||
/** 产品详情 **/
|
||||
description: string;
|
||||
|
||||
/** 产品规格 **/
|
||||
specs: ProductSpecGroupView[];
|
||||
|
||||
/** 产品常见问题 **/
|
||||
faqs: QuestionView[];
|
||||
|
||||
/** 产品文档 **/
|
||||
documents: ProductDocumentView[];
|
||||
}
|
||||
Reference in New Issue
Block a user