用户评分 API
用户添加评分
addRecipeScore
引入
@ray-js/ray^1.5.0 以上版本可使用
import { addRecipeScore } from '@ray-js/ray'
参数
AddRecipeScoreParams params
封装了用户添加评分的参数对象。
参数属性 AddRecipeScoreParams
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
scoreInfo | ScoreInfo | 是 | 评分信息 |
函数定义示例
/**
* 用户添加评分
* @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
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
menuId | number | 是 | 食谱 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
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
query | QueryCondition | 是 | 查询条件 |
函数定义示例
/**
* 用户通过食谱 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
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
devId | string | 是 | 设备 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
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
name | string | 是 | 历史记录名称 | |
devId | string | 是 | 设备 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
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
devId | string | 是 | 设备 ID |
函数定义示例
/**
* 清空搜索历史记录
* @param {CleanSearchHistoryParams} params - 搜索记录清空参数
* @returns {Promise<CleanSearchHistoryResponse>} - 返回清空搜索历史记录结果的 Promise 对象
*/
export function cleanSearchHistory(
params: CleanSearchHistoryParams
): Promise<CleanSearchHistoryResponse>
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。