|
|
@ -45,7 +45,31 @@ mark=常用 // 食材标记. 业务端用标记,管理端没用 |
|
|
|
} |
|
|
|
``` |
|
|
|
|
|
|
|
# 2. 添加食材(管理端接口) |
|
|
|
# 2. 查询食材(根据ID批量查询) |
|
|
|
|
|
|
|
> GET /api/ingredient/select |
|
|
|
|
|
|
|
### 输入: |
|
|
|
``` |
|
|
|
keys=011101,011102,011103 |
|
|
|
``` |
|
|
|
### 输出: |
|
|
|
``` |
|
|
|
{ |
|
|
|
"body": [ |
|
|
|
{ |
|
|
|
"key": "011101", |
|
|
|
"name": "小麦", |
|
|
|
"type": "谷薯类" |
|
|
|
} |
|
|
|
], |
|
|
|
"code": 200, |
|
|
|
"desc": "成功", |
|
|
|
"success": true |
|
|
|
} |
|
|
|
``` |
|
|
|
|
|
|
|
# 3. 添加食材(管理端接口) |
|
|
|
|
|
|
|
> PUT /api/ingredient |
|
|
|
|
|
|
@ -68,7 +92,7 @@ nutrient={"fat": 10, "energy": 10, "calcium": 12, "protein": 15, "vitamin-a": 23 |
|
|
|
} |
|
|
|
``` |
|
|
|
|
|
|
|
# 3. 修改食材(管理端接口) |
|
|
|
# 4. 修改食材(管理端接口) |
|
|
|
|
|
|
|
> POST /api/ingredient |
|
|
|
|
|
|
@ -90,7 +114,7 @@ nutrient={"fat": 10, "energy": 10, "calcium": 12, "protein": 15, "vitamin-a": 23 |
|
|
|
"success": true |
|
|
|
} |
|
|
|
``` |
|
|
|
# 4. 删除食材(管理端接口) |
|
|
|
# 5. 删除食材(管理端接口) |
|
|
|
|
|
|
|
> DELETE /api/ingredient |
|
|
|
|
|
|
@ -110,7 +134,7 @@ keys=010101,0101012,0101013 // 必填 |
|
|
|
} |
|
|
|
``` |
|
|
|
|
|
|
|
# 5. 食材打标(业务端接口) |
|
|
|
# 6. 食材打标(业务端接口) |
|
|
|
|
|
|
|
> PUT /api/ingredient/mark |
|
|
|
|
|
|
@ -131,7 +155,7 @@ mark=常用 // 必填, 取值: 常用/忌用 |
|
|
|
} |
|
|
|
``` |
|
|
|
|
|
|
|
# 6. 取消打标(业务端接口) |
|
|
|
# 7. 取消打标(业务端接口) |
|
|
|
|
|
|
|
> DELETE /api/ingredient/mark |
|
|
|
|
|
|
@ -151,22 +175,36 @@ key=010101 // 食材编号 |
|
|
|
} |
|
|
|
``` |
|
|
|
|
|
|
|
# 7. 批量导入(管理端接口, 暂不可用) |
|
|
|
# 8. 批量导入(管理端接口) |
|
|
|
|
|
|
|
> PUT /api/ingredient/upload |
|
|
|
> PUT http://localhost:9527/api/ingredient/excel |
|
|
|
|
|
|
|
### 输入: |
|
|
|
``` |
|
|
|
Content-Type: multipart/form-data |
|
|
|
files // 必传 |
|
|
|
Content-Type: multipart/form-data; boundary=boundary |
|
|
|
|
|
|
|
--boundary |
|
|
|
Content-Disposition: form-data; name="file"; filename="a.xlsx" |
|
|
|
|
|
|
|
< C:\Users\CCC\Documents\WeChat Files\wxid_40aqnb839lkd12\FileStorage\File\2023-09\谷物及制品.xlsx |
|
|
|
|
|
|
|
--boundary |
|
|
|
Content-Disposition: form-data; name="extraInfo"; |
|
|
|
``` |
|
|
|
|
|
|
|
### 输出: |
|
|
|
``` |
|
|
|
{ |
|
|
|
"code": 200, |
|
|
|
"desc": "成功", |
|
|
|
"success": true |
|
|
|
} |
|
|
|
``` |
|
|
|
Content-Disposition: attachment;filename*=utf-8''%5B%E5%AF%BC%E5%85%A5%E7%BB%93%E6%9E%9C%5Da.xlsx |
|
|
|
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8 |
|
|
|
Transfer-Encoding: chunked |
|
|
|
Date: Sun, 17 Sep 2023 18:49:10 GMT |
|
|
|
Keep-Alive: timeout=60 |
|
|
|
Connection: keep-alive |
|
|
|
|
|
|
|
Response file saved. |
|
|
|
> [导入结果]a-2.xlsx |
|
|
|
``` |
|
|
|
|
|
|
|
# 9.下载导入模板 |
|
|
|
|
|
|
|
> GET /api/ingredient/excel |