@ray-js/api 1.5.5 → 1.5.7
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/device.d.ts +21 -1
- package/lib/cloud/device.js +18 -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 -285
- package/lib/cloud/recipe/menu.md +0 -288
- 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
package/lib/cloud/device.d.ts
CHANGED
@@ -84,4 +84,24 @@ export interface GetRemoteLocalRelationResponse {
|
|
84
84
|
* @returns
|
85
85
|
*/
|
86
86
|
declare const getRemoteLocalRelation: (params: GetRemoteLocalRelationParams) => Promise<GetRemoteLocalRelationResponse>;
|
87
|
-
|
87
|
+
declare enum BizType {
|
88
|
+
Device = 0,
|
89
|
+
Group = 1
|
90
|
+
}
|
91
|
+
type GetLightHighPowerParams = {
|
92
|
+
bizId: string;
|
93
|
+
bizType: BizType;
|
94
|
+
abilityCodes: string;
|
95
|
+
};
|
96
|
+
type GetLightHighPowerResponse = {
|
97
|
+
abilityCode: string;
|
98
|
+
buyableForCustomer?: boolean;
|
99
|
+
vasEnabled: boolean;
|
100
|
+
}[] | [];
|
101
|
+
/**
|
102
|
+
* 判断当前设备是否支持高级能力 @ray-js/ray^1.5.7 新增
|
103
|
+
* @param params { devId: string, type: number }
|
104
|
+
* @returns
|
105
|
+
*/
|
106
|
+
declare const getLightHighPower: (params: GetLightHighPowerParams) => Promise<GetLightHighPowerResponse>;
|
107
|
+
export { getDpsInfos, updateDpName, getGroupDpsInfos, updateGroupDpName, getWeatherQuality, getWeathers, saveCustomizePosition, getCustomizePosition, getDevProperty, saveDevProperty, getRemoteLocalRelation, getLightHighPower, };
|
package/lib/cloud/device.js
CHANGED
@@ -148,4 +148,21 @@ const getRemoteLocalRelation = params => {
|
|
148
148
|
version: '1.0'
|
149
149
|
});
|
150
150
|
};
|
151
|
-
|
151
|
+
var BizType = /*#__PURE__*/function (BizType) {
|
152
|
+
BizType[BizType["Device"] = 0] = "Device";
|
153
|
+
BizType[BizType["Group"] = 1] = "Group";
|
154
|
+
return BizType;
|
155
|
+
}(BizType || {});
|
156
|
+
/**
|
157
|
+
* 判断当前设备是否支持高级能力 @ray-js/ray^1.5.7 新增
|
158
|
+
* @param params { devId: string, type: number }
|
159
|
+
* @returns
|
160
|
+
*/
|
161
|
+
const getLightHighPower = params => {
|
162
|
+
return requestCloud({
|
163
|
+
api: "".concat(THING, ".m.light.high.power.get"),
|
164
|
+
data: params,
|
165
|
+
version: '1.2'
|
166
|
+
});
|
167
|
+
};
|
168
|
+
export { getDpsInfos, updateDpName, getGroupDpsInfos, updateGroupDpName, getWeatherQuality, getWeathers, saveCustomizePosition, getCustomizePosition, getDevProperty, saveDevProperty, getRemoteLocalRelation, getLightHighPower };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/api",
|
3
|
-
"version": "1.5.
|
3
|
+
"version": "1.5.7",
|
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.5.
|
33
|
-
"@ray-js/router": "1.5.
|
32
|
+
"@ray-js/framework": "1.5.7",
|
33
|
+
"@ray-js/router": "1.5.7",
|
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.5.
|
39
|
+
"@ray-js/cli": "1.5.7",
|
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": "47c88e9aab161b13d41234f6bfc65bb0e627426a"
|
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
|
-
```
|