配餐软件
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.

220 lines
3.2 KiB

2 years ago
# 1. 查询食谱(根据ID获取基础信息)
> GET /api/menu
### 输入:
```text
id=1
```
### 输出:
~~~json
{
"body": {
"created": 1694014254000,
"crows": [
"轻体力",
"重体力"
],
1 year ago
"day": [1,3,5],
2 years ago
"id": 1,
"meals": [
"早餐",
"午餐",
"晚餐"
],
"modify": 1695404897000,
"month": [
1,
2,
3,
4,
5,
6,
7,
8,
9
],
"name": "23年度43周食谱",
"nutrient": 1,
"operate": "system",
"scale": {
"轻体力": 0,
"重体力": 0
},
"status": "草稿",
"vender": 1
},
"code": 200,
"desc": "成功",
"success": true
}
~~~
# 2. 查询食谱列表
> GET /api/menu
### 输入:
```text
pageSize=20 // 默认20, 全部非必填
pageNo=0 // 默认0, 从0开始
name=番茄鸡蛋汤 // 根据名称查
vender=1 // 根据单位查
status=1 // 根据状态查
startTime=2023-03-01 // 根据时间段查
endTime=2024-03-01
```
### 输出:
~~~json
{
"body": {
"content": [
{
"created": 1694014254000,
"crows": [
"轻体力",
"重体力"
],
1 year ago
"day": [1,3,5],
2 years ago
"id": 1,
"meals": [
"早餐",
"午餐",
"晚餐"
],
"modify": 1695404897000,
"month": [
1,
2,
3,
4,
5,
6,
7,
8,
9
],
"name": "23年度43周食谱",
"nutrient": 1,
"operate": "system",
"scale": {
"轻体力": 0,
"重体力": 0
},
"status": "草稿",
"vender": 1
}
],
"number": 0,
"size": 20,
"totalElements": 1,
"totalPages": 1
},
"code": 200,
"desc": "成功",
"success": true
}
~~~
# 3. 创建新食谱
> PUT /api/menu
### 输入:
```text
vendors=1,2,3 // 管理端有效,业务端不用
name=番茄鸡蛋汤 // 名称
nutrient=1 // 营养计划编号
1 year ago
day=1,3,5 // 代表周一,周三,周五
2 years ago
meals=早餐,午餐,晚餐 // 餐次
month=1,2,3,4,5,6,7,8,9,10,11,12 // 适用月份
crows=重体力,轻体力 //人群
```
### 输出:
~~~json
{
"body": [
1,
2,
3
],
"code": 200,
"desc": "成功",
"success": true
}
~~~
# 4. 修改食谱
> POST /api/menu
### 输入:
```text
id=1 // 食谱ID
name=番茄鸡蛋汤 // 名称
nutrient=1 // 营养计划编号
1 year ago
day=1,3,5 // 代表周一,周三,周五
2 years ago
meals=早餐,午餐,晚餐 // 餐次
month=1,2,3,4,5,6,7,8,9,10,11,12 // 适用月份
crows=重体力,轻体力 //人群
```
### 输出:
~~~json
{
"code": 200,
"desc": "成功",
"success": true
}
~~~
# 5. 删除食谱
> DELETE /api/menu
### 输入:
```text
id=1 // 食谱ID
```
### 输出:
~~~json
{
"code": 200,
"desc": "成功",
"success": true
}
1 year ago
~~~
# 6. 复制食谱
> PUT /api/menu/copy
### 输入:
```text
vendors=1,2,3 // 管理端有效,业务端不用
name=番茄鸡蛋汤 // 名称, 选填
id=1 // 源食谱编号, 必填
```
### 输出:
~~~json
{
"body": [
1,
2,
3
],
"code": 200,
"desc": "成功",
"success": true
}
2 years ago
~~~