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

4.1 KiB

营养计划部分

1. 查询计划(根据名字模糊分页查询, 用于管理端的管理页面)

GET /api/nutrition

输入:

pageSize=20  // 默认20, 全部非必填
pageNo=0     // 默认0, 从0开始
keyword=青少年   // 查询关键字

输出:

{
  "body": {
    "content": [
      {
        "foodCategoryDay": [{"max":100,"min":10,"name":"规则名称","type":"quantity","category":["谷类","薯类"]}],
        "foodCategoryWeek": [{"max":100,"min":10,"name":"规则名称","type":"quantity","category":["谷类","薯类"]}],
        "id": 1,
        "ingredient": {
          "轻体力": {
            "vitamin-a": {
              "min": 2,
              "max": 10,
              "ul": 5
            }
          },
          "中体力": {
            "vitamin-a": {
              "min": 2,
              "max": 10,
              "ul": 5
            }
          }
        },
        "name": "青少年就餐指导",
        "overflow": 0.51,
        "vendors": [
          1
        ]
      }
    ],
    "number": 0,
    "size": 20,
    "totalElements": 1,
    "totalPages": 1
  },
  "code": 200,
  "desc": "成功",
  "success": true
}

2. 查询计划(根据ID精确查询)

GET /api/nutrition/select

输入:

id=1           

输出:

{
  "body": {
    "foodCategoryDay": [{"max":100,"min":10,"name":"规则名称","type":"weight","category":["谷类","薯类"]}],
    "foodCategoryWeek": [{"max":100,"min":10,"name":"规则名称","type":"weight","category":["谷类","薯类"]}],
    "id": 1,
    "ingredient": {
      "轻体力": {
        "vitamin-a": {
          "min": 2,
          "max": 10,
          "ul": 5
        }
      },
      "中体力": {
        "vitamin-a": {
          "min": 2,
          "max": 10,
          "ul": 5
        }
      }
    },
    "name": "青少年就餐指导",
    "overflow": 0.51,
    "vendors": [
      1
    ]
  },
  "code": 200,
  "desc": "成功",
  "success": true
}

3. 查询计划(根据单位和名称模糊查询)

GET /api/nutrition/select

输入:

vender=1   // 非必填
keyword=青  

输出:

{
  "body": [
      {
        "foodCategoryDay": [{"max":100,"min":10,"name":"规则名称","type":"weight","category":["谷类","薯类"]}],
        "foodCategoryWeek": [{"max":100,"min":10,"name":"规则名称","type":"weight","category":["谷类","薯类"]}],
        "id": 1,
        "ingredient": {
          "轻体力": {
            "vitamin-a": {
              "min": 2,
              "max": 10,
              "ul": 5
            }
          },
          "中体力": {
            "vitamin-a": {
              "min": 2,
              "max": 10,
              "ul": 5
            }
          }
        },
        "name": "青少年就餐指导",
        "overflow": 0.51,
        "vendors": [
          1
        ]
      }
  ],
  "code": 200,
  "desc": "成功",
  "success": true
}

4. 添加计划(管理端接口)

PUT /api/nutrition

输入:

Content-Type:application/x-www-form-urlencoded
name=青少年就餐指导   // 必填  名称
vendors=1,2.3      // 必填  单位列表
overflow=0.5       // 必填  溢出

输出:

{
  "code": 200,
  "desc": "成功",
  "success": true
}

5. 修改计划(管理端接口)

POST /api/nutrition

输入:

Content-Type:application/x-www-form-urlencoded
id=1   // 必填
name=青少年就餐指导   //  名称
vendors=1,2,3      //  单位列表
overflow=0.5       //  溢出
foodCategoryDay=[{"max":100,"min":10,"name":"规则名称","type":"weight","category":["谷类","薯类"]}]
foodCategoryWeek=[{"max":100,"min":10,"name":"规则名称","type":"quantity","category":["谷类","薯类"]}]
ingredient={"中体力": {"vitamin-a": {"ul": 5, "max": 10, "min": 2}}, "轻体力": {"vitamin-a": {"ul": 5, "max": 10, "min": 2}}}

输出:

{
  "code": 200,
  "desc": "成功",
  "success": true
}

6. 删除计划(管理端接口)

DELETE /api/nutrition

输入:

Content-Type:application/x-www-form-urlencoded
id=1  // 必填

输出:

{
  "code": 200,
  "desc": "成功",
  "success": true
}