@ray-js/api 1.5.0-beta.12 → 1.5.0
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/@types/BaseKit.d.ts +246 -126
- package/@types/BizKit.d.ts +1 -1
- package/@types/MapKit.d.ts +237 -1
- package/@types/MiniKit.d.ts +1 -1
- package/@types/OutdoorKit.d.ts +232 -0
- package/@types/P2PKit.d.ts +24 -2
- package/@types/all-kits.d.ts +1 -0
- package/@types/api-extend.d.ts +8 -2
- package/@types/index.d.ts +87 -0
- package/lib/{BaseKit-3.3.10.d.ts → BaseKit-3.11.0.d.ts} +1 -0
- package/lib/{BaseKit-3.3.10.js → BaseKit-3.11.0.js} +6 -2
- package/lib/BizKit-3.2.7.js +2 -1
- package/lib/DeviceKit-3.3.1.js +2 -1
- package/lib/HomeKit-3.1.4.js +2 -1
- package/lib/{MapKit-3.0.7.d.ts → MapKit-3.4.13.d.ts} +5 -0
- package/lib/{MapKit-3.0.7.js → MapKit-3.4.13.js} +19 -1
- package/lib/MiniKit-3.1.0.js +3 -2
- package/lib/OutdoorKit-1.0.4.d.ts +14 -0
- package/lib/OutdoorKit-1.0.4.js +39 -0
- package/lib/P2PKit-2.0.3.d.ts +1 -0
- package/lib/P2PKit-2.0.3.js +5 -1
- package/lib/PlayNetKit-1.1.3.d.ts +24 -25
- package/lib/PlayNetKit-1.1.3.js +2 -1
- package/lib/all-kits.d.ts +3 -2
- package/lib/all-kits.js +3 -2
- package/lib/cloud/alarm.js +2 -2
- package/lib/cloud/core.js +1 -1
- package/lib/cloud/device.d.ts +25 -1
- package/lib/cloud/device.js +20 -6
- package/lib/cloud/doorlock/README.md +62 -0
- package/lib/cloud/doorlock/auth.d.ts +235 -0
- package/lib/cloud/doorlock/auth.js +223 -0
- package/lib/cloud/doorlock/auth.md +323 -0
- package/lib/cloud/doorlock/device.d.ts +137 -0
- package/lib/cloud/doorlock/device.js +187 -0
- package/lib/cloud/doorlock/device.md +265 -0
- package/lib/cloud/doorlock/index.d.ts +10 -0
- package/lib/cloud/doorlock/index.js +20 -0
- package/lib/cloud/doorlock/log.d.ts +113 -0
- package/lib/cloud/doorlock/log.js +53 -0
- package/lib/cloud/doorlock/log.md +153 -0
- package/lib/cloud/doorlock/member-opmode.d.ts +121 -0
- package/lib/cloud/doorlock/member-opmode.js +104 -0
- package/lib/cloud/doorlock/member-opmode.md +279 -0
- package/lib/cloud/doorlock/member.d.ts +110 -0
- package/lib/cloud/doorlock/member.js +72 -0
- package/lib/cloud/doorlock/member.md +276 -0
- package/lib/cloud/doorlock/offline-pwd.d.ts +61 -0
- package/lib/cloud/doorlock/offline-pwd.js +67 -0
- package/lib/cloud/doorlock/offline-pwd.md +155 -0
- package/lib/cloud/doorlock/old.d.ts +36 -0
- package/lib/cloud/doorlock/old.js +102 -0
- package/lib/cloud/doorlock/temp-pwd.d.ts +194 -0
- package/lib/cloud/doorlock/temp-pwd.js +193 -0
- package/lib/cloud/doorlock/temp-pwd.md +362 -0
- package/lib/cloud/doorlock/unlock-method.d.ts +62 -0
- package/lib/cloud/doorlock/unlock-method.js +85 -0
- package/lib/cloud/doorlock/unlock-method.md +121 -0
- package/lib/cloud/doorlock/unlock.d.ts +89 -0
- package/lib/cloud/doorlock/unlock.js +76 -0
- package/lib/cloud/doorlock/unlock.md +222 -0
- package/lib/cloud/index.d.ts +4 -0
- package/lib/cloud/index.js +10 -1
- package/lib/cloud/interface.d.ts +39 -2
- package/lib/cloud/linkage.d.ts +8 -5
- package/lib/cloud/linkage.js +38 -17
- package/lib/cloud/outdoor.d.ts +15 -0
- package/lib/cloud/outdoor.js +25 -0
- package/lib/cloud/recipe/README.md +36 -0
- package/lib/cloud/recipe/basket.d.ts +220 -0
- package/lib/cloud/recipe/basket.js +328 -0
- package/lib/cloud/recipe/basket.md +431 -0
- package/lib/cloud/recipe/category-list.d.ts +71 -0
- package/lib/cloud/recipe/category-list.js +65 -0
- package/lib/cloud/recipe/category-list.md +132 -0
- package/lib/cloud/recipe/custom.d.ts +177 -0
- package/lib/cloud/recipe/custom.js +171 -0
- package/lib/cloud/recipe/custom.md +265 -0
- package/lib/cloud/recipe/index.d.ts +8 -0
- package/lib/cloud/recipe/index.js +8 -0
- package/lib/cloud/recipe/menu.d.ts +170 -0
- package/lib/cloud/recipe/menu.js +76 -0
- package/lib/cloud/recipe/menu.md +276 -0
- package/lib/cloud/recipe/query.d.ts +87 -0
- package/lib/cloud/recipe/query.js +101 -0
- package/lib/cloud/recipe/query.md +112 -0
- package/lib/cloud/recipe/record.d.ts +54 -0
- package/lib/cloud/recipe/record.js +87 -0
- package/lib/cloud/recipe/record.md +115 -0
- package/lib/cloud/recipe/score.d.ts +69 -0
- package/lib/cloud/recipe/score.js +106 -0
- package/lib/cloud/recipe/score.md +112 -0
- package/lib/cloud/recipe/star.d.ts +131 -0
- package/lib/cloud/recipe/star.js +151 -0
- package/lib/cloud/recipe/star.md +196 -0
- package/lib/cloud/recipe/types.d.ts +7 -0
- package/lib/cloud/recipe/types.js +0 -0
- package/lib/cloud/remoteGroup.d.ts +10 -0
- package/lib/cloud/remoteGroup.js +31 -0
- package/lib/cloud/statistic.js +9 -9
- package/lib/cloud/timer.js +14 -14
- package/lib/constants.js +1 -1
- package/lib/errorCode.d.ts +4 -0
- package/lib/errorCode.js +3 -0
- package/lib/getCdnUrl/index.d.ts +2 -2
- package/lib/getCdnUrl/index.js +1 -2
- package/lib/getCdnUrl/index.wechat.d.ts +2 -2
- package/lib/getCdnUrl/index.wechat.js +1 -2
- package/lib/getElementById/index.thing.js +1 -1
- package/lib/getElementById/index.wechat.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/nativeRouters/common.d.ts +15 -0
- package/lib/nativeRouters/common.js +38 -0
- package/lib/nativeRouters/device.d.ts +59 -0
- package/lib/nativeRouters/device.js +69 -0
- package/lib/nativeRouters/gw.d.ts +23 -0
- package/lib/nativeRouters/gw.js +27 -0
- package/lib/nativeRouters/index.d.ts +6 -1
- package/lib/nativeRouters/index.js +6 -1
- package/lib/nativeRouters/ipc.d.ts +30 -0
- package/lib/nativeRouters/ipc.js +44 -0
- package/lib/nativeRouters/outdoors.d.ts +47 -0
- package/lib/nativeRouters/outdoors.js +41 -0
- package/lib/nativeRouters/remoteGroup.d.ts +22 -0
- package/lib/nativeRouters/remoteGroup.js +11 -0
- package/lib/nativeRouters/root.d.ts +41 -0
- package/lib/nativeRouters/root.js +53 -0
- package/lib/openGroupCreate/index.js +3 -3
- package/lib/panel/i18n/index.d.ts +7 -6
- package/lib/panel/i18n/index.js +39 -23
- package/lib/panel/i18n/index.wechat.js +13 -12
- package/lib/panel/normalizeNetwork.js +1 -1
- package/lib/panel/publishDps.js +1 -1
- package/lib/redirectTo/index.js +1 -0
- package/lib/utils.d.ts +5 -2
- package/lib/utils.js +46 -20
- package/lib/utils.wechat.d.ts +3 -0
- package/lib/utils.wechat.js +22 -6
- package/lib/viewAPI.d.ts +1 -0
- package/lib/viewAPI.js +4 -3
- package/package.json +8 -7
- package/@types/PlayNetKit.d.ts +0 -444
- package/lib/nativeRouters/scene.d.ts +0 -34
- package/lib/nativeRouters/scene.js +0 -60
@@ -0,0 +1,170 @@
|
|
1
|
+
type GetRecipeListParams = {
|
2
|
+
query: RecipeListQuery;
|
3
|
+
};
|
4
|
+
/**
|
5
|
+
* RecipeListQuery - 食谱列表查询条件
|
6
|
+
*/
|
7
|
+
interface RecipeListQuery {
|
8
|
+
productId: string;
|
9
|
+
name?: string;
|
10
|
+
categoryIds?: number[];
|
11
|
+
cookTimeMin?: number;
|
12
|
+
cookTimeMax?: number;
|
13
|
+
easyLevelIds?: number[];
|
14
|
+
foodTypeIds?: number[];
|
15
|
+
allergenIds?: number[];
|
16
|
+
isFoodChannel?: number;
|
17
|
+
orderType?: number;
|
18
|
+
pvWeight?: number;
|
19
|
+
starCountWeight?: number;
|
20
|
+
avgScoreWeight?: number;
|
21
|
+
pageNo: number;
|
22
|
+
pageSize: number;
|
23
|
+
}
|
24
|
+
/**
|
25
|
+
* RecipeInfo - 食谱信息
|
26
|
+
*/
|
27
|
+
interface RecipeInfo {
|
28
|
+
id: number;
|
29
|
+
mainImgs: string[];
|
30
|
+
lang: number;
|
31
|
+
langDesc: string;
|
32
|
+
desc: string;
|
33
|
+
cookType: number;
|
34
|
+
sourceType: number;
|
35
|
+
isMainShow: number;
|
36
|
+
isShowControl: number;
|
37
|
+
isControl: number;
|
38
|
+
name: string;
|
39
|
+
easyLevel: string;
|
40
|
+
easyLevelDesc: string;
|
41
|
+
taste: string;
|
42
|
+
tasteDesc: string;
|
43
|
+
foodType: string;
|
44
|
+
foodTypeDesc: string;
|
45
|
+
cookTime: number;
|
46
|
+
eatCount: number;
|
47
|
+
avgScore: number;
|
48
|
+
isStar: boolean;
|
49
|
+
gmtCreate: number;
|
50
|
+
gmtModified: number;
|
51
|
+
}
|
52
|
+
/**
|
53
|
+
* RecipeListResult - 食谱列表返回结果
|
54
|
+
*/
|
55
|
+
interface RecipeListResult {
|
56
|
+
totalCount: number;
|
57
|
+
pageNo: number;
|
58
|
+
pageSize: number;
|
59
|
+
hasNext: boolean;
|
60
|
+
data: RecipeInfo[];
|
61
|
+
}
|
62
|
+
/**
|
63
|
+
* RecipeListResponse - 食谱列表响应参数
|
64
|
+
*/
|
65
|
+
type RecipeListResponse = RecipeListResult;
|
66
|
+
/**
|
67
|
+
* 获取食谱列表
|
68
|
+
* @param {RecipeListQuery} query - 食谱列表查询条件
|
69
|
+
* @returns {Promise<RecipeListResponse>} - 食谱列表响应的 Promise
|
70
|
+
*/
|
71
|
+
export declare const getRecipeList: (params: GetRecipeListParams) => Promise<RecipeListResponse>;
|
72
|
+
interface RecipeDetailParams {
|
73
|
+
menuId: number;
|
74
|
+
devId: string;
|
75
|
+
}
|
76
|
+
interface AllergenInfo {
|
77
|
+
id: number;
|
78
|
+
name: string;
|
79
|
+
}
|
80
|
+
interface LangInfo {
|
81
|
+
lang: string;
|
82
|
+
stepImg?: string;
|
83
|
+
origStepImg?: string;
|
84
|
+
desc: string;
|
85
|
+
}
|
86
|
+
interface MenuStepInfoVO {
|
87
|
+
id: number;
|
88
|
+
menuId: number;
|
89
|
+
step: number;
|
90
|
+
langInfos: LangInfo[];
|
91
|
+
gmtCreate: number;
|
92
|
+
gmtModified: number;
|
93
|
+
}
|
94
|
+
interface CookStepInfoVO {
|
95
|
+
id: number;
|
96
|
+
menuId: number;
|
97
|
+
isCookArgs: number;
|
98
|
+
step: number;
|
99
|
+
stepImg?: string;
|
100
|
+
origStepImg?: string;
|
101
|
+
finishCtrl?: string;
|
102
|
+
cookArgs?: any[];
|
103
|
+
langInfos: LangInfo[];
|
104
|
+
gmtCreate: number;
|
105
|
+
gmtModified: number;
|
106
|
+
}
|
107
|
+
interface FoodInfoVO {
|
108
|
+
id: number;
|
109
|
+
name: string;
|
110
|
+
lang: string;
|
111
|
+
image: string;
|
112
|
+
desc: string;
|
113
|
+
menuFoodRelationVO: any;
|
114
|
+
foodNutritionVOList: any[];
|
115
|
+
gmtCreate: number;
|
116
|
+
gmtModified: number;
|
117
|
+
}
|
118
|
+
interface CustomLangInfo {
|
119
|
+
lang: string;
|
120
|
+
name: string;
|
121
|
+
desc: string;
|
122
|
+
fileUrl?: string;
|
123
|
+
}
|
124
|
+
interface CustomInfo {
|
125
|
+
code: string;
|
126
|
+
langInfos: CustomLangInfo[];
|
127
|
+
}
|
128
|
+
interface RecipeDetailResult {
|
129
|
+
id: number;
|
130
|
+
name: string;
|
131
|
+
desc: string;
|
132
|
+
information: string;
|
133
|
+
xyxk: string;
|
134
|
+
foods?: string;
|
135
|
+
mainImgs: string[];
|
136
|
+
origMainImgs?: string[];
|
137
|
+
lang: number;
|
138
|
+
langDesc: string;
|
139
|
+
preVideo?: string;
|
140
|
+
stepVideo?: string;
|
141
|
+
isMainShow: number;
|
142
|
+
isControl: number;
|
143
|
+
isShowControl: number;
|
144
|
+
sourceType: number;
|
145
|
+
cookType: number;
|
146
|
+
extInfo?: string;
|
147
|
+
cookTime: number;
|
148
|
+
useFoodLib: number;
|
149
|
+
eatCount: number;
|
150
|
+
isFoodChannel: number;
|
151
|
+
easyLevel: string;
|
152
|
+
easyLevelDesc: string;
|
153
|
+
taste: string;
|
154
|
+
tasteDesc: string;
|
155
|
+
foodType: string;
|
156
|
+
foodTypeDesc: string;
|
157
|
+
allergens: AllergenInfo[];
|
158
|
+
author: string;
|
159
|
+
pv: number;
|
160
|
+
avgScore: number;
|
161
|
+
menuStepInfoVOList: MenuStepInfoVO[];
|
162
|
+
cookStepInfoVOList: CookStepInfoVO[];
|
163
|
+
foodInfoVOList: FoodInfoVO[];
|
164
|
+
customInfoList: CustomInfo[];
|
165
|
+
gmtCreate: number;
|
166
|
+
gmtModified: number;
|
167
|
+
}
|
168
|
+
type RecipeDetailResponse = RecipeDetailResult;
|
169
|
+
export declare const getRecipeDetail: (params: RecipeDetailParams) => Promise<RecipeDetailResponse>;
|
170
|
+
export {};
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
+
const _excluded = ["query"];
|
4
|
+
import { THING } from '../../constants';
|
5
|
+
import requestCloud from '../../requestCloud';
|
6
|
+
// #region 食谱列表
|
7
|
+
|
8
|
+
/**
|
9
|
+
* RecipeListQuery - 食谱列表查询条件
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* RecipeInfo - 食谱信息
|
14
|
+
*/
|
15
|
+
|
16
|
+
/**
|
17
|
+
* RecipeListResult - 食谱列表返回结果
|
18
|
+
*/
|
19
|
+
|
20
|
+
/**
|
21
|
+
* RecipeListResponse - 食谱列表响应参数
|
22
|
+
*/
|
23
|
+
|
24
|
+
/**
|
25
|
+
* 获取食谱列表
|
26
|
+
* @param {RecipeListQuery} query - 食谱列表查询条件
|
27
|
+
* @returns {Promise<RecipeListResponse>} - 食谱列表响应的 Promise
|
28
|
+
*/
|
29
|
+
export const getRecipeList = params => {
|
30
|
+
const {
|
31
|
+
query
|
32
|
+
} = params,
|
33
|
+
rest = _objectWithoutProperties(params, _excluded);
|
34
|
+
return requestCloud({
|
35
|
+
api: "".concat(THING, ".m.menu.lang.list"),
|
36
|
+
version: '2.0',
|
37
|
+
data: _objectSpread({
|
38
|
+
queryJson: JSON.stringify(query)
|
39
|
+
}, rest)
|
40
|
+
});
|
41
|
+
};
|
42
|
+
|
43
|
+
//#endregion
|
44
|
+
|
45
|
+
// #region 获取食谱详情的函数
|
46
|
+
// 请求参数接口
|
47
|
+
|
48
|
+
// 过敏原信息接口
|
49
|
+
|
50
|
+
// 多语言信息接口
|
51
|
+
|
52
|
+
// 图文步骤接口
|
53
|
+
|
54
|
+
// 烹饪步骤接口
|
55
|
+
|
56
|
+
// 食材信息接口
|
57
|
+
|
58
|
+
// 自定义属性多语言信息接口
|
59
|
+
|
60
|
+
// 自定义属性接口
|
61
|
+
|
62
|
+
// 食谱详情响应结果中的 result 接口
|
63
|
+
|
64
|
+
// 食谱详情响应接口
|
65
|
+
|
66
|
+
// 获取食谱详情的函数
|
67
|
+
export const getRecipeDetail = params => {
|
68
|
+
return requestCloud({
|
69
|
+
api: "".concat(THING, ".m.menu.get"),
|
70
|
+
version: '1.0',
|
71
|
+
// 假设使用 GET 方法
|
72
|
+
data: params
|
73
|
+
});
|
74
|
+
};
|
75
|
+
|
76
|
+
//#endregion
|
@@ -0,0 +1,276 @@
|
|
1
|
+
## getRecipeList
|
2
|
+
|
3
|
+
获取食谱列表
|
4
|
+
|
5
|
+
### 引入
|
6
|
+
|
7
|
+
> @ray-js/ray^1.5.0 以上版本可使用
|
8
|
+
|
9
|
+
```js
|
10
|
+
import { getRecipeList } from '@ray-js/ray'
|
11
|
+
```
|
12
|
+
|
13
|
+
**参数**
|
14
|
+
|
15
|
+
`GetRecipeListParams` 对象,包含以下属性:
|
16
|
+
|
17
|
+
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|
18
|
+
| ----- | ----------------- | ------ | ---- | ---------------- |
|
19
|
+
| query | `RecipeListQuery` | | 是 | 食谱列表查询条件 |
|
20
|
+
|
21
|
+
`RecipeListQuery` 包含以下属性:
|
22
|
+
|
23
|
+
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|
24
|
+
| --------------- | ---------- | ------ | ---- | ---------------- |
|
25
|
+
| productId | `string` | | 是 | 产品 ID |
|
26
|
+
| name | `string` | | 否 | 食谱名称 |
|
27
|
+
| categoryIds | `number[]` | | 否 | 分类 ID 数组 |
|
28
|
+
| cookTimeMin | `number` | | 否 | 最小烹饪时间 |
|
29
|
+
| cookTimeMax | `number` | | 否 | 最大烹饪时间 |
|
30
|
+
| easyLevelIds | `number[]` | | 否 | 难易等级 ID 数组 |
|
31
|
+
| foodTypeIds | `number[]` | | 否 | 食品类型 ID 数组 |
|
32
|
+
| allergenIds | `number[]` | | 否 | 过敏原 ID 数组 |
|
33
|
+
| isFoodChannel | `number` | | 否 | 是否为食品频道 |
|
34
|
+
| orderType | `number` | | 否 | 排序类型 |
|
35
|
+
| pvWeight | `number` | | 否 | 浏览量权重 |
|
36
|
+
| starCountWeight | `number` | | 否 | 收藏数权重 |
|
37
|
+
| avgScoreWeight | `number` | | 否 | 平均评分权重 |
|
38
|
+
| pageNo | `number` | | 是 | 页码 |
|
39
|
+
| pageSize | `number` | | 是 | 每页显示数量 |
|
40
|
+
|
41
|
+
**返回结果 RecipeListResponse**
|
42
|
+
|
43
|
+
| 属性 | 类型 | 说明 |
|
44
|
+
| ---------- | -------------- | ------------ |
|
45
|
+
| totalCount | `number` | 总记录数 |
|
46
|
+
| pageNo | `number` | 当前页码 |
|
47
|
+
| pageSize | `number` | 每页记录数 |
|
48
|
+
| hasNext | `boolean` | 是否有下一页 |
|
49
|
+
| data | `RecipeInfo[]` | 食谱信息数组 |
|
50
|
+
|
51
|
+
**RecipeInfo**
|
52
|
+
|
53
|
+
| 属性 | 类型 | 说明 |
|
54
|
+
| ------------- | ---------- | ------------ |
|
55
|
+
| id | `number` | 食谱 ID |
|
56
|
+
| mainImgs | `string[]` | 主图数组 |
|
57
|
+
| lang | `number` | 语言类型 |
|
58
|
+
| langDesc | `string` | 语言描述 |
|
59
|
+
| desc | `string` | 描述 |
|
60
|
+
| cookType | `number` | 烹饪方式 |
|
61
|
+
| sourceType | `number` | 来源类型 |
|
62
|
+
| isMainShow | `number` | 是否主显示 |
|
63
|
+
| isShowControl | `number` | 是否显示控制 |
|
64
|
+
| isControl | `number` | 是否受控 |
|
65
|
+
| name | `string` | 名称 |
|
66
|
+
| easyLevel | `string` | 难易等级 |
|
67
|
+
| easyLevelDesc | `string` | 难易等级描述 |
|
68
|
+
| taste | `string` | 口味 |
|
69
|
+
| tasteDesc | `string` | 口味描述 |
|
70
|
+
| foodType | `string` | 食品类型 |
|
71
|
+
| foodTypeDesc | `string` | 食品类型描述 |
|
72
|
+
| cookTime | `number` | 烹饪时间 |
|
73
|
+
| eatCount | `number` | 用餐人数 |
|
74
|
+
| avgScore | `number` | 平均评分 |
|
75
|
+
| isStar | `boolean` | 是否加星 |
|
76
|
+
| gmtCreate | `number` | 创建时间 |
|
77
|
+
| gmtModified | `number` | 修改时间 |
|
78
|
+
|
79
|
+
**函数定义示例**
|
80
|
+
|
81
|
+
```typescript
|
82
|
+
/**
|
83
|
+
* 获取食谱列表
|
84
|
+
* @param {GetRecipeListParams} params - 包含查询条件的对象
|
85
|
+
* @returns {Promise<RecipeListResponse>} - 返回食谱列表响应的 Promise
|
86
|
+
*/
|
87
|
+
export function getRecipeList(params: GetRecipeListParams): Promise<RecipeListResponse>
|
88
|
+
```
|
89
|
+
|
90
|
+
## getRecipeDetail
|
91
|
+
|
92
|
+
获取食谱详情
|
93
|
+
|
94
|
+
### 引入
|
95
|
+
|
96
|
+
> @ray-js/ray^1.5.0 以上版本可使用
|
97
|
+
|
98
|
+
```js
|
99
|
+
import { getRecipeDetail } from '@ray-js/ray'
|
100
|
+
```
|
101
|
+
|
102
|
+
**参数**
|
103
|
+
|
104
|
+
`RecipeDetailParams` 对象,包含以下属性:
|
105
|
+
|
106
|
+
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|
107
|
+
| ------ | -------- | ------ | ---- | ------- |
|
108
|
+
| menuId | `number` | | 是 | 食谱 ID |
|
109
|
+
| devId | `string` | | 是 | 设备 ID |
|
110
|
+
|
111
|
+
### `getRecipeList` 返回结果
|
112
|
+
|
113
|
+
`RecipeListResponse` 对象,包含以下属性:
|
114
|
+
|
115
|
+
| 属性 | 类型 | 说明 |
|
116
|
+
| ---------- | -------------- | ------------ |
|
117
|
+
| totalCount | `number` | 总记录数 |
|
118
|
+
| pageNo | `number` | 当前页码 |
|
119
|
+
| pageSize | `number` | 每页记录数 |
|
120
|
+
| hasNext | `boolean` | 是否有下一页 |
|
121
|
+
| data | `RecipeInfo[]` | 食谱信息数组 |
|
122
|
+
|
123
|
+
`RecipeInfo` 对象,包含以下属性:
|
124
|
+
|
125
|
+
| 属性 | 类型 | 说明 |
|
126
|
+
| ------------- | ---------- | ------------ |
|
127
|
+
| id | `number` | 食谱 ID |
|
128
|
+
| mainImgs | `string[]` | 主图数组 |
|
129
|
+
| lang | `number` | 语言类型 |
|
130
|
+
| langDesc | `string` | 语言描述 |
|
131
|
+
| desc | `string` | 描述 |
|
132
|
+
| cookType | `number` | 烹饪方式 |
|
133
|
+
| sourceType | `number` | 来源类型 |
|
134
|
+
| isMainShow | `number` | 是否主显示 |
|
135
|
+
| isShowControl | `number` | 是否显示控制 |
|
136
|
+
| isControl | `number` | 是否受控 |
|
137
|
+
| name | `string` | 名称 |
|
138
|
+
| easyLevel | `string` | 难易等级 |
|
139
|
+
| easyLevelDesc | `string` | 难易等级描述 |
|
140
|
+
| taste | `string` | 口味 |
|
141
|
+
| tasteDesc | `string` | 口味描述 |
|
142
|
+
| foodType | `string` | 食品类型 |
|
143
|
+
| foodTypeDesc | `string` | 食品类型描述 |
|
144
|
+
| cookTime | `number` | 烹饪时间 |
|
145
|
+
| eatCount | `number` | 用餐人数 |
|
146
|
+
| avgScore | `number` | 平均评分 |
|
147
|
+
| isStar | `boolean` | 是否加星 |
|
148
|
+
| gmtCreate | `number` | 创建时间 |
|
149
|
+
| gmtModified | `number` | 修改时间 |
|
150
|
+
|
151
|
+
**返回结果 RecipeDetailResponse**
|
152
|
+
|
153
|
+
| 属性 | 类型 | 说明 |
|
154
|
+
| ------------------ | ------------------ | ------------------ |
|
155
|
+
| id | `number` | 食谱 ID |
|
156
|
+
| name | `string` | 名称 |
|
157
|
+
| desc | `string` | 描述 |
|
158
|
+
| information | `string` | 信息 |
|
159
|
+
| xyxk | `string` | 食谱相关信息 |
|
160
|
+
| foods | `string` | 食材 |
|
161
|
+
| mainImgs | `string[]` | 主图数组 |
|
162
|
+
| origMainImgs | `string[]` | 原始主图数组 |
|
163
|
+
| lang | `number` | 语言类型 |
|
164
|
+
| langDesc | `string` | 语言描述 |
|
165
|
+
| preVideo | `string` | 准备视频 |
|
166
|
+
| stepVideo | `string` | 步骤视频 |
|
167
|
+
| isMainShow | `number` | 是否主显示 |
|
168
|
+
| isControl | `number` | 是否受控 |
|
169
|
+
| isShowControl | `number` | 是否显示控制 |
|
170
|
+
| sourceType | `number` | 来源类型 |
|
171
|
+
| cookType | `number` | 烹饪方式 |
|
172
|
+
| extInfo | `string` | 扩展信息 |
|
173
|
+
| cookTime | `number` | 烹饪时间 |
|
174
|
+
| useFoodLib | `number` | 使用食材库 |
|
175
|
+
| eatCount | `number` | 用餐人数 |
|
176
|
+
| isFoodChannel | `number` | 是否为食品频道 |
|
177
|
+
| easyLevel | `string` | 难易等级 |
|
178
|
+
| easyLevelDesc | `string` | 难易等级描述 |
|
179
|
+
| taste | `string` | 口味 |
|
180
|
+
| tasteDesc | `string` | 口味描述 |
|
181
|
+
| foodType | `string` | 食品类型 |
|
182
|
+
| foodTypeDesc | `string` | 食品类型描述 |
|
183
|
+
| allergens | `AllergenInfo[]` | 过敏原信息数组 |
|
184
|
+
| author | `string` | 作者 |
|
185
|
+
| pv | `number` | 浏览量 |
|
186
|
+
| avgScore | `number` | 平均评分 |
|
187
|
+
| menuStepInfoVOList | `MenuStepInfoVO[]` | 图文步骤信息数组 |
|
188
|
+
| cookStepInfoVOList | `CookStepInfoVO[]` | 烹饪步骤信息数组 |
|
189
|
+
| foodInfoVOList | `FoodInfoVO[]` | 食材信息数组 |
|
190
|
+
| customInfoList | `CustomInfo[]` | 自定义属性信息数组 |
|
191
|
+
| gmtCreate | `number` | 创建时间 |
|
192
|
+
| gmtModified | `number` | 修改时间 |
|
193
|
+
|
194
|
+
**AllergenInfo**
|
195
|
+
|
196
|
+
| 属性 | 类型 | 说明 |
|
197
|
+
| ---- | -------- | ---------- |
|
198
|
+
| id | `number` | 过敏原 ID |
|
199
|
+
| name | `string` | 过敏原名称 |
|
200
|
+
|
201
|
+
**LangInfo**
|
202
|
+
|
203
|
+
| 属性 | 类型 | 说明 |
|
204
|
+
| ----------- | -------- | -------------------- |
|
205
|
+
| lang | `string` | 语言标识 |
|
206
|
+
| stepImg | `string` | 步骤图片(可选) |
|
207
|
+
| origStepImg | `string` | 原始步骤图片(可选) |
|
208
|
+
| desc | `string` | 描述 |
|
209
|
+
|
210
|
+
**MenuStepInfoVO**
|
211
|
+
|
212
|
+
| 属性 | 类型 | 说明 |
|
213
|
+
| ----------- | ------------ | -------------- |
|
214
|
+
| id | `number` | 步骤 ID |
|
215
|
+
| menuId | `number` | 菜单 ID |
|
216
|
+
| step | `number` | 步骤编号 |
|
217
|
+
| langInfos | `LangInfo[]` | 多语言信息数组 |
|
218
|
+
| gmtCreate | `number` | 创建时间 |
|
219
|
+
| gmtModified | `number` | 修改时间 |
|
220
|
+
|
221
|
+
**CookStepInfoVO**
|
222
|
+
|
223
|
+
| 属性 | 类型 | 说明 |
|
224
|
+
| ----------- | ------------ | -------------------- |
|
225
|
+
| id | `number` | 步骤 ID |
|
226
|
+
| menuId | `number` | 菜单 ID |
|
227
|
+
| isCookArgs | `number` | 是否为烹饪参数 |
|
228
|
+
| step | `number` | 步骤编号 |
|
229
|
+
| stepImg | `string` | 步骤图片(可选) |
|
230
|
+
| origStepImg | `string` | 原始步骤图片(可选) |
|
231
|
+
| finishCtrl | `string` | 完成控制(可选) |
|
232
|
+
| cookArgs | `any[]` | 烹饪参数(可选) |
|
233
|
+
| langInfos | `LangInfo[]` | 多语言信息数组 |
|
234
|
+
| gmtCreate | `number` | 创建时间 |
|
235
|
+
| gmtModified | `number` | 修改时间 |
|
236
|
+
|
237
|
+
**FoodInfoVO**
|
238
|
+
|
239
|
+
| 属性 | 类型 | 说明 |
|
240
|
+
| ------------------- | -------- | ---------------- |
|
241
|
+
| id | `number` | 食材 ID |
|
242
|
+
| name | `string` | 食材名称 |
|
243
|
+
| lang | `string` | 语言标识 |
|
244
|
+
| image | `string` | 食材图片 |
|
245
|
+
| desc | `string` | 食材描述 |
|
246
|
+
| menuFoodRelationVO | `any` | 菜单食材关系对象 |
|
247
|
+
| foodNutritionVOList | `any[]` | 食材营养信息数组 |
|
248
|
+
| gmtCreate | `number` | 创建时间 |
|
249
|
+
| gmtModified | `number` | 修改时间 |
|
250
|
+
|
251
|
+
**CustomLangInfo**
|
252
|
+
|
253
|
+
| 属性 | 类型 | 说明 |
|
254
|
+
| ------- | -------- | ---------------- |
|
255
|
+
| lang | `string` | 语言标识 |
|
256
|
+
| name | `string` | 名称 |
|
257
|
+
| desc | `string` | 描述 |
|
258
|
+
| fileUrl | `string` | 文件 URL(可选) |
|
259
|
+
|
260
|
+
**CustomInfo**
|
261
|
+
|
262
|
+
| 属性 | 类型 | 说明 |
|
263
|
+
| --------- | ------------------ | -------------- |
|
264
|
+
| code | `string` | 自定义属性编码 |
|
265
|
+
| langInfos | `CustomLangInfo[]` | 多语言信息数组 |
|
266
|
+
|
267
|
+
**函数定义示例**
|
268
|
+
|
269
|
+
```typescript
|
270
|
+
/**
|
271
|
+
* 获取食谱详情
|
272
|
+
* @param {RecipeDetailParams} params - 包含食谱 ID 和设备 ID 的对象
|
273
|
+
* @returns {Promise<RecipeDetailResponse>} - 返回食谱详情响应的 Promise
|
274
|
+
*/
|
275
|
+
export function getRecipeDetail(params: RecipeDetailParams): Promise<RecipeDetailResponse>
|
276
|
+
```
|
@@ -0,0 +1,87 @@
|
|
1
|
+
/**
|
2
|
+
* LanguageDescription - 语言描述信息
|
3
|
+
*/
|
4
|
+
type LanguageDescription = {
|
5
|
+
enDesc: string;
|
6
|
+
cnDesc: string;
|
7
|
+
code: string;
|
8
|
+
orderNum: number;
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* GetAllLanguagesResponse - 获取食谱所有语言响应
|
12
|
+
*/
|
13
|
+
type GetAllLanguagesResponse = LanguageDescription[];
|
14
|
+
/**
|
15
|
+
* 获取食谱所支持的所有语言信息
|
16
|
+
* @returns {Promise<GetAllLanguagesResponse>} - 获取所有语言信息结果的 Promise
|
17
|
+
*/
|
18
|
+
export declare const getAllLanguages: () => Promise<GetAllLanguagesResponse>;
|
19
|
+
/**
|
20
|
+
* GetSearchModelParams - 获取搜索模型参数
|
21
|
+
*/
|
22
|
+
type GetSearchModelParams = {
|
23
|
+
productId: string;
|
24
|
+
};
|
25
|
+
/**
|
26
|
+
* SearchModelResponse - 获取搜索模型响应
|
27
|
+
*/
|
28
|
+
type SearchModelResponse = {
|
29
|
+
metadata: Metadata[];
|
30
|
+
productGroup: ProductGroup[];
|
31
|
+
};
|
32
|
+
/**
|
33
|
+
* Metadata - 元数据信息
|
34
|
+
*/
|
35
|
+
type Metadata = {
|
36
|
+
gmtModified: number;
|
37
|
+
code: string;
|
38
|
+
id: number;
|
39
|
+
gmtCreate: number;
|
40
|
+
value: string;
|
41
|
+
langInfos: LangInfo[];
|
42
|
+
key: string;
|
43
|
+
};
|
44
|
+
/**
|
45
|
+
* ProductGroup - 产品组信息
|
46
|
+
*/
|
47
|
+
type ProductGroup = {
|
48
|
+
gmtModified: number;
|
49
|
+
name: string;
|
50
|
+
id: number;
|
51
|
+
gmtCreate: number;
|
52
|
+
};
|
53
|
+
/**
|
54
|
+
* 获取 C 端用户搜索模型
|
55
|
+
* @param {GetSearchModelParams} params - 获取搜索模型参数
|
56
|
+
* @returns {Promise<SearchModelResponse>} - 获取搜索模型结果的 Promise
|
57
|
+
*/
|
58
|
+
export declare const getSearchModel: (params: GetSearchModelParams) => Promise<SearchModelResponse>;
|
59
|
+
/**
|
60
|
+
* CookingTimeCondition - 烹饪时间筛选条件
|
61
|
+
*/
|
62
|
+
type CookingTimeCondition = {
|
63
|
+
sourceType: number;
|
64
|
+
name?: string;
|
65
|
+
categoryIds?: number[];
|
66
|
+
};
|
67
|
+
/**
|
68
|
+
* GetCookingTimeConditionParams - 获取烹饪时间筛选条件参数
|
69
|
+
*/
|
70
|
+
type GetCookingTimeConditionParams = {
|
71
|
+
query: CookingTimeCondition;
|
72
|
+
devId: string;
|
73
|
+
};
|
74
|
+
/**
|
75
|
+
* CookingTimeConditionResponse - 获取烹饪时间筛选条件响应
|
76
|
+
*/
|
77
|
+
type CookingTimeConditionResponse = {
|
78
|
+
minCookTime: number;
|
79
|
+
maxCookTime: number;
|
80
|
+
};
|
81
|
+
/**
|
82
|
+
* 获取已上线食谱的最小、最大烹饪时间
|
83
|
+
* @param {GetCookingTimeConditionParams} params - 获取烹饪时间筛选条件参数
|
84
|
+
* @returns {Promise<CookingTimeConditionResponse>} - 获取烹饪时间筛选条件结果的 Promise
|
85
|
+
*/
|
86
|
+
export declare const getCookingTimeCondition: (params: GetCookingTimeConditionParams) => Promise<CookingTimeConditionResponse>;
|
87
|
+
export {};
|
@@ -0,0 +1,101 @@
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
+
const _excluded = ["query"];
|
4
|
+
import { THING } from '../../constants';
|
5
|
+
import requestCloud from '../../requestCloud';
|
6
|
+
|
7
|
+
// #region 获取食谱所有语言
|
8
|
+
|
9
|
+
/**
|
10
|
+
* GetAllLanguagesParams - 获取食谱所有语言参数
|
11
|
+
*/
|
12
|
+
|
13
|
+
/**
|
14
|
+
* LanguageDescription - 语言描述信息
|
15
|
+
*/
|
16
|
+
|
17
|
+
/**
|
18
|
+
* GetAllLanguagesResponse - 获取食谱所有语言响应
|
19
|
+
*/
|
20
|
+
|
21
|
+
/**
|
22
|
+
* 获取食谱所支持的所有语言信息
|
23
|
+
* @returns {Promise<GetAllLanguagesResponse>} - 获取所有语言信息结果的 Promise
|
24
|
+
*/
|
25
|
+
export const getAllLanguages = () => {
|
26
|
+
return requestCloud({
|
27
|
+
api: "".concat(THING, ".m.cookbook.all.lang"),
|
28
|
+
version: '1.0',
|
29
|
+
data: {}
|
30
|
+
});
|
31
|
+
};
|
32
|
+
|
33
|
+
// #endregion
|
34
|
+
|
35
|
+
// #region 获取搜索模型
|
36
|
+
|
37
|
+
/**
|
38
|
+
* GetSearchModelParams - 获取搜索模型参数
|
39
|
+
*/
|
40
|
+
|
41
|
+
/**
|
42
|
+
* SearchModelResponse - 获取搜索模型响应
|
43
|
+
*/
|
44
|
+
|
45
|
+
/**
|
46
|
+
* Metadata - 元数据信息
|
47
|
+
*/
|
48
|
+
|
49
|
+
/**
|
50
|
+
* ProductGroup - 产品组信息
|
51
|
+
*/
|
52
|
+
|
53
|
+
/**
|
54
|
+
* 获取 C 端用户搜索模型
|
55
|
+
* @param {GetSearchModelParams} params - 获取搜索模型参数
|
56
|
+
* @returns {Promise<SearchModelResponse>} - 获取搜索模型结果的 Promise
|
57
|
+
*/
|
58
|
+
export const getSearchModel = params => {
|
59
|
+
return requestCloud({
|
60
|
+
api: "".concat(THING, ".m.menu.query.model.list"),
|
61
|
+
version: '1.0',
|
62
|
+
data: params
|
63
|
+
});
|
64
|
+
};
|
65
|
+
|
66
|
+
// #endregion
|
67
|
+
|
68
|
+
// #region 获取烹饪时间筛选条件
|
69
|
+
|
70
|
+
/**
|
71
|
+
* CookingTimeCondition - 烹饪时间筛选条件
|
72
|
+
*/
|
73
|
+
|
74
|
+
/**
|
75
|
+
* GetCookingTimeConditionParams - 获取烹饪时间筛选条件参数
|
76
|
+
*/
|
77
|
+
|
78
|
+
/**
|
79
|
+
* CookingTimeConditionResponse - 获取烹饪时间筛选条件响应
|
80
|
+
*/
|
81
|
+
|
82
|
+
/**
|
83
|
+
* 获取已上线食谱的最小、最大烹饪时间
|
84
|
+
* @param {GetCookingTimeConditionParams} params - 获取烹饪时间筛选条件参数
|
85
|
+
* @returns {Promise<CookingTimeConditionResponse>} - 获取烹饪时间筛选条件结果的 Promise
|
86
|
+
*/
|
87
|
+
export const getCookingTimeCondition = params => {
|
88
|
+
const {
|
89
|
+
query
|
90
|
+
} = params,
|
91
|
+
rest = _objectWithoutProperties(params, _excluded);
|
92
|
+
return requestCloud({
|
93
|
+
api: "".concat(THING, ".m.menu.search.condition"),
|
94
|
+
version: '1.0',
|
95
|
+
data: _objectSpread({
|
96
|
+
queryJson: JSON.stringify(query)
|
97
|
+
}, rest)
|
98
|
+
});
|
99
|
+
};
|
100
|
+
|
101
|
+
// #endregion
|