{
  "openapi": "3.0.3",
  "info": {
    "title": "AI运动营养师 - 餐盘扫码绑盘旧路径废弃标记",
    "version": "1.0.0",
    "description": "用于将旧 pathinfo 展示路径标记为废弃，避免联调误用。"
  },
  "servers": [
    {
      "url": "{{baseUrl}}",
      "description": "Apifox 环境变量 baseUrl 配到 ai_api 根路径，例如 https://zysct.bziht.edu.cn/aizhct"
    }
  ],
  "tags": [
    {
      "name": "餐盘扫码",
      "description": "小程序餐盘二维码扫码绑盘"
    }
  ],
  "paths": {
    "/api/plate/bindByScan": {
      "post": {
        "tags": [
          "餐盘扫码"
        ],
        "summary": "废弃：小程序扫码绑定餐盘（旧 pathinfo 路径）",
        "description": "旧 pathinfo 展示路径，仅保留为迁移提示，请勿调用。正式接口请使用 `POST /index.php?s=/api/plate/bindByScan`。",
        "operationId": "deprecatedApiPlateBindByScanOldPath",
        "x-apifox-folder": "餐盘扫码",
        "parameters": [
          {
            "name": "Access-Token",
            "in": "header",
            "required": true,
            "description": "小程序登录 token",
            "schema": {
              "type": "string"
            },
            "example": "{{Access-Token}}"
          },
          {
            "name": "platform",
            "in": "header",
            "required": false,
            "description": "客户端平台，微信小程序一般为 MP-WEIXIN",
            "schema": {
              "type": "string"
            },
            "example": "MP-WEIXIN"
          },
          {
            "name": "enterprise-no",
            "in": "header",
            "required": false,
            "description": "企业编号，多企业环境按小程序现有请求头传递",
            "schema": {
              "type": "string"
            },
            "example": "10001"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "equipment_code"
                ],
                "properties": {
                  "type": {
                    "type": "integer",
                    "description": "二维码类型，餐盘扫码固定为 100",
                    "example": 100
                  },
                  "equipment_code": {
                    "type": "string",
                    "description": "二维码参数中的 equipment_code，实际表示餐盘编号，后端会映射为 store 的 plate_code",
                    "example": "018000"
                  }
                }
              },
              "example": {
                "type": 100,
                "equipment_code": "018000"
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "equipment_code"
                ],
                "properties": {
                  "type": {
                    "type": "integer",
                    "description": "二维码类型，餐盘扫码固定为 100",
                    "example": 100
                  },
                  "equipment_code": {
                    "type": "string",
                    "description": "二维码参数中的 equipment_code，实际表示餐盘编号，后端会映射为 store 的 plate_code",
                    "example": "018000"
                  }
                }
              },
              "example": {
                "type": 100,
                "equipment_code": "018000"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "请求成功，业务成功或失败均按 status/message 判断",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "description": "ai_api 状态码，成功为 200",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "description": "提示信息",
                      "example": "绑定成功"
                    },
                    "data": {
                      "type": "object",
                      "description": "store /p/api/bindPlateInfo 返回的数据",
                      "properties": {
                        "staff": {
                          "type": "object",
                          "description": "绑定人员和余额信息",
                          "properties": {
                            "uuid": {
                              "type": "string",
                              "description": "人员 UUID",
                              "example": "staff-uuid"
                            },
                            "name": {
                              "type": "string",
                              "description": "人员姓名",
                              "example": "张三"
                            },
                            "bind_id": {
                              "type": "integer",
                              "description": "餐盘绑定记录 ID",
                              "example": 123
                            },
                            "bind_time": {
                              "type": "string",
                              "description": "绑定时间",
                              "example": "2026-07-15 12:01:01"
                            },
                            "reality_price": {
                              "type": "number",
                              "description": "已取餐金额",
                              "example": 0
                            },
                            "balance": {
                              "type": "number",
                              "description": "剩余总余额；一卡通开启时以一卡通实时余额为准",
                              "example": 25.6
                            },
                            "cash_balance": {
                              "type": "number",
                              "description": "剩余现金余额",
                              "example": 25.6
                            },
                            "subsidy_alance": {
                              "type": "number",
                              "description": "剩余补贴余额，沿用 store 现有字段名",
                              "example": 0
                            },
                            "department_name": {
                              "type": "string",
                              "description": "部门名称",
                              "example": "计算机学院"
                            },
                            "hard_ware_img": {
                              "type": "string",
                              "description": "人脸照片完整地址",
                              "example": ""
                            }
                          },
                          "additionalProperties": true
                        },
                        "nutrition": {
                          "type": "array",
                          "description": "当前餐次营养信息，沿用 store 返回",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        },
                        "dishes": {
                          "type": "array",
                          "description": "称重台菜品信息；扫码绑盘场景默认空数组",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "example": []
                        }
                      },
                      "additionalProperties": true
                    },
                    "trace_id": {
                      "type": "string",
                      "description": "链路追踪 ID",
                      "example": "trace-id"
                    }
                  },
                  "required": [
                    "status",
                    "message",
                    "data",
                    "trace_id"
                  ]
                },
                "examples": {
                  "success": {
                    "summary": "绑定成功",
                    "value": {
                      "status": 200,
                      "message": "绑定成功",
                      "data": {
                        "staff": {
                          "uuid": "staff-uuid",
                          "name": "张三",
                          "bind_id": 123,
                          "bind_time": "2026-07-15 12:01:01",
                          "reality_price": 0,
                          "balance": 25.6,
                          "cash_balance": 25.6,
                          "subsidy_alance": 0,
                          "department_name": "计算机学院",
                          "hard_ware_img": ""
                        },
                        "nutrition": [],
                        "dishes": []
                      },
                      "trace_id": "trace-id"
                    }
                  },
                  "notBoundStaff": {
                    "summary": "当前账号未绑定餐厅人员",
                    "value": {
                      "status": 500,
                      "message": "当前账号未绑定餐厅人员",
                      "data": [],
                      "trace_id": "trace-id"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": true
      }
    }
  }
}
