智能小程序 Ray 开发菜谱 API ——自定义食谱 API 接口汇总

获取自定义食谱列表功能

getCustomRecipeList

引入

@ray-js/ray^1.5.0 以上版本可使用

import { getCustomRecipeList } from '@ray-js/ray';

参数

GetCustomRecipeListParams

属性类型说明
queryCustomRecipeQuery查询条件
devIdstring设备 ID

CustomRecipeQuery

属性类型说明
pageNonumber分页页号,默认为 0
pageSizenumber分页大小,默认为 10

返回

GetCustomRecipeListResponse

CustomRecipeListResult,自定义食谱列表返回结果。

CustomRecipeListResult

属性类型说明
totalCountnumber总记录条数
pageNonumber分页页号
pageSizenumber分页大小
hasNextboolean是否还有下一页
dataCustomRecipeInfo[]食谱信息数组

CustomRecipeInfo

属性类型说明
idnumber食谱 ID
mainImgsstring[]主图数组
langnumber语言
langDescstring语言信息
cookTypenumber烹饪类型
sourceTypenumber食谱类型
namestring食谱名称
gmtCreatenumber创建时间戳
gmtModifiednumber修改时间戳

函数定义示例

/**
 * 获取自定义食谱列表
 */
export const getCustomRecipeList: (
  params: GetCustomRecipeListParams
) => Promise<GetCustomRecipeListResponse>;

👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。  

自定义食谱添加功能

addCustomRecipe

引入

@ray-js/ray^1.5.0 以上版本可使用

import { addCustomRecipe } from '@ray-js/ray';

参数

AddCustomRecipeParams

属性类型说明
menuCustomMenuCustomInfo食谱信息
devIdstring设备 ID

MenuCustomInfo

属性类型可选性说明
mainImagesstring[]必须主图数组
namestring必须食谱名称
descstring可选食谱简介
productGroupIdstring必须产品组 ID
isPublishnumber可选是否公开
cookTypenumber必须烹饪类型
foodsstring可选食材
informationstring可选相关常识
xyxkstring可选相宜相克
cookTimenumber可选烹饪时间
stepInfoParamsStepInfoParam[]必须图文步骤
cookStepParamsCookStepParam[]必须烹饪步骤信息
customPropertiesCustomPropertiesItem[]可选自定义属性 @ray-js/ray^1.5.5 新增

CustomPropertiesItem

字段类型可选性描述
bizCodestring必须自定义属性 code
namestring必须自定义属性名称
descstring必须自定义属性内容
fileUrlstring必须自定义属性文件 URL
bizOrderstring必须自定义属性排序

StepInfoParam

字段类型可选性描述
stepImgstring可选步骤图片路径
descstring必须步骤描述

CookStepParam

字段类型可选性描述
stepnumber必须步骤序号
stepImgstring可选步骤详图
descstring可选步骤描述信息
finishCtrlstring必须完成执行选项
cookArgsCookArg[]必须烹饪参数数组

CookArg

字段类型可选性描述
dpCodestring必须DP Code
dpValuestring必须DP 值

返回

AddCustomRecipeResponse

boolean,添加成功与否的返回结果。

函数定义示例

/**
 * 自定义食谱添加
 */
export const addCustomRecipe: (params: AddCustomRecipeParams) => Promise<AddCustomRecipeResponse>;

自定义食谱更新功能

updateCustomRecipe

引入

@ray-js/ray^1.5.0 以上版本可使用

import { updateCustomRecipe } from '@ray-js/ray';

参数

UpdateCustomRecipeParams

属性类型说明
menuCustomUpdateMenuCustomInfo食谱信息
devIdstring设备 ID

UpdateMenuCustomInfo

属性类型可选性说明
idnumber必须食谱 ID
mainImagesstring[]必须主图数组
namestring必须食谱名称
descstring可选食谱简介
productGroupIdstring必须产品组 ID
isPublishnumber可选是否公开
cookTypenumber必须烹饪类型
foodsstring可选食材
informationstring可选相关常识
xyxkstring可选相宜相克
cookTimenumber可选烹饪时间
stepInfoParamsStepInfoParam[]必须图文步骤
cookStepParamsCookStepParam[]必须烹饪步骤信息
customPropertiesCustomPropertiesItem[]可选自定义属性 @ray-js/ray^1.5.5 新增

CustomPropertiesItem

字段类型可选性描述
bizCodestring必须自定义属性 code
namestring必须自定义属性名称
descstring必须自定义属性内容
fileUrlstring必须自定义属性文件 URL
bizOrderstring必须自定义属性排序

UpdateStepInfoParam

字段类型可选性描述
stepnumber必须步骤
stepImgstring可选步骤图片路径
descstring必须步骤描述

UpdateCookStepParam

字段类型可选性描述
stepnumber必须步骤序号
stepImgstring可选步骤详图
descstring可选步骤描述信息
finishCtrlstring必须完成执行选项
cookArgsCookArg[]必须烹饪参数数组

CookArg

字段类型可选性描述
dpCodestring必须DP Code
dpValuestring必须DP 值

返回

UpdateCustomRecipeResponse

boolean,更新成功与否的返回结果。

函数定义示例

/**
 * 自定义食谱更新
 */
export const updateCustomRecipe: (
  params: UpdateCustomRecipeParams
) => Promise<UpdateCustomRecipeResponse>;

自定义食谱删除功能

deleteCustomRecipe

引入

@ray-js/ray^1.5.0 以上版本可使用

import { deleteCustomRecipe } from '@ray-js/ray';

参数

DeleteCustomRecipeParams

属性类型说明
menuIdnumber食谱 ID

返回

DeleteCustomRecipeResponse

boolean,删除成功与否的返回结果。

函数定义示例

/**
 * 删除自定义食谱
 */
export const deleteCustomRecipe: (
  params: DeleteCustomRecipeParams
) => Promise<DeleteCustomRecipeResponse>;

👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。  

  • 71
    点赞
  • 48
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

IoT砖家涂拉拉

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值