@ray-js/api 1.5.4 → 1.6.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cloud/recipe/custom.d.ts +9 -0
- package/lib/cloud/recipe/menu.d.ts +26 -0
- package/lib/cloud/recipe/menu.js +29 -1
- package/package.json +5 -5
- package/lib/cloud/recipe/basket.md +0 -431
- package/lib/cloud/recipe/category-list.md +0 -132
- package/lib/cloud/recipe/custom.md +0 -265
- package/lib/cloud/recipe/menu.md +0 -276
- package/lib/cloud/recipe/query.md +0 -112
- package/lib/cloud/recipe/record.md +0 -115
- package/lib/cloud/recipe/score.md +0 -112
- package/lib/cloud/recipe/star.md +0 -196
@@ -71,6 +71,13 @@ type CookArg = {
|
|
71
71
|
dpCode: string;
|
72
72
|
dpValue: string;
|
73
73
|
};
|
74
|
+
type CustomPropertiesItem = {
|
75
|
+
bizCode: string;
|
76
|
+
name: string;
|
77
|
+
desc: string;
|
78
|
+
fileUrl: string;
|
79
|
+
bizOrder: number;
|
80
|
+
};
|
74
81
|
/**
|
75
82
|
* 自定义食谱信息
|
76
83
|
*/
|
@@ -87,6 +94,7 @@ type MenuCustomInfo = {
|
|
87
94
|
cookTime?: number;
|
88
95
|
stepInfoParams: StepInfoParam[];
|
89
96
|
cookStepParams: CookStepParam[];
|
97
|
+
customProperties?: CustomPropertiesItem[];
|
90
98
|
};
|
91
99
|
/**
|
92
100
|
* AddCustomRecipeParams - 自定义食谱添加请求参数
|
@@ -140,6 +148,7 @@ type UpdateMenuCustomInfo = {
|
|
140
148
|
cookTime?: number;
|
141
149
|
stepInfoParams: UpdateStepInfoParam[];
|
142
150
|
cookStepParams: UpdateCookStepParam[];
|
151
|
+
customProperties?: CustomPropertiesItem[];
|
143
152
|
};
|
144
153
|
/**
|
145
154
|
* UpdateCustomRecipeParams - 自定义食谱更新请求参数
|
@@ -18,9 +18,14 @@ interface RecipeListQuery {
|
|
18
18
|
pvWeight?: number;
|
19
19
|
starCountWeight?: number;
|
20
20
|
avgScoreWeight?: number;
|
21
|
+
customInfoQuery?: CustomInfoQueryItem[];
|
21
22
|
pageNo: number;
|
22
23
|
pageSize: number;
|
23
24
|
}
|
25
|
+
interface CustomInfoQueryItem {
|
26
|
+
code: string;
|
27
|
+
langValue: string;
|
28
|
+
}
|
24
29
|
/**
|
25
30
|
* RecipeInfo - 食谱信息
|
26
31
|
*/
|
@@ -120,9 +125,11 @@ interface CustomLangInfo {
|
|
120
125
|
name: string;
|
121
126
|
desc: string;
|
122
127
|
fileUrl?: string;
|
128
|
+
origFileUrl: string;
|
123
129
|
}
|
124
130
|
interface CustomInfo {
|
125
131
|
code: string;
|
132
|
+
fileUrl: string;
|
126
133
|
langInfos: CustomLangInfo[];
|
127
134
|
}
|
128
135
|
interface RecipeDetailResult {
|
@@ -162,9 +169,28 @@ interface RecipeDetailResult {
|
|
162
169
|
cookStepInfoVOList: CookStepInfoVO[];
|
163
170
|
foodInfoVOList: FoodInfoVO[];
|
164
171
|
customInfoList: CustomInfo[];
|
172
|
+
likes: number;
|
173
|
+
isLike: boolean;
|
165
174
|
gmtCreate: number;
|
166
175
|
gmtModified: number;
|
167
176
|
}
|
168
177
|
type RecipeDetailResponse = RecipeDetailResult;
|
169
178
|
export declare const getRecipeDetail: (params: RecipeDetailParams) => Promise<RecipeDetailResponse>;
|
179
|
+
type OperateRecipeLikeParams = {
|
180
|
+
like: RecipeLike;
|
181
|
+
};
|
182
|
+
type RecipeLike = {
|
183
|
+
menuId: number;
|
184
|
+
devId: string;
|
185
|
+
};
|
186
|
+
/**
|
187
|
+
* OperateRecipeLikeResponse - 食谱点赞响应参数
|
188
|
+
*/
|
189
|
+
type OperateRecipeLikeResponse = boolean;
|
190
|
+
/**
|
191
|
+
* 食谱点赞 1.5.5 新增
|
192
|
+
* @param {OperateRecipeLikeParams} params - 食谱点赞信息
|
193
|
+
* @returns {Promise<OperateRecipeLikeResponse>} - 食谱点赞响应 Promise
|
194
|
+
*/
|
195
|
+
export declare const operateRecipeLike: (params: OperateRecipeLikeParams) => Promise<OperateRecipeLikeResponse>;
|
170
196
|
export {};
|
package/lib/cloud/recipe/menu.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
-
const _excluded = ["query"]
|
3
|
+
const _excluded = ["query"],
|
4
|
+
_excluded2 = ["like"];
|
4
5
|
import { THING } from '../../constants';
|
5
6
|
import requestCloud from '../../requestCloud';
|
6
7
|
// #region 食谱列表
|
@@ -73,4 +74,31 @@ export const getRecipeDetail = params => {
|
|
73
74
|
});
|
74
75
|
};
|
75
76
|
|
77
|
+
//#endregion
|
78
|
+
|
79
|
+
// #region 食谱点赞
|
80
|
+
|
81
|
+
/**
|
82
|
+
* OperateRecipeLikeResponse - 食谱点赞响应参数
|
83
|
+
*/
|
84
|
+
|
85
|
+
/**
|
86
|
+
* 食谱点赞 1.5.5 新增
|
87
|
+
* @param {OperateRecipeLikeParams} params - 食谱点赞信息
|
88
|
+
* @returns {Promise<OperateRecipeLikeResponse>} - 食谱点赞响应 Promise
|
89
|
+
*/
|
90
|
+
export const operateRecipeLike = params => {
|
91
|
+
const {
|
92
|
+
like
|
93
|
+
} = params,
|
94
|
+
rest = _objectWithoutProperties(params, _excluded2);
|
95
|
+
return requestCloud({
|
96
|
+
api: "m.ha.recipe.operate.like",
|
97
|
+
version: '1.0',
|
98
|
+
data: _objectSpread({
|
99
|
+
likeJson: JSON.stringify(like)
|
100
|
+
}, rest)
|
101
|
+
});
|
102
|
+
};
|
103
|
+
|
76
104
|
//#endregion
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/api",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.6.0-beta.1",
|
4
4
|
"description": "Ray universal api",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -29,14 +29,14 @@
|
|
29
29
|
"watch": "ray start --type=component"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@ray-js/framework": "1.
|
33
|
-
"@ray-js/router": "1.
|
32
|
+
"@ray-js/framework": "^1.6.0-beta.1",
|
33
|
+
"@ray-js/router": "^1.6.0-beta.1",
|
34
34
|
"@ray-js/wechat": "^0.2.9",
|
35
35
|
"base64-browser": "^1.0.1",
|
36
36
|
"query-string": "^7.1.3"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
|
-
"@ray-js/cli": "1.
|
39
|
+
"@ray-js/cli": "^1.6.0-beta.1",
|
40
40
|
"art-template": "^4.13.2",
|
41
41
|
"fs-extra": "^10.1.0",
|
42
42
|
"miniprogram-api-typings": "^3.12.2",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"access": "public",
|
47
47
|
"registry": "https://registry.npmjs.org"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "39475550a6224c2622a86d1698433811d5e38651"
|
50
50
|
}
|
@@ -1,431 +0,0 @@
|
|
1
|
-
## getBasketStatus
|
2
|
-
|
3
|
-
获取菜篮子开关状态功能。
|
4
|
-
|
5
|
-
### 引入
|
6
|
-
|
7
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
8
|
-
|
9
|
-
```js
|
10
|
-
import { getBasketStatus } from '@ray-js/ray'
|
11
|
-
```
|
12
|
-
|
13
|
-
### 参数
|
14
|
-
|
15
|
-
无参数。
|
16
|
-
|
17
|
-
### 返回
|
18
|
-
|
19
|
-
**GetBasketStatusResponse**
|
20
|
-
|
21
|
-
| 属性 | 类型 | 说明 |
|
22
|
-
| ------------ | -------- | ------------------------------------- |
|
23
|
-
| appId | `number` | appId |
|
24
|
-
| basketStatus | `string` | 菜篮子状态,`true`-开启;`false`-关闭 |
|
25
|
-
|
26
|
-
### 函数定义示例
|
27
|
-
|
28
|
-
```typescript
|
29
|
-
/**
|
30
|
-
* 获取菜篮子开关状态
|
31
|
-
*/
|
32
|
-
export function getBasketStatus(): Promise<GetBasketStatusResponse>
|
33
|
-
```
|
34
|
-
|
35
|
-
## getBasketList
|
36
|
-
|
37
|
-
获取菜篮子列表。
|
38
|
-
|
39
|
-
### 引入
|
40
|
-
|
41
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
42
|
-
|
43
|
-
```js
|
44
|
-
import { getBasketList } from '@ray-js/ray'
|
45
|
-
```
|
46
|
-
|
47
|
-
### 参数
|
48
|
-
|
49
|
-
无参数。
|
50
|
-
|
51
|
-
### 返回
|
52
|
-
|
53
|
-
**GetBasketListResponse**
|
54
|
-
|
55
|
-
`BasketInfo[]`,菜篮子信息数组。
|
56
|
-
|
57
|
-
**BasketInfo**
|
58
|
-
|
59
|
-
| 属性 | 类型 | 说明 |
|
60
|
-
| ----------- | -------- | ------------------------ |
|
61
|
-
| menuId | `number` | 食谱 ID |
|
62
|
-
| name | `string` | 食谱名称 |
|
63
|
-
| tagId | `number` | 食材标签 ID |
|
64
|
-
| tagName | `string` | 食材标签名称 |
|
65
|
-
| foodId | `number` | 食材 ID |
|
66
|
-
| foodImage | `string` | 食材图片 |
|
67
|
-
| foodName | `string` | 食材名称 |
|
68
|
-
| foodDesc | `string` | 食材备注 |
|
69
|
-
| amount | `string` | 食材数量(默认单位:克) |
|
70
|
-
| secAmount | `string` | 第二单位数量 |
|
71
|
-
| secUnit | `string` | 第二单位 ID |
|
72
|
-
| secUnitCode | `string` | 第二单位 Code |
|
73
|
-
| secUnitDesc | `string` | 第二单位描述 |
|
74
|
-
| ownStatus | `number` | 持有状态 |
|
75
|
-
|
76
|
-
### 函数定义示例
|
77
|
-
|
78
|
-
```typescript
|
79
|
-
/**
|
80
|
-
* 获取菜篮子列表
|
81
|
-
*/
|
82
|
-
export function getBasketList(): Promise<GetBasketListResponse>
|
83
|
-
```
|
84
|
-
|
85
|
-
## addFoodToBasket
|
86
|
-
|
87
|
-
添加食材到菜篮子。
|
88
|
-
|
89
|
-
### 引入
|
90
|
-
|
91
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
92
|
-
|
93
|
-
```js
|
94
|
-
import { addFoodToBasket } from '@ray-js/ray'
|
95
|
-
```
|
96
|
-
|
97
|
-
### 参数
|
98
|
-
|
99
|
-
**AddFoodToBasketParams**
|
100
|
-
|
101
|
-
| 属性 | 类型 | 必填 | 说明 |
|
102
|
-
| -------- | ----------------- | ---- | ------------ |
|
103
|
-
| foodList | `FoodInfoToAdd[]` | 是 | 食材信息列表 |
|
104
|
-
|
105
|
-
**FoodInfoToAdd**
|
106
|
-
|
107
|
-
| 属性 | 类型 | 必填 | 说明 |
|
108
|
-
| --------- | -------- | ---- | ------------------------ |
|
109
|
-
| menuId | `number` | 是 | 食谱 ID |
|
110
|
-
| tagId | `number` | 否 | 食材标签 ID |
|
111
|
-
| foodId | `number` | 是 | 食材 ID |
|
112
|
-
| amount | `string` | 是 | 食材数量(默认单位:克) |
|
113
|
-
| secAmount | `string` | 否 | 第二单位数量 |
|
114
|
-
| secUnit | `string` | 否 | 第二单位 ID |
|
115
|
-
|
116
|
-
### 返回
|
117
|
-
|
118
|
-
**AddFoodToBasketResponse**
|
119
|
-
|
120
|
-
`boolean`,表示添加成功或失败。
|
121
|
-
|
122
|
-
### 函数定义示例
|
123
|
-
|
124
|
-
```typescript
|
125
|
-
/**
|
126
|
-
* 添加食材到菜篮子
|
127
|
-
*/
|
128
|
-
export function addFoodToBasket(params: AddFoodToBasketParams): Promise<AddFoodToBasketResponse>
|
129
|
-
```
|
130
|
-
|
131
|
-
## updateFoodInBasket
|
132
|
-
|
133
|
-
编辑菜篮子中的食材。
|
134
|
-
|
135
|
-
### 引入
|
136
|
-
|
137
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
138
|
-
|
139
|
-
```js
|
140
|
-
import { updateFoodInBasket } from '@ray-js/ray'
|
141
|
-
```
|
142
|
-
|
143
|
-
### 参数
|
144
|
-
|
145
|
-
**UpdateFoodInBasketParams**
|
146
|
-
|
147
|
-
| 属性 | 类型 | 必填 | 说明 |
|
148
|
-
| -------- | ------------------ | ---- | -------- |
|
149
|
-
| foodInfo | `FoodInfoToUpdate` | 是 | 食材信息 |
|
150
|
-
|
151
|
-
**FoodInfoToUpdate**
|
152
|
-
|
153
|
-
| 属性 | 类型 | 必填 | 说明 |
|
154
|
-
| ---------- | ---------- | ---- | ----------- |
|
155
|
-
| foodId | `number` | 是 | 食材 ID |
|
156
|
-
| tagId | `number` | 否 | 食材标签 ID |
|
157
|
-
| dataType | `number` | 是 | 数据维度 |
|
158
|
-
| amountType | `number` | 是 | 数量类型 |
|
159
|
-
| menuIds | `number[]` | 是 | 食谱 IDs |
|
160
|
-
| amount | `string` | 否 | 食材数量 |
|
161
|
-
| secUnit | `string` | 否 | 第二单位 ID |
|
162
|
-
|
163
|
-
### 返回
|
164
|
-
|
165
|
-
**UpdateFoodInBasketResponse**
|
166
|
-
|
167
|
-
`boolean`,表示编辑成功或失败。
|
168
|
-
|
169
|
-
### 函数定义示例
|
170
|
-
|
171
|
-
```typescript
|
172
|
-
/**
|
173
|
-
* 编辑菜篮子中的食材
|
174
|
-
*/
|
175
|
-
export function updateFoodInBasket(
|
176
|
-
params: UpdateFoodInBasketParams
|
177
|
-
): Promise<UpdateFoodInBasketResponse>
|
178
|
-
```
|
179
|
-
|
180
|
-
## deleteFoodFromBasket
|
181
|
-
|
182
|
-
删除菜篮子中的食材。
|
183
|
-
|
184
|
-
### 引入
|
185
|
-
|
186
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
187
|
-
|
188
|
-
```js
|
189
|
-
import { deleteFoodFromBasket } from '@ray-js/ray'
|
190
|
-
```
|
191
|
-
|
192
|
-
### 参数
|
193
|
-
|
194
|
-
**DeleteFoodFromBasketParams**
|
195
|
-
|
196
|
-
| 属性 | 类型 | 必填 | 说明 |
|
197
|
-
| -------- | -------------------- | ---- | ------------ |
|
198
|
-
| foodList | `FoodInfoToDelete[]` | 是 | 食材信息列表 |
|
199
|
-
|
200
|
-
**FoodInfoToDelete**
|
201
|
-
|
202
|
-
| 属性 | 类型 | 必填 | 说明 |
|
203
|
-
| --------- | -------- | ---- | ----------- |
|
204
|
-
| menuId | `number` | 是 | 食谱 ID |
|
205
|
-
| tagId | `number` | 否 | 食材标签 ID |
|
206
|
-
| foodId | `number` | 是 | 食材 ID |
|
207
|
-
| secUnit | `string` | 否 | 第二单位 ID |
|
208
|
-
| ownStatus | `number` | 是 | 持有状态 |
|
209
|
-
|
210
|
-
### 返回
|
211
|
-
|
212
|
-
**DeleteFoodFromBasketResponse**
|
213
|
-
|
214
|
-
`boolean`,表示删除成功或失败。
|
215
|
-
|
216
|
-
### 函数定义示例
|
217
|
-
|
218
|
-
```typescript
|
219
|
-
/**
|
220
|
-
* 删除菜篮子中的食材
|
221
|
-
*/
|
222
|
-
export function deleteFoodFromBasket(
|
223
|
-
params: DeleteFoodFromBasketParams
|
224
|
-
): Promise<DeleteFoodFromBasketResponse>
|
225
|
-
```
|
226
|
-
|
227
|
-
## ownFoodInBasket
|
228
|
-
|
229
|
-
将菜篮子中的食材变为已持有。
|
230
|
-
|
231
|
-
### 引入
|
232
|
-
|
233
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
234
|
-
|
235
|
-
```js
|
236
|
-
import { ownFoodInBasket } from '@ray-js/ray'
|
237
|
-
```
|
238
|
-
|
239
|
-
### 参数
|
240
|
-
|
241
|
-
**OwnFoodInBasketParams**
|
242
|
-
|
243
|
-
| 属性 | 类型 | 必填 | 说明 |
|
244
|
-
| -------- | ----------------- | ---- | ------------ |
|
245
|
-
| foodList | `FoodInfoToOwn[]` | 是 | 食材信息列表 |
|
246
|
-
|
247
|
-
**FoodInfoToOwn**
|
248
|
-
|
249
|
-
| 属性 | 类型 | 必填 | 说明 |
|
250
|
-
| ------- | -------- | ---- | ----------- |
|
251
|
-
| menuId | `number` | 是 | 食谱 ID |
|
252
|
-
| tagId | `number` | 否 | 食材标签 ID |
|
253
|
-
| foodId | `number` | 是 | 食材 ID |
|
254
|
-
| secUnit | `string` | 否 | 第二单位 ID |
|
255
|
-
|
256
|
-
### 返回
|
257
|
-
|
258
|
-
**OwnFoodInBasketResponse**
|
259
|
-
|
260
|
-
`boolean`,表示持有成功或失败。
|
261
|
-
|
262
|
-
### 函数定义示例
|
263
|
-
|
264
|
-
```typescript
|
265
|
-
/**
|
266
|
-
* 将菜篮子中的食材变为已持有
|
267
|
-
*/
|
268
|
-
export function ownFoodInBasket(params: OwnFoodInBasketParams): Promise<OwnFoodInBasketResponse>
|
269
|
-
```
|
270
|
-
|
271
|
-
## wantFoodInBasket
|
272
|
-
|
273
|
-
将菜篮子中的食材变为未持有状态。
|
274
|
-
|
275
|
-
### 引入
|
276
|
-
|
277
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
278
|
-
|
279
|
-
```js
|
280
|
-
import { wantFoodInBasket } from '@ray-js/ray'
|
281
|
-
```
|
282
|
-
|
283
|
-
**参数**
|
284
|
-
|
285
|
-
`WantFoodInBasketParams` - 菜篮子食材未持有参数对象。
|
286
|
-
|
287
|
-
| 属性 | 类型 | 必填 | 说明 |
|
288
|
-
| -------- | ------------------ | ---- | ------------ |
|
289
|
-
| foodList | `FoodInfoToWant[]` | 是 | 食材信息列表 |
|
290
|
-
|
291
|
-
**FoodInfoToWant**
|
292
|
-
|
293
|
-
未持有的食材信息。
|
294
|
-
|
295
|
-
| 属性 | 类型 | 必填 | 说明 |
|
296
|
-
| ------- | -------- | ---- | ----------------------------- |
|
297
|
-
| menuId | `number` | 是 | 食谱 ID |
|
298
|
-
| tagId | `number` | 否 | 食材标签 ID |
|
299
|
-
| foodId | `number` | 是 | 食材 ID |
|
300
|
-
| secUnit | `string` | 否 | 替换食材第二单位(元数据 ID) |
|
301
|
-
|
302
|
-
**返回**
|
303
|
-
|
304
|
-
**WantFoodInBasketResponse**
|
305
|
-
|
306
|
-
`boolean`,表示将菜篮子中的食材变为未持有结果的成功或失败。
|
307
|
-
|
308
|
-
**函数定义示例**
|
309
|
-
|
310
|
-
```typescript
|
311
|
-
/**
|
312
|
-
* 将菜篮子中的食材变为未持有
|
313
|
-
* @param params - 菜篮子食材未持有参数
|
314
|
-
* @returns 将菜篮子中的食材变为未持有结果的 Promise
|
315
|
-
*/
|
316
|
-
export function wantFoodInBasket(params: WantFoodInBasketParams): Promise<WantFoodInBasketResponse>
|
317
|
-
```
|
318
|
-
|
319
|
-
---
|
320
|
-
|
321
|
-
## cleanBasket
|
322
|
-
|
323
|
-
清空菜篮子中所有食材。
|
324
|
-
|
325
|
-
### 引入
|
326
|
-
|
327
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
328
|
-
|
329
|
-
```js
|
330
|
-
import { cleanBasket } from '@ray-js/ray'
|
331
|
-
```
|
332
|
-
|
333
|
-
**参数**
|
334
|
-
|
335
|
-
无
|
336
|
-
|
337
|
-
**返回**
|
338
|
-
|
339
|
-
**CleanBasketResponse**
|
340
|
-
|
341
|
-
`boolean`,表示清空菜篮子中所有食材结果的成功或失败。
|
342
|
-
|
343
|
-
**函数定义示例**
|
344
|
-
|
345
|
-
```typescript
|
346
|
-
/**
|
347
|
-
* 清空菜篮子中所有食材
|
348
|
-
* @returns 清空菜篮子中所有食材结果的 Promise
|
349
|
-
*/
|
350
|
-
export function cleanBasket(): Promise<boolean>
|
351
|
-
```
|
352
|
-
|
353
|
-
---
|
354
|
-
|
355
|
-
## getNutritionOfBasket
|
356
|
-
|
357
|
-
获取菜篮子中未持有状态食材的营养成分。
|
358
|
-
|
359
|
-
### 引入
|
360
|
-
|
361
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
362
|
-
|
363
|
-
```js
|
364
|
-
import { getNutritionOfBasket } from '@ray-js/ray'
|
365
|
-
```
|
366
|
-
|
367
|
-
**参数**
|
368
|
-
|
369
|
-
无
|
370
|
-
|
371
|
-
**返回**
|
372
|
-
|
373
|
-
**NutritionInfo**
|
374
|
-
|
375
|
-
营养成分信息。
|
376
|
-
|
377
|
-
| 属性 | 类型 | 说明 |
|
378
|
-
| ----- | -------- | ------------- |
|
379
|
-
| code | `string` | 营养成分 Code |
|
380
|
-
| value | `string` | 营养成分值 |
|
381
|
-
|
382
|
-
**函数定义示例**
|
383
|
-
|
384
|
-
```typescript
|
385
|
-
/**
|
386
|
-
* 获取菜篮子中未持有状态食材的营养成分
|
387
|
-
* @returns 获取菜篮子中未持有状态食材的营养成分结果的 Promise
|
388
|
-
*/
|
389
|
-
export function getNutritionOfBasket(): Promise<NutritionInfo[]>
|
390
|
-
```
|
391
|
-
|
392
|
-
---
|
393
|
-
|
394
|
-
## checkMenuExistInBasket
|
395
|
-
|
396
|
-
判断食谱中是否有添加过食材至菜篮子。
|
397
|
-
|
398
|
-
### 引入
|
399
|
-
|
400
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
401
|
-
|
402
|
-
```js
|
403
|
-
import { checkMenuExistInBasket } from '@ray-js/ray'
|
404
|
-
```
|
405
|
-
|
406
|
-
**参数**
|
407
|
-
|
408
|
-
`CheckMenuExistInBasketParams` - 食谱是否有食材添加至菜篮子参数对象。
|
409
|
-
|
410
|
-
| 属性 | 类型 | 必填 | 说明 |
|
411
|
-
| ------ | -------- | ---- | ------- |
|
412
|
-
| menuId | `number` | 是 | 食谱 ID |
|
413
|
-
|
414
|
-
**返回**
|
415
|
-
|
416
|
-
**CheckMenuExistInBasketResponse**
|
417
|
-
|
418
|
-
`boolean`,表示判断食谱中是否有添加过食材至菜篮子结果。
|
419
|
-
|
420
|
-
**函数定义示例**
|
421
|
-
|
422
|
-
```typescript
|
423
|
-
/**
|
424
|
-
* 判断食谱中是否有添加过食材至菜篮子
|
425
|
-
* @param params - 食谱是否有食材添加至菜篮子参数
|
426
|
-
* @returns 的 Promise
|
427
|
-
*/
|
428
|
-
export function checkMenuExistInBasket(
|
429
|
-
params: CheckMenuExistInBasketParams
|
430
|
-
): Promise<CheckMenuExistInBasketResponse>
|
431
|
-
```
|
@@ -1,132 +0,0 @@
|
|
1
|
-
## getRecipePrimaryCategoryList
|
2
|
-
|
3
|
-
获取食谱一级分类列表功能。
|
4
|
-
|
5
|
-
### 引入
|
6
|
-
|
7
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
8
|
-
|
9
|
-
```js
|
10
|
-
import { getRecipePrimaryCategoryList } from '@ray-js/ray'
|
11
|
-
```
|
12
|
-
|
13
|
-
### 参数
|
14
|
-
|
15
|
-
**GetRecipePrimaryCategoryListParams**
|
16
|
-
|
17
|
-
| 属性 | 类型 | 说明 |
|
18
|
-
| --------- | -------- | ------- |
|
19
|
-
| productId | `string` | 产品 ID |
|
20
|
-
|
21
|
-
### 返回
|
22
|
-
|
23
|
-
**GetRecipePrimaryCategoryListResponse**
|
24
|
-
|
25
|
-
`RecipePrimaryCategory[]`,食谱一级分类信息数组。
|
26
|
-
|
27
|
-
**RecipePrimaryCategory**
|
28
|
-
|
29
|
-
| 属性 | 类型 | 说明 |
|
30
|
-
| ----------- | ------------ | ---------- |
|
31
|
-
| gmtCreate | `number` | 创建时间戳 |
|
32
|
-
| gmtModified | `number` | 修改时间戳 |
|
33
|
-
| id | `number` | 分类 ID |
|
34
|
-
| imageUrl | `string` | 分类图片 |
|
35
|
-
| langInfo | `LangInfo[]` | 多语言信息 |
|
36
|
-
| name | `string` | 分类名称 |
|
37
|
-
|
38
|
-
**LangInfo**
|
39
|
-
|
40
|
-
| 属性 | 类型 | 说明 |
|
41
|
-
| ---- | -------- | ---- |
|
42
|
-
| lang | `string` | 语言 |
|
43
|
-
| name | `string` | 名称 |
|
44
|
-
|
45
|
-
### 函数定义示例
|
46
|
-
|
47
|
-
```typescript
|
48
|
-
/**
|
49
|
-
* 获取食谱一级分类列表
|
50
|
-
*/
|
51
|
-
export const getRecipePrimaryCategoryList: (
|
52
|
-
params: GetRecipePrimaryCategoryListParams
|
53
|
-
) => Promise<GetRecipePrimaryCategoryListResponse>
|
54
|
-
```
|
55
|
-
|
56
|
-
## getRecipeCategoryList
|
57
|
-
|
58
|
-
获取食谱分类列表,包括一级分类和二级分类信息。
|
59
|
-
|
60
|
-
### 引入
|
61
|
-
|
62
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
63
|
-
|
64
|
-
```js
|
65
|
-
import { getRecipeCategoryList } from '@ray-js/ray'
|
66
|
-
```
|
67
|
-
|
68
|
-
### 参数
|
69
|
-
|
70
|
-
**GetRecipeCategoryListParams**
|
71
|
-
|
72
|
-
| 属性 | 类型 | 说明 |
|
73
|
-
| --------- | -------- | ------- |
|
74
|
-
| productId | `string` | 产品 ID |
|
75
|
-
|
76
|
-
### 返回
|
77
|
-
|
78
|
-
**GetRecipeCategoryListResponse**
|
79
|
-
|
80
|
-
`RecipeCategory[]`,食谱分类信息数组。
|
81
|
-
|
82
|
-
**RecipeCategory**
|
83
|
-
|
84
|
-
| 属性 | 类型 | 说明 |
|
85
|
-
| ----------------- | ------------------- | ------------ |
|
86
|
-
| id | `number` | 分类 ID |
|
87
|
-
| imageUrl | `string` | 分类图片 |
|
88
|
-
| name | `string` | 分类名称 |
|
89
|
-
| parentId | `number` | 上级分类 ID |
|
90
|
-
| level | `number` | 分类层级 |
|
91
|
-
| langInfo | `LangInfo[]` | 多语言信息 |
|
92
|
-
| subMenuCategories | `SubMenuCategory[]` | 二级分类信息 |
|
93
|
-
| gmtCreate | `number` | 创建时间戳 |
|
94
|
-
| gmtModified | `number` | 修改时间戳 |
|
95
|
-
|
96
|
-
**LangInfo**
|
97
|
-
|
98
|
-
| 属性 | 类型 | 说明 |
|
99
|
-
| ---- | -------- | ---- |
|
100
|
-
| lang | `string` | 语言 |
|
101
|
-
| name | `string` | 名称 |
|
102
|
-
|
103
|
-
**SubMenuCategory**
|
104
|
-
|
105
|
-
| 属性 | 类型 | 说明 |
|
106
|
-
| ----------- | ------------ | ----------- |
|
107
|
-
| id | `number` | 分类 ID |
|
108
|
-
| imageUrl | `string` | 分类图片 |
|
109
|
-
| name | `string` | 分类名称 |
|
110
|
-
| parentId | `number` | 上级分类 ID |
|
111
|
-
| level | `number` | 分类层级 |
|
112
|
-
| langInfo | `LangInfo[]` | 多语言信息 |
|
113
|
-
| gmtCreate | `number` | 创建时间戳 |
|
114
|
-
| gmtModified | `number` | 修改时间戳 |
|
115
|
-
|
116
|
-
**LangInfo**
|
117
|
-
|
118
|
-
| 属性 | 类型 | 说明 |
|
119
|
-
| ---- | -------- | ---- |
|
120
|
-
| lang | `string` | 语言 |
|
121
|
-
| name | `string` | 名称 |
|
122
|
-
|
123
|
-
### 函数定义示例
|
124
|
-
|
125
|
-
```typescript
|
126
|
-
/**
|
127
|
-
* 获取食谱分类列表
|
128
|
-
*/
|
129
|
-
export const getRecipeCategoryList: (
|
130
|
-
params: GetRecipeCategoryListParams
|
131
|
-
) => Promise<GetRecipeCategoryListResponse>
|
132
|
-
```
|