获取食谱收藏列表
getRecipeCollectionList
引入
@ray-js/ray^1.5.0 以上版本可使用
import { getRecipeCollectionList } from '@ray-js/ray';
参数
GetRecipeCollectionListParams params
封装了获取食谱收藏列表的查询条件和设备 ID。
参数属性 GetRecipeCollectionListParams
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
query | GetRecipeCollectionListQuery | 是 | 查询条件 | |
devId | string | 是 | 设备 ID |
函数定义示例
/**
* 获取食谱收藏列表
* @param {GetRecipeCollectionListParams} params - 获取食谱收藏列表请求参数
* @returns {Promise<GetRecipeCollectionListResponse>} - 获取食谱收藏列表响应的 Promise 对象
*/
export const getRecipeCollectionList: (
params: GetRecipeCollectionListParams
) => Promise<GetRecipeCollectionListResponse>;
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。
添加食谱收藏
addRecipeToFavorites
引入
@ray-js/ray^1.5.0 以上版本可使用
import { addRecipeToFavorites } from '@ray-js/ray';
参数
AddRecipeToFavoritesParams params
封装了食谱 ID 和设备 ID。
参数属性 AddRecipeToFavoritesParams
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
menuId | number | 是 | 食谱 ID | |
devId | string | 是 | 设备 ID |
函数定义示例
/**
* 添加食谱收藏
* @param {AddRecipeToFavoritesParams} params - 添加食谱收藏参数
* @returns {Promise<AddRecipeToFavoritesResponse>} - 添加食谱收藏结果的 Promise 对象
*/
export const addRecipeToFavorites: (
params: AddRecipeToFavoritesParams
) => Promise<AddRecipeToFavoritesResponse>;
取消食谱收藏
removeRecipeFromFavorites
引入
@ray-js/ray^1.5.0 以上版本可使用
import { removeRecipeFromFavorites } from '@ray-js/ray';
参数
RemoveRecipeFromFavoritesParams params
封装了食谱 ID 和设备 ID。
参数属性 RemoveRecipeFromFavoritesParams
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
menuId | number | 是 | 食谱 ID | |
devId | string | 是 | 设备 ID |
函数定义示例
/**
* 取消食谱收藏
* @param {RemoveRecipeFromFavoritesParams} params - 取消食谱收藏参数
* @returns {Promise<RemoveRecipeFromFavoritesResponse>} - 取消食谱收藏结果的 Promise 对象
*/
export const removeRecipeFromFavorites: (
params: RemoveRecipeFromFavoritesParams
) => Promise<RemoveRecipeFromFavoritesResponse>;
查询食谱是否收藏
checkRecipeIsStarred
引入
@ray-js/ray^1.5.0 以上版本可使用
import { checkRecipeIsStarred } from '@ray-js/ray';
参数
CheckRecipeIsStarredParams params
封装了食谱 ID 和设备 ID。
参数属性 CheckRecipeIsStarredParams
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
menuId | number | 是 | 食谱 ID | |
devId | string | 是 | 设备 ID |
函数定义示例
/**
* 查询食谱是否收藏
* @param {CheckRecipeIsStarredParams} params - 查询食谱是否收藏参数
* @returns {Promise<CheckRecipeIsStarredResponse>} - 查询食谱是否收藏结果的 Promise 对象
*/
export const checkRecipeIsStarred: (
params: CheckRecipeIsStarredParams
) => Promise<CheckRecipeIsStarredResponse>;
查询用户已收藏的食谱数量
getRecipeStarCount
引入
@ray-js/ray^1.5.0 以上版本可使用
import { getRecipeStarCount } from '@ray-js/ray';
参数
GetRecipeStarCountParams params
封装了设备 ID。
参数属性 GetRecipeStarCountParams
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
devId | string | 是 | 设备 ID |
函数定义示例
/**
* 查询用户已收藏的食谱数量
* @param {GetRecipeStarCountParams} params - 查询食谱收藏数量参数
* @returns {Promise<GetRecipeStarCountResponse>} - 查询食谱收藏数量结果的 Promise 对象
*/
export const getRecipeStarCount: (
params: GetRecipeStarCountParams
) => Promise<GetRecipeStarCountResponse>;
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。