食谱分类列表 API
获取食谱一级分类列表功能
getRecipePrimaryCategoryList
引入
@ray-js/ray^1.5.0 以上版本可使用
import { getRecipePrimaryCategoryList } from '@ray-js/ray'
参数
GetRecipePrimaryCategoryListParams
属性 | 类型 | 说明 |
---|---|---|
productId | string | 产品 ID |
返回
GetRecipePrimaryCategoryListResponse
RecipePrimaryCategory[]
,食谱一级分类信息数组。
RecipePrimaryCategory
属性 | 类型 | 说明 |
---|---|---|
gmtCreate | number | 创建时间戳 |
gmtModified | number | 修改时间戳 |
id | number | 分类 ID |
imageUrl | string | 分类图片 |
langInfo | LangInfo[] | 多语言信息 |
name | string | 分类名称 |
LangInfo
属性 | 类型 | 说明 |
---|---|---|
lang | string | 语言 |
name | string | 名称 |
函数定义示例
/**
* 获取食谱一级分类列表
*/
export const getRecipePrimaryCategoryList: (
params: GetRecipePrimaryCategoryListParams
) => Promise<GetRecipePrimaryCategoryListResponse>
获取食谱分类列表,包括一级分类和二级分类信息
getRecipeCategoryList
引入
@ray-js/ray^1.5.0 以上版本可使用
import { getRecipeCategoryList } from '@ray-js/ray'
参数
GetRecipeCategoryListParams
属性 | 类型 | 说明 |
---|---|---|
productId | string | 产品 ID |
返回
GetRecipeCategoryListResponse
RecipeCategory[]
,食谱分类信息数组。
RecipeCategory
属性 | 类型 | 说明 |
---|---|---|
id | number | 分类 ID |
imageUrl | string | 分类图片 |
name | string | 分类名称 |
parentId | number | 上级分类 ID |
level | number | 分类层级 |
langInfo | LangInfo[] | 多语言信息 |
subMenuCategories | SubMenuCategory[] | 二级分类信息 |
gmtCreate | number | 创建时间戳 |
gmtModified | number | 修改时间戳 |
LangInfo
属性 | 类型 | 说明 |
---|---|---|
lang | string | 语言 |
name | string | 名称 |
SubMenuCategory
属性 | 类型 | 说明 |
---|---|---|
id | number | 分类 ID |
imageUrl | string | 分类图片 |
name | string | 分类名称 |
parentId | number | 上级分类 ID |
level | number | 分类层级 |
langInfo | LangInfo[] | 多语言信息 |
gmtCreate | number | 创建时间戳 |
gmtModified | number | 修改时间戳 |
LangInfo
属性 | 类型 | 说明 |
---|---|---|
lang | string | 语言 |
name | string | 名称 |
函数定义示例
/**
* 获取食谱分类列表
*/
export const getRecipeCategoryList: (
params: GetRecipeCategoryListParams
) => Promise<GetRecipeCategoryListResponse>
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。
其他 API
获取食谱所支持的所有语言信息
getAllLanguages
引入
@ray-js/ray^1.5.0 以上版本可使用
import { getAllLanguages } from '@ray-js/ray'
参数
无参数。
函数定义示例
/**
* 获取食谱所支持的所有语言信息
* @returns {Promise<GetAllLanguagesResponse>} - 返回获取所有语言信息结果的 Promise 对象
*/
export function getAllLanguages(): Promise<GetAllLanguagesResponse>
获取 C 端用户搜索模型
getSearchModel
引入
@ray-js/ray^1.5.0 以上版本可使用
import { getSearchModel } from '@ray-js/ray'
参数
GetSearchModelParams params
封装了获取搜索模型的参数对象。
参数属性 GetSearchModelParams
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
productId | string | 是 | 产品 ID |
函数定义示例
/**
* 获取 C 端用户搜索模型
* @param {GetSearchModelParams} params - 封装了获取搜索模型的参数对象
* @returns {Promise<SearchModelResponse>} - 返回获取搜索模型结果的 Promise 对象
*/
export function getSearchModel(params: GetSearchModelParams): Promise<SearchModelResponse>
获取已上线食谱的最小、最大烹饪时间
getCookingTimeCondition
引入
@ray-js/ray^1.5.0 以上版本可使用
import { getCookingTimeCondition } from '@ray-js/ray'
参数
GetCookingTimeConditionParams params
封装了获取烹饪时间筛选条件的参数对象。
参数属性 GetCookingTimeConditionParams
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
query | CookingTimeCondition | 是 | 查询条件 | |
devId | string | 是 | 设备 ID |
烹饪时间筛选条件
CookingTimeCondition
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
sourceType | number | 是 | 食谱类型 | |
name | string | 否 | 食谱名称 | |
categoryIds | number[] | 否 | 分类 IDs |
函数定义示例
/**
* 获取已上线食谱的最小、最大烹饪时间
* @param {GetCookingTimeConditionParams} params - 封装了获取烹饪时间筛选条件的参数对象
* @returns {Promise<CookingTimeConditionResponse>} - 返回获取烹饪时间筛选条件结果的 Promise 对象
*/
export function getCookingTimeCondition(
params: GetCookingTimeConditionParams
): Promise<CookingTimeConditionResponse>
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。