58 lines
1.5 KiB
TypeScript
58 lines
1.5 KiB
TypeScript
// types/search.d.ts
|
|
/**
|
|
* 搜索相关类型定义
|
|
*/
|
|
|
|
import type { IApiResponse } from './book'
|
|
|
|
/**
|
|
* 商品信息
|
|
*/
|
|
export interface IProduct {
|
|
productId: number // 商品ID
|
|
productName: string // 商品名称
|
|
productImages: string // 商品图片
|
|
price: number // 原价
|
|
vipPrice?: number // VIP价格
|
|
activityPrice?: number // 活动价格
|
|
isVipPrice?: number // 是否有VIP价格 1-是
|
|
}
|
|
|
|
/**
|
|
* 课程目录
|
|
*/
|
|
export interface ICourseCatalogue {
|
|
title: string // 目录标题
|
|
halfFee: number // 半价
|
|
fee: number // 全价
|
|
}
|
|
|
|
/**
|
|
* 课程信息
|
|
*/
|
|
export interface ICourse {
|
|
id: number // 课程ID
|
|
title: string // 课程标题
|
|
content: string // 课程简介
|
|
squareImage: string // 课程封面
|
|
level: number // 课程级别 0-无 1-初级 2-高级
|
|
selective: number // 课程类型 0-无 1-必修 2-选修
|
|
courseCatalogueEntityList: ICourseCatalogue[] // 课程目录列表
|
|
}
|
|
|
|
/**
|
|
* 搜索请求参数
|
|
*/
|
|
export interface ISearchRequest {
|
|
keyWord: string // 搜索关键词
|
|
appName: string // 应用名称
|
|
}
|
|
|
|
/**
|
|
* 搜索响应数据
|
|
*/
|
|
export interface ISearchResponse extends IApiResponse {
|
|
shopProductList: IProduct[] // 商品列表
|
|
courseEntities: ICourse[] // 课程列表
|
|
}
|