智能小程序 Ray 开发菜谱 API —— 用户评分和记录 API 接口汇总

用户评分 API

用户添加评分

addRecipeScore

引入

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

import { addRecipeScore } from '@ray-js/ray'

参数

AddRecipeScoreParams params

封装了用户添加评分的参数对象。

参数属性 AddRecipeScoreParams

属性类型默认值必填说明
scoreInfoScoreInfo评分信息

函数定义示例

/**
 * 用户添加评分
 * @param {AddRecipeScoreParams} params - 用户添加评分参数
 * @returns {Promise<AddRecipeScoreResponse>} - 用户添加评分结果的 Promise 对象
 */
export const addRecipeScore: (params: AddRecipeScoreParams) => Promise<AddRecipeScoreResponse>

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

 


用户通过食谱 ID 获取评分信息

getRecipeScoreByMenuId

引入

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

import { getRecipeScoreByMenuId } from '@ray-js/ray'

参数

GetRecipeScoreByMenuIdParams params

封装了用户通过食谱 ID 获取评分信息的参数对象。

参数属性 GetRecipeScoreByMenuIdParams

属性类型默认值必填说明
menuIdnumber食谱 ID

函数定义示例

/**
 * 用户通过食谱 ID 获取评分信息
 * @param {GetRecipeScoreByMenuIdParams} params - 用户获取评分信息参数
 * @returns {Promise<GetRecipeScoreByMenuIdResponse>} - 用户获取评分信息结果的 Promise 对象
 */
export const getRecipeScoreByMenuId: (
  params: GetRecipeScoreByMenuIdParams
) => Promise<GetRecipeScoreByMenuIdResponse>


用户通过食谱 IDs 获取评分信息

getRecipeScoresByMenuIds

引入

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

import { getRecipeScoresByMenuIds } from '@ray-js/ray'

参数

GetRecipeScoresByMenuIdsParams params

封装了用户通过食谱 IDs 获取评分信息的参数对象。

参数属性 GetRecipeScoresByMenuIdsParams

属性类型默认值必填说明
queryQueryCondition查询条件

函数定义示例

/**
 * 用户通过食谱 IDs 获取评分信息
 * @param {GetRecipeScoresByMenuIdsParams} params - 用户获取评分信息参数
 * @returns {Promise<GetRecipeScoresByMenuIdsResponse>} - 用户获取评分信息结果的 Promise 对象
 */
export const getRecipeScoresByMenuIds: (
  params: GetRecipeScoresByMenuIdsParams
) => Promise<GetRecipeScoresByMenuIdsResponse>

记录 API 

获取搜索历史记录列表

getSearchHistoryList

引入

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

import { getSearchHistoryList } from '@ray-js/ray'

参数

SearchHistoryListParams params

封装了获取搜索记录列表的参数对象。

参数属性 SearchHistoryListParams

属性类型默认值必填说明
devIdstring设备 ID

函数定义示例

/**
 * 获取搜索历史记录列表
 * @param {SearchHistoryListParams} params - 搜索记录列表参数
 * @returns {Promise<SearchHistoryListResponse>} - 返回获取搜索记录列表结果的 Promise 对象
 */
export function getSearchHistoryList(
  params: SearchHistoryListParams
): Promise<SearchHistoryListResponse>


删除单条搜索历史记录

deleteSearchHistory

引入

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

import { deleteSearchHistory } from '@ray-js/ray'

参数

DeleteSearchHistoryParams params

封装了删除单条搜索历史记录的参数对象。

参数属性 DeleteSearchHistoryParams

属性类型默认值必填说明
namestring历史记录名称
devIdstring设备 ID

函数定义示例

/**
 * 删除单条搜索历史记录
 * @param {DeleteSearchHistoryParams} params - 搜索记录单条删除参数
 * @returns {Promise<DeleteSearchHistoryResponse>} - 返回删除单条搜索历史记录结果的 Promise 对象
 */
export function deleteSearchHistory(
  params: DeleteSearchHistoryParams
): Promise<DeleteSearchHistoryResponse>


清空搜索历史记录

cleanSearchHistory

引入

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

import { cleanSearchHistory } from '@ray-js/ray'

参数

CleanSearchHistoryParams params

封装了清空搜索历史记录的参数对象。

参数属性 CleanSearchHistoryParams

属性类型默认值必填说明
devIdstring设备 ID

函数定义示例

/**
 * 清空搜索历史记录
 * @param {CleanSearchHistoryParams} params - 搜索记录清空参数
 * @returns {Promise<CleanSearchHistoryResponse>} - 返回清空搜索历史记录结果的 Promise 对象
 */
export function cleanSearchHistory(
  params: CleanSearchHistoryParams
): Promise<CleanSearchHistoryResponse>

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

IoT砖家涂拉拉

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

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

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

打赏作者

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

抵扣说明:

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

余额充值