配餐项目前端文件
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
2.6 KiB

# 食材部分
# 1. 查询食材
> GET /api/ingredient
### 输入:
```
pageSize=20 // 默认20, 全部非必填
pageNo=0 // 默认0, 从0开始
2 years ago
keyword=01 // 查询关键字,模糊匹配用
type=谷薯类 // 食材类型
mark=常用 // 食材标记. 业务端用标记,管理端没用
```
### 输出:
```
{
"body": {
"content": [
{
"key": "011101",
"mark": "常用",
"name": "小麦",
"nutrient": {
"fat": 10,
"energy": 10,
"calcium": 12,
"protein": 15,
"vitamin-a": 23
},
"time": 1693759354000,
"type": "谷薯类"
}
],
"number": 0,
"size": 20,
"totalElements": 1,
"totalPages": 1
},
"code": 200,
"desc": "成功",
"success": true
}
```
# 2. 添加食材(管理端接口)
> PUT /api/ingredient
### 输入:
```
Content-Type:application/x-www-form-urlencoded
key=010101 // 必填
name=测试食材 // 必填
type=粗粮 // 必填 全部必填 取值范围见(/api/basic/enum) category
nutrient={"fat": 10, "energy": 10, "calcium": 12, "protein": 15, "vitamin-a": 23}
// 必填 取值范围见(/api/basic/enum) nutrient
```
### 输出:
```
{
"code": 200,
"desc": "成功",
"success": true
}
```
# 3. 修改食材(管理端接口)
> POST /api/ingredient
### 输入:
```
Content-Type:application/x-www-form-urlencoded
key=010101 // 必填
name=测试食材
type=粗粮
nutrient={"fat": 10, "energy": 10, "calcium": 12, "protein": 15, "vitamin-a": 23}
```
### 输出:
```
{
"code": 200,
"desc": "成功",
"success": true
}
```
# 4. 删除食材(管理端接口)
> DELETE /api/ingredient
### 输入:
```
Content-Type:application/x-www-form-urlencoded
2 years ago
keys=010101,0101012,0101013 // 必填
```
### 输出:
```
{
"code": 200,
"desc": "成功",
"success": true
}
```
# 5. 食材打标(业务端接口)
> PUT /api/ingredient/mark
### 输入:
```
Content-Type:application/x-www-form-urlencoded
2 years ago
key=010101 // 食材编号
2 years ago
mark=常用 // 必填, 取值: 常用/忌用
```
### 输出:
```
{
"code": 200,
"desc": "成功",
"success": true
}
```
# 6. 取消打标(业务端接口)
> DELETE /api/ingredient/mark
### 输入:
```
Content-Type:application/x-www-form-urlencoded
2 years ago
key=010101 // 食材编号
```
### 输出:
```
{
"code": 200,
"desc": "成功",
"success": true
}
```
2 years ago
# 7. 批量导入(管理端接口, 暂不可用)
2 years ago
> PUT /api/ingredient/upload
### 输入:
```
Content-Type: multipart/form-data
files // 必传
```
### 输出:
```
{
"code": 200,
"desc": "成功",
"success": true
}
```