{
  "openapi": "3.0.3",
  "info": {
    "title": "VWCG-1354 store饮食照片接口草案",
    "version": "0.1.0-draft",
    "description": "原型已确认；本文件待技术/API审核，未实现、未导入。拟属Apifox项目5737553，目标目录ID/AI分支待恢复授权后核验。"
  },
  "paths": {
    "/p/DietPhoto/records": {
      "post": {
        "summary": "查询人员饮食照片及默认展开明细",
        "operationId": "dietPhotoRecords",
        "description": "## 接口概述\n查询人员饮食照片及默认展开明细。本接口为VWCG-1354技术审核草案，未实现、未导入Apifox。\n\n## 接口信息\nPOST /p/DietPhoto/records；store拥有，沿用PC后台会话。\n\n## 请求头（Header）\n沿用token请求头及现有PC会话；服务端验证原菜单、动作、人员/部门与租户范围，不依赖前端隐藏。\n\n## 请求参数\n- staff_uuid（必填）：稳定UUID；须在当前租户和授权数据范围内\n- date_from（必填）：date\n- date_to（必填）：date\n- meal_times（可选）：1早餐及早加餐、2午餐及午加餐、3晚餐及晚加餐、4夜宵；未知null，禁止4归晚餐\n- meal_kind（可选）：string\n- filter（可选）：string\n- page（可选）：integer\n- page_size（可选）：integer\n\n## 响应格式\n成功为code=0的JSON，任务状态独立在data.status；失败code=1并有error_code。\n按用餐日期闭区间查询，同餐多次及多图逐条保留；合计覆盖全筛选集而非仅本页。旧FoodRecord接口不改响应结构。\n\n## 状态码或业务状态说明\n兼容原PC业务码；HTTP401/403/409/422/429/503均按失败处理，不显示成功。版本冲突刷新数据后人工重新提交，不自动覆盖；识别或导出失败保留原图与当前人工结果。\n\n## 响应字段说明\n结构化Schema为完整字段定义。null表示未知，不代表0。上传时间/原图/可信身份只读；列表和统计使用同一当前revision。\n\n## trace_id排查\n服务端生成trace_id贯穿请求/record/attempt/export，日志仅记录必要标识，不写token、原图base64或人员敏感明细。",
        "tags": [
          "膳食监控/饮食照片"
        ],
        "x-apifox-folder": "膳食监控/饮食照片",
        "security": [
          {
            "pcToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；异步动作只表示任务已接受，须读状态；旧风格业务错误需检查code",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer",
                          "enum": [
                            0
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": ""
                        },
                        "trace_id": {
                          "type": "string",
                          "description": ""
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "records": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Record"
                              }
                            },
                            "total": {
                              "type": "integer"
                            },
                            "totals": {
                              "$ref": "#/components/schemas/Nutrients"
                            },
                            "totals_status": {
                              "$ref": "#/components/schemas/NutrientStatus"
                            }
                          },
                          "additionalProperties": false,
                          "required": [
                            "records",
                            "total",
                            "totals",
                            "totals_status"
                          ]
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message",
                        "trace_id",
                        "data"
                      ]
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "message": "example-value",
                      "trace_id": "example-value",
                      "data": {
                        "records": [],
                        "total": 0,
                        "totals": {
                          "energy": null,
                          "protein": null,
                          "zinc": null,
                          "magnesium": null
                        },
                        "totals_status": {
                          "energy": "missing",
                          "protein": "missing",
                          "zinc": "missing",
                          "magnesium": "missing"
                        }
                      }
                    }
                  },
                  "businessFailure": {
                    "value": {
                      "code": 1,
                      "message": "版本已更新，请刷新",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "未登录",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "未登录",
                      "error_code": "AUTH_REQUIRED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "越权",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "越权",
                      "error_code": "FORBIDDEN",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "记录或原图不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "记录或原图不存在",
                      "error_code": "NOT_FOUND",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "版本/幂等冲突",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "版本/幂等冲突",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "参数校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "参数校验失败",
                      "error_code": "VALIDATION_FAILED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求过多",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "请求过多",
                      "error_code": "RATE_LIMITED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "服务不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "服务不可用",
                      "error_code": "RECOGNIZER_UNAVAILABLE",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "staff_uuid": {
                    "type": "string",
                    "description": "稳定UUID；须在当前租户和授权数据范围内",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "date_from": {
                    "type": "string",
                    "format": "date"
                  },
                  "date_to": {
                    "type": "string",
                    "format": "date"
                  },
                  "meal_times": {
                    "type": "integer",
                    "nullable": true,
                    "enum": [
                      1,
                      2,
                      3,
                      4,
                      null
                    ],
                    "description": "1早餐及早加餐、2午餐及午加餐、3晚餐及晚加餐、4夜宵；未知null，禁止4归晚餐"
                  },
                  "meal_kind": {
                    "type": "string",
                    "enum": [
                      "regular",
                      "extra",
                      "snack",
                      "night_snack",
                      "unassigned"
                    ]
                  },
                  "filter": {
                    "type": "string",
                    "enum": [
                      "all",
                      "pending",
                      "suspected",
                      "manual"
                    ]
                  },
                  "page": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 1
                  },
                  "page_size": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 20
                  }
                },
                "additionalProperties": false,
                "required": [
                  "staff_uuid",
                  "date_from",
                  "date_to"
                ]
              },
              "examples": {
                "request": {
                  "value": {
                    "staff_uuid": "example-value",
                    "date_from": "2026-09-11",
                    "date_to": "2026-09-11"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/p/DietPhoto/save": {
      "post": {
        "summary": "人工修改识别内容与餐次",
        "operationId": "dietPhotoSave",
        "description": "## 接口概述\n人工修改识别内容与餐次。本接口为VWCG-1354技术审核草案，未实现、未导入Apifox。\n\n## 接口信息\nPOST /p/DietPhoto/save；store拥有，沿用PC后台会话。\n\n## 请求头（Header）\n沿用token请求头及现有PC会话；服务端验证原菜单、动作、人员/部门与租户范围，不依赖前端隐藏。\n\n## 请求参数\n- record_id（必填）：稳定UUID；须在当前租户和授权数据范围内\n- expected_revision（必填）：integer\n- reason（必填）：人工操作理由；trim后必填\n- meal_date（必填）：date\n- meal_times（必填）：1早餐及早加餐、2午餐及午加餐、3晚餐及晚加餐、4夜宵；未知null，禁止4归晚餐\n- meal_kind（必填）：string\n- meal_time（必填）：RFC3339且必须带时区；用餐日按业务时区Asia/Shanghai解释，上传时间不可编辑\n- foods（必填）：array\n\n## 响应格式\n成功为code=0的JSON，任务状态独立在data.status；失败code=1并有error_code。\n事务内验证revision，原子写当前结果、人工审计和投影版本。原图、上传时间、身份和原AI不可修改。空食物列表代表人工清空，保留照片和审计，非删除事件。\n\n## 状态码或业务状态说明\n兼容原PC业务码；HTTP401/403/409/422/429/503均按失败处理，不显示成功。版本冲突刷新数据后人工重新提交，不自动覆盖；识别或导出失败保留原图与当前人工结果。\n\n## 响应字段说明\n结构化Schema为完整字段定义。null表示未知，不代表0。上传时间/原图/可信身份只读；列表和统计使用同一当前revision。\n\n## trace_id排查\n服务端生成trace_id贯穿请求/record/attempt/export，日志仅记录必要标识，不写token、原图base64或人员敏感明细。",
        "tags": [
          "膳食监控/饮食照片"
        ],
        "x-apifox-folder": "膳食监控/饮食照片",
        "security": [
          {
            "pcToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；异步动作只表示任务已接受，须读状态；旧风格业务错误需检查code",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer",
                          "enum": [
                            0
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": ""
                        },
                        "trace_id": {
                          "type": "string",
                          "description": ""
                        },
                        "data": {
                          "$ref": "#/components/schemas/Record"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message",
                        "trace_id",
                        "data"
                      ]
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "message": "example-value",
                      "trace_id": "example-value",
                      "data": {
                        "record_id": "example-value",
                        "staff_uuid": "example-value",
                        "revision": 0,
                        "uploaded_at": "2026-09-11T07:42:00+08:00",
                        "meal_date": "2026-09-11",
                        "meal_times": null,
                        "meal_kind": "regular",
                        "meal_time": null,
                        "photos": [],
                        "foods": [],
                        "current_origin": "ai",
                        "status": "pending",
                        "suspected_error": false,
                        "policy": {
                          "configured": "inherit",
                          "effective": "library",
                          "source_type": "person",
                          "source_uuid": null,
                          "revision": 0
                        },
                        "candidate_attempt_id": null,
                        "totals": {
                          "energy": null,
                          "protein": null,
                          "zinc": null,
                          "magnesium": null
                        },
                        "totals_status": {
                          "energy": "missing",
                          "protein": "missing",
                          "zinc": "missing",
                          "magnesium": "missing"
                        },
                        "current_result_status": "none"
                      }
                    }
                  },
                  "businessFailure": {
                    "value": {
                      "code": 1,
                      "message": "版本已更新，请刷新",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "未登录",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "未登录",
                      "error_code": "AUTH_REQUIRED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "越权",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "越权",
                      "error_code": "FORBIDDEN",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "记录或原图不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "记录或原图不存在",
                      "error_code": "NOT_FOUND",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "版本/幂等冲突",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "版本/幂等冲突",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "参数校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "参数校验失败",
                      "error_code": "VALIDATION_FAILED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求过多",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "请求过多",
                      "error_code": "RATE_LIMITED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "服务不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "服务不可用",
                      "error_code": "RECOGNIZER_UNAVAILABLE",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "record_id": {
                    "type": "string",
                    "description": "稳定UUID；须在当前租户和授权数据范围内",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "expected_revision": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "reason": {
                    "type": "string",
                    "description": "人工操作理由；trim后必填",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "meal_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "meal_times": {
                    "type": "integer",
                    "nullable": true,
                    "enum": [
                      1,
                      2,
                      3,
                      4,
                      null
                    ],
                    "description": "1早餐及早加餐、2午餐及午加餐、3晚餐及晚加餐、4夜宵；未知null，禁止4归晚餐"
                  },
                  "meal_kind": {
                    "type": "string",
                    "enum": [
                      "regular",
                      "extra",
                      "snack",
                      "night_snack",
                      "unassigned"
                    ]
                  },
                  "meal_time": {
                    "type": "string",
                    "format": "date-time",
                    "description": "RFC3339且必须带时区；用餐日按业务时区Asia/Shanghai解释，上传时间不可编辑",
                    "nullable": true
                  },
                  "foods": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/FoodEdit"
                    }
                  }
                },
                "additionalProperties": false,
                "required": [
                  "record_id",
                  "expected_revision",
                  "reason",
                  "meal_date",
                  "meal_times",
                  "meal_kind",
                  "meal_time",
                  "foods"
                ],
                "oneOf": [
                  {
                    "properties": {
                      "meal_times": {
                        "enum": [
                          1,
                          2,
                          3
                        ]
                      },
                      "meal_kind": {
                        "type": "string",
                        "enum": [
                          "regular",
                          "extra",
                          "snack",
                          "unassigned"
                        ]
                      }
                    }
                  },
                  {
                    "properties": {
                      "meal_times": {
                        "enum": [
                          4
                        ]
                      },
                      "meal_kind": {
                        "type": "string",
                        "enum": [
                          "night_snack",
                          "unassigned"
                        ]
                      }
                    }
                  },
                  {
                    "properties": {
                      "meal_times": {
                        "nullable": true,
                        "enum": [
                          null
                        ]
                      },
                      "meal_kind": {
                        "type": "string",
                        "enum": [
                          "unassigned"
                        ]
                      }
                    }
                  }
                ]
              },
              "examples": {
                "request": {
                  "value": {
                    "record_id": "example-value",
                    "expected_revision": 0,
                    "reason": "example-value",
                    "meal_date": "2026-09-11",
                    "meal_times": null,
                    "meal_kind": "unassigned",
                    "meal_time": null,
                    "foods": []
                  }
                }
              }
            }
          }
        }
      }
    },
    "/p/DietPhoto/mark": {
      "post": {
        "summary": "标记或取消疑似误识别",
        "operationId": "dietPhotoMark",
        "description": "## 接口概述\n标记或取消疑似误识别。本接口为VWCG-1354技术审核草案，未实现、未导入Apifox。\n\n## 接口信息\nPOST /p/DietPhoto/mark；store拥有，沿用PC后台会话。\n\n## 请求头（Header）\n沿用token请求头及现有PC会话；服务端验证原菜单、动作、人员/部门与租户范围，不依赖前端隐藏。\n\n## 请求参数\n- record_id（必填）：稳定UUID；须在当前租户和授权数据范围内\n- expected_revision（必填）：integer\n- suspected_error（必填）：boolean\n- reason（必填）：人工操作理由；trim后必填\n\n## 响应格式\n成功为code=0的JSON，任务状态独立在data.status；失败code=1并有error_code。\n标记不修改AI原结果，改变revision并审计；与识别执行状态独立。\n\n## 状态码或业务状态说明\n兼容原PC业务码；HTTP401/403/409/422/429/503均按失败处理，不显示成功。版本冲突刷新数据后人工重新提交，不自动覆盖；识别或导出失败保留原图与当前人工结果。\n\n## 响应字段说明\n结构化Schema为完整字段定义。null表示未知，不代表0。上传时间/原图/可信身份只读；列表和统计使用同一当前revision。\n\n## trace_id排查\n服务端生成trace_id贯穿请求/record/attempt/export，日志仅记录必要标识，不写token、原图base64或人员敏感明细。",
        "tags": [
          "膳食监控/饮食照片"
        ],
        "x-apifox-folder": "膳食监控/饮食照片",
        "security": [
          {
            "pcToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；异步动作只表示任务已接受，须读状态；旧风格业务错误需检查code",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer",
                          "enum": [
                            0
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": ""
                        },
                        "trace_id": {
                          "type": "string",
                          "description": ""
                        },
                        "data": {
                          "$ref": "#/components/schemas/Record"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message",
                        "trace_id",
                        "data"
                      ]
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "message": "example-value",
                      "trace_id": "example-value",
                      "data": {
                        "record_id": "example-value",
                        "staff_uuid": "example-value",
                        "revision": 0,
                        "uploaded_at": "2026-09-11T07:42:00+08:00",
                        "meal_date": "2026-09-11",
                        "meal_times": null,
                        "meal_kind": "regular",
                        "meal_time": null,
                        "photos": [],
                        "foods": [],
                        "current_origin": "ai",
                        "status": "pending",
                        "suspected_error": false,
                        "policy": {
                          "configured": "inherit",
                          "effective": "library",
                          "source_type": "person",
                          "source_uuid": null,
                          "revision": 0
                        },
                        "candidate_attempt_id": null,
                        "totals": {
                          "energy": null,
                          "protein": null,
                          "zinc": null,
                          "magnesium": null
                        },
                        "totals_status": {
                          "energy": "missing",
                          "protein": "missing",
                          "zinc": "missing",
                          "magnesium": "missing"
                        },
                        "current_result_status": "none"
                      }
                    }
                  },
                  "businessFailure": {
                    "value": {
                      "code": 1,
                      "message": "版本已更新，请刷新",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "未登录",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "未登录",
                      "error_code": "AUTH_REQUIRED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "越权",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "越权",
                      "error_code": "FORBIDDEN",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "记录或原图不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "记录或原图不存在",
                      "error_code": "NOT_FOUND",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "版本/幂等冲突",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "版本/幂等冲突",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "参数校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "参数校验失败",
                      "error_code": "VALIDATION_FAILED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求过多",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "请求过多",
                      "error_code": "RATE_LIMITED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "服务不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "服务不可用",
                      "error_code": "RECOGNIZER_UNAVAILABLE",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "record_id": {
                    "type": "string",
                    "description": "稳定UUID；须在当前租户和授权数据范围内",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "expected_revision": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "suspected_error": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": "string",
                    "description": "人工操作理由；trim后必填",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "additionalProperties": false,
                "required": [
                  "record_id",
                  "expected_revision",
                  "suspected_error",
                  "reason"
                ]
              },
              "examples": {
                "request": {
                  "value": {
                    "record_id": "example-value",
                    "expected_revision": 0,
                    "suspected_error": false,
                    "reason": "example-value"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/p/DietPhoto/recognize": {
      "post": {
        "summary": "后台发起识别或重新识别",
        "operationId": "dietPhotoRecognize",
        "description": "## 接口概述\n后台发起识别或重新识别。本接口为VWCG-1354技术审核草案，未实现、未导入Apifox。\n\n## 接口信息\nPOST /p/DietPhoto/recognize；store拥有，沿用PC后台会话。\n\n## 请求头（Header）\n沿用token请求头及现有PC会话；服务端验证原菜单、动作、人员/部门与租户范围，不依赖前端隐藏。\n\n## 请求参数\n- record_id（必填）：稳定UUID；须在当前租户和授权数据范围内\n- expected_revision（必填）：integer\n- request_id（必填）：稳定UUID；须在当前租户和授权数据范围内\n\n## 响应格式\n成功为code=0的JSON，任务状态独立在data.status；失败code=1并有error_code。\n同request_id同请求返回原attempt，不重复入队；不同请求同ID拒绝。新attempt冻结当前策略；同attempt技术重试保持快照。\n\n## 状态码或业务状态说明\n兼容原PC业务码；HTTP401/403/409/422/429/503均按失败处理，不显示成功。版本冲突刷新数据后人工重新提交，不自动覆盖；识别或导出失败保留原图与当前人工结果。\n\n## 响应字段说明\n结构化Schema为完整字段定义。null表示未知，不代表0。上传时间/原图/可信身份只读；列表和统计使用同一当前revision。\n\n## trace_id排查\n服务端生成trace_id贯穿请求/record/attempt/export，日志仅记录必要标识，不写token、原图base64或人员敏感明细。",
        "tags": [
          "膳食监控/饮食照片"
        ],
        "x-apifox-folder": "膳食监控/饮食照片",
        "security": [
          {
            "pcToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；异步动作只表示任务已接受，须读状态；旧风格业务错误需检查code",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer",
                          "enum": [
                            0
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": ""
                        },
                        "trace_id": {
                          "type": "string",
                          "description": ""
                        },
                        "data": {
                          "$ref": "#/components/schemas/Attempt"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message",
                        "trace_id",
                        "data"
                      ]
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "message": "example-value",
                      "trace_id": "example-value",
                      "data": {
                        "attempt_id": "example-value",
                        "record_id": "example-value",
                        "status": "queued",
                        "candidate": false,
                        "started_revision": 0,
                        "policy": {
                          "configured": "inherit",
                          "effective": "library",
                          "source_type": "person",
                          "source_uuid": null,
                          "revision": 0
                        },
                        "error_code": "example-value",
                        "foods": []
                      }
                    }
                  },
                  "businessFailure": {
                    "value": {
                      "code": 1,
                      "message": "版本已更新，请刷新",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "未登录",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "未登录",
                      "error_code": "AUTH_REQUIRED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "越权",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "越权",
                      "error_code": "FORBIDDEN",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "记录或原图不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "记录或原图不存在",
                      "error_code": "NOT_FOUND",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "版本/幂等冲突",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "版本/幂等冲突",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "参数校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "参数校验失败",
                      "error_code": "VALIDATION_FAILED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求过多",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "请求过多",
                      "error_code": "RATE_LIMITED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "服务不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "服务不可用",
                      "error_code": "RECOGNIZER_UNAVAILABLE",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "record_id": {
                    "type": "string",
                    "description": "稳定UUID；须在当前租户和授权数据范围内",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "expected_revision": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "request_id": {
                    "type": "string",
                    "description": "稳定UUID；须在当前租户和授权数据范围内",
                    "minLength": 1,
                    "maxLength": 64
                  }
                },
                "additionalProperties": false,
                "required": [
                  "record_id",
                  "expected_revision",
                  "request_id"
                ]
              },
              "examples": {
                "request": {
                  "value": {
                    "record_id": "example-value",
                    "expected_revision": 0,
                    "request_id": "example-value"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/p/DietPhoto/attempt": {
      "post": {
        "summary": "读取识别任务及候选",
        "operationId": "dietPhotoAttempt",
        "description": "## 接口概述\n读取识别任务及候选。本接口为VWCG-1354技术审核草案，未实现、未导入Apifox。\n\n## 接口信息\nPOST /p/DietPhoto/attempt；store拥有，沿用PC后台会话。\n\n## 请求头（Header）\n沿用token请求头及现有PC会话；服务端验证原菜单、动作、人员/部门与租户范围，不依赖前端隐藏。\n\n## 请求参数\n- attempt_id（必填）：稳定UUID；须在当前租户和授权数据范围内\n\n## 响应格式\n成功为code=0的JSON，任务状态独立在data.status；失败code=1并有error_code。\n任务回读仍验证record归属；AI运行中人工保存后，AI返回只形成候选。\n\n## 状态码或业务状态说明\n兼容原PC业务码；HTTP401/403/409/422/429/503均按失败处理，不显示成功。版本冲突刷新数据后人工重新提交，不自动覆盖；识别或导出失败保留原图与当前人工结果。\n\n## 响应字段说明\n结构化Schema为完整字段定义。null表示未知，不代表0。上传时间/原图/可信身份只读；列表和统计使用同一当前revision。\n\n## trace_id排查\n服务端生成trace_id贯穿请求/record/attempt/export，日志仅记录必要标识，不写token、原图base64或人员敏感明细。",
        "tags": [
          "膳食监控/饮食照片"
        ],
        "x-apifox-folder": "膳食监控/饮食照片",
        "security": [
          {
            "pcToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；异步动作只表示任务已接受，须读状态；旧风格业务错误需检查code",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer",
                          "enum": [
                            0
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": ""
                        },
                        "trace_id": {
                          "type": "string",
                          "description": ""
                        },
                        "data": {
                          "$ref": "#/components/schemas/Attempt"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message",
                        "trace_id",
                        "data"
                      ]
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "message": "example-value",
                      "trace_id": "example-value",
                      "data": {
                        "attempt_id": "example-value",
                        "record_id": "example-value",
                        "status": "queued",
                        "candidate": false,
                        "started_revision": 0,
                        "policy": {
                          "configured": "inherit",
                          "effective": "library",
                          "source_type": "person",
                          "source_uuid": null,
                          "revision": 0
                        },
                        "error_code": "example-value",
                        "foods": []
                      }
                    }
                  },
                  "businessFailure": {
                    "value": {
                      "code": 1,
                      "message": "版本已更新，请刷新",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "未登录",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "未登录",
                      "error_code": "AUTH_REQUIRED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "越权",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "越权",
                      "error_code": "FORBIDDEN",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "记录或原图不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "记录或原图不存在",
                      "error_code": "NOT_FOUND",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "版本/幂等冲突",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "版本/幂等冲突",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "参数校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "参数校验失败",
                      "error_code": "VALIDATION_FAILED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求过多",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "请求过多",
                      "error_code": "RATE_LIMITED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "服务不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "服务不可用",
                      "error_code": "RECOGNIZER_UNAVAILABLE",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "attempt_id": {
                    "type": "string",
                    "description": "稳定UUID；须在当前租户和授权数据范围内",
                    "minLength": 1,
                    "maxLength": 64
                  }
                },
                "additionalProperties": false,
                "required": [
                  "attempt_id"
                ]
              },
              "examples": {
                "request": {
                  "value": {
                    "attempt_id": "example-value"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/p/DietPhoto/adopt": {
      "post": {
        "summary": "明确采用新的AI候选",
        "operationId": "dietPhotoAdopt",
        "description": "## 接口概述\n明确采用新的AI候选。本接口为VWCG-1354技术审核草案，未实现、未导入Apifox。\n\n## 接口信息\nPOST /p/DietPhoto/adopt；store拥有，沿用PC后台会话。\n\n## 请求头（Header）\n沿用token请求头及现有PC会话；服务端验证原菜单、动作、人员/部门与租户范围，不依赖前端隐藏。\n\n## 请求参数\n- record_id（必填）：稳定UUID；须在当前租户和授权数据范围内\n- attempt_id（必填）：稳定UUID；须在当前租户和授权数据范围内\n- expected_revision（必填）：integer\n- reason（必填）：人工操作理由；trim后必填\n\n## 响应格式\n成功为code=0的JSON，任务状态独立在data.status；失败code=1并有error_code。\n验证attempt属于此记录且已完成、有可用候选；原子替换当前值与投影，保留修改前后及原AI。\n\n## 状态码或业务状态说明\n兼容原PC业务码；HTTP401/403/409/422/429/503均按失败处理，不显示成功。版本冲突刷新数据后人工重新提交，不自动覆盖；识别或导出失败保留原图与当前人工结果。\n\n## 响应字段说明\n结构化Schema为完整字段定义。null表示未知，不代表0。上传时间/原图/可信身份只读；列表和统计使用同一当前revision。\n\n## trace_id排查\n服务端生成trace_id贯穿请求/record/attempt/export，日志仅记录必要标识，不写token、原图base64或人员敏感明细。",
        "tags": [
          "膳食监控/饮食照片"
        ],
        "x-apifox-folder": "膳食监控/饮食照片",
        "security": [
          {
            "pcToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；异步动作只表示任务已接受，须读状态；旧风格业务错误需检查code",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer",
                          "enum": [
                            0
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": ""
                        },
                        "trace_id": {
                          "type": "string",
                          "description": ""
                        },
                        "data": {
                          "$ref": "#/components/schemas/Record"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message",
                        "trace_id",
                        "data"
                      ]
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "message": "example-value",
                      "trace_id": "example-value",
                      "data": {
                        "record_id": "example-value",
                        "staff_uuid": "example-value",
                        "revision": 0,
                        "uploaded_at": "2026-09-11T07:42:00+08:00",
                        "meal_date": "2026-09-11",
                        "meal_times": null,
                        "meal_kind": "regular",
                        "meal_time": null,
                        "photos": [],
                        "foods": [],
                        "current_origin": "ai",
                        "status": "pending",
                        "suspected_error": false,
                        "policy": {
                          "configured": "inherit",
                          "effective": "library",
                          "source_type": "person",
                          "source_uuid": null,
                          "revision": 0
                        },
                        "candidate_attempt_id": null,
                        "totals": {
                          "energy": null,
                          "protein": null,
                          "zinc": null,
                          "magnesium": null
                        },
                        "totals_status": {
                          "energy": "missing",
                          "protein": "missing",
                          "zinc": "missing",
                          "magnesium": "missing"
                        },
                        "current_result_status": "none"
                      }
                    }
                  },
                  "businessFailure": {
                    "value": {
                      "code": 1,
                      "message": "版本已更新，请刷新",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "未登录",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "未登录",
                      "error_code": "AUTH_REQUIRED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "越权",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "越权",
                      "error_code": "FORBIDDEN",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "记录或原图不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "记录或原图不存在",
                      "error_code": "NOT_FOUND",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "版本/幂等冲突",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "版本/幂等冲突",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "参数校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "参数校验失败",
                      "error_code": "VALIDATION_FAILED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求过多",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "请求过多",
                      "error_code": "RATE_LIMITED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "服务不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "服务不可用",
                      "error_code": "RECOGNIZER_UNAVAILABLE",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "record_id": {
                    "type": "string",
                    "description": "稳定UUID；须在当前租户和授权数据范围内",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "attempt_id": {
                    "type": "string",
                    "description": "稳定UUID；须在当前租户和授权数据范围内",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "expected_revision": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "reason": {
                    "type": "string",
                    "description": "人工操作理由；trim后必填",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "additionalProperties": false,
                "required": [
                  "record_id",
                  "attempt_id",
                  "expected_revision",
                  "reason"
                ]
              },
              "examples": {
                "request": {
                  "value": {
                    "record_id": "example-value",
                    "attempt_id": "example-value",
                    "expected_revision": 0,
                    "reason": "example-value"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/p/DietPhoto/history": {
      "post": {
        "summary": "读取人工修改历史",
        "operationId": "dietPhotoHistory",
        "description": "## 接口概述\n读取人工修改历史。本接口为VWCG-1354技术审核草案，未实现、未导入Apifox。\n\n## 接口信息\nPOST /p/DietPhoto/history；store拥有，沿用PC后台会话。\n\n## 请求头（Header）\n沿用token请求头及现有PC会话；服务端验证原菜单、动作、人员/部门与租户范围，不依赖前端隐藏。\n\n## 请求参数\n- record_id（必填）：稳定UUID；须在当前租户和授权数据范围内\n- page（可选）：integer\n\n## 响应格式\n成功为code=0的JSON，任务状态独立在data.status；失败code=1并有error_code。\n仅返回授权记录审计；历史不可修改。\n\n## 状态码或业务状态说明\n兼容原PC业务码；HTTP401/403/409/422/429/503均按失败处理，不显示成功。版本冲突刷新数据后人工重新提交，不自动覆盖；识别或导出失败保留原图与当前人工结果。\n\n## 响应字段说明\n结构化Schema为完整字段定义。null表示未知，不代表0。上传时间/原图/可信身份只读；列表和统计使用同一当前revision。\n\n## trace_id排查\n服务端生成trace_id贯穿请求/record/attempt/export，日志仅记录必要标识，不写token、原图base64或人员敏感明细。",
        "tags": [
          "膳食监控/饮食照片"
        ],
        "x-apifox-folder": "膳食监控/饮食照片",
        "security": [
          {
            "pcToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；异步动作只表示任务已接受，须读状态；旧风格业务错误需检查code",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer",
                          "enum": [
                            0
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": ""
                        },
                        "trace_id": {
                          "type": "string",
                          "description": ""
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "rows": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Audit"
                              }
                            },
                            "total": {
                              "type": "integer"
                            }
                          },
                          "additionalProperties": false,
                          "required": [
                            "rows",
                            "total"
                          ]
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message",
                        "trace_id",
                        "data"
                      ]
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "message": "example-value",
                      "trace_id": "example-value",
                      "data": {
                        "rows": [],
                        "total": 0
                      }
                    }
                  },
                  "businessFailure": {
                    "value": {
                      "code": 1,
                      "message": "版本已更新，请刷新",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "未登录",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "未登录",
                      "error_code": "AUTH_REQUIRED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "越权",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "越权",
                      "error_code": "FORBIDDEN",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "记录或原图不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "记录或原图不存在",
                      "error_code": "NOT_FOUND",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "版本/幂等冲突",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "版本/幂等冲突",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "参数校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "参数校验失败",
                      "error_code": "VALIDATION_FAILED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求过多",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "请求过多",
                      "error_code": "RATE_LIMITED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "服务不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "服务不可用",
                      "error_code": "RECOGNIZER_UNAVAILABLE",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "record_id": {
                    "type": "string",
                    "description": "稳定UUID；须在当前租户和授权数据范围内",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "page": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 1
                  }
                },
                "additionalProperties": false,
                "required": [
                  "record_id"
                ]
              },
              "examples": {
                "request": {
                  "value": {
                    "record_id": "example-value"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/p/DietPhoto/policy": {
      "post": {
        "summary": "读取来源配置及继承结果",
        "operationId": "dietPhotoPolicy",
        "description": "## 接口概述\n读取来源配置及继承结果。本接口为VWCG-1354技术审核草案，未实现、未导入Apifox。\n\n## 接口信息\nPOST /p/DietPhoto/policy；store拥有，沿用PC后台会话。\n\n## 请求头（Header）\n沿用token请求头及现有PC会话；服务端验证原菜单、动作、人员/部门与租户范围，不依赖前端隐藏。\n\n## 请求参数\n- target_type（必填）：string\n- target_uuid（必填）：稳定UUID；须在当前租户和授权数据范围内\n\n## 响应格式\n成功为code=0的JSON，任务状态独立在data.status；失败code=1并有error_code。\n个人覆盖→所属组织→祖先→library；多部门模式冲突不随机选，返回policy_conflict。\n\n## 状态码或业务状态说明\n兼容原PC业务码；HTTP401/403/409/422/429/503均按失败处理，不显示成功。版本冲突刷新数据后人工重新提交，不自动覆盖；识别或导出失败保留原图与当前人工结果。\n\n## 响应字段说明\n结构化Schema为完整字段定义。null表示未知，不代表0。上传时间/原图/可信身份只读；列表和统计使用同一当前revision。\n\n## trace_id排查\n服务端生成trace_id贯穿请求/record/attempt/export，日志仅记录必要标识，不写token、原图base64或人员敏感明细。",
        "tags": [
          "膳食监控/饮食照片"
        ],
        "x-apifox-folder": "膳食监控/饮食照片",
        "security": [
          {
            "pcToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；异步动作只表示任务已接受，须读状态；旧风格业务错误需检查code",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer",
                          "enum": [
                            0
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": ""
                        },
                        "trace_id": {
                          "type": "string",
                          "description": ""
                        },
                        "data": {
                          "$ref": "#/components/schemas/Policy"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message",
                        "trace_id",
                        "data"
                      ]
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "message": "example-value",
                      "trace_id": "example-value",
                      "data": {
                        "configured": "inherit",
                        "effective": "library",
                        "source_type": "person",
                        "source_uuid": null,
                        "revision": 0
                      }
                    }
                  },
                  "businessFailure": {
                    "value": {
                      "code": 1,
                      "message": "版本已更新，请刷新",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "未登录",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "未登录",
                      "error_code": "AUTH_REQUIRED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "越权",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "越权",
                      "error_code": "FORBIDDEN",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "记录或原图不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "记录或原图不存在",
                      "error_code": "NOT_FOUND",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "版本/幂等冲突",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "版本/幂等冲突",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "参数校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "参数校验失败",
                      "error_code": "VALIDATION_FAILED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求过多",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "请求过多",
                      "error_code": "RATE_LIMITED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "服务不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "服务不可用",
                      "error_code": "RECOGNIZER_UNAVAILABLE",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target_type": {
                    "type": "string",
                    "enum": [
                      "person",
                      "department"
                    ]
                  },
                  "target_uuid": {
                    "type": "string",
                    "description": "稳定UUID；须在当前租户和授权数据范围内",
                    "minLength": 1,
                    "maxLength": 64
                  }
                },
                "additionalProperties": false,
                "required": [
                  "target_type",
                  "target_uuid"
                ]
              },
              "examples": {
                "request": {
                  "value": {
                    "target_type": "person",
                    "target_uuid": "example-value"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/p/DietPhoto/savePolicy": {
      "post": {
        "summary": "设置组织或人员识别来源",
        "operationId": "dietPhotoSavePolicy",
        "description": "## 接口概述\n设置组织或人员识别来源。本接口为VWCG-1354技术审核草案，未实现、未导入Apifox。\n\n## 接口信息\nPOST /p/DietPhoto/savePolicy；store拥有，沿用PC后台会话。\n\n## 请求头（Header）\n沿用token请求头及现有PC会话；服务端验证原菜单、动作、人员/部门与租户范围，不依赖前端隐藏。\n\n## 请求参数\n- target_type（必填）：string\n- target_uuid（必填）：稳定UUID；须在当前租户和授权数据范围内\n- mode（必填）：string\n- expected_revision（必填）：integer\n\n## 响应格式\n成功为code=0的JSON，任务状态独立在data.status；失败code=1并有error_code。\n无显式配置时revision=0；以唯一目标及revision防冲突。修改仅影响下一次attempt，历史快照不变。\n\n## 状态码或业务状态说明\n兼容原PC业务码；HTTP401/403/409/422/429/503均按失败处理，不显示成功。版本冲突刷新数据后人工重新提交，不自动覆盖；识别或导出失败保留原图与当前人工结果。\n\n## 响应字段说明\n结构化Schema为完整字段定义。null表示未知，不代表0。上传时间/原图/可信身份只读；列表和统计使用同一当前revision。\n\n## trace_id排查\n服务端生成trace_id贯穿请求/record/attempt/export，日志仅记录必要标识，不写token、原图base64或人员敏感明细。",
        "tags": [
          "膳食监控/饮食照片"
        ],
        "x-apifox-folder": "膳食监控/饮食照片",
        "security": [
          {
            "pcToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；异步动作只表示任务已接受，须读状态；旧风格业务错误需检查code",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer",
                          "enum": [
                            0
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": ""
                        },
                        "trace_id": {
                          "type": "string",
                          "description": ""
                        },
                        "data": {
                          "$ref": "#/components/schemas/Policy"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message",
                        "trace_id",
                        "data"
                      ]
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "message": "example-value",
                      "trace_id": "example-value",
                      "data": {
                        "configured": "inherit",
                        "effective": "library",
                        "source_type": "person",
                        "source_uuid": null,
                        "revision": 0
                      }
                    }
                  },
                  "businessFailure": {
                    "value": {
                      "code": 1,
                      "message": "版本已更新，请刷新",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "未登录",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "未登录",
                      "error_code": "AUTH_REQUIRED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "越权",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "越权",
                      "error_code": "FORBIDDEN",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "记录或原图不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "记录或原图不存在",
                      "error_code": "NOT_FOUND",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "版本/幂等冲突",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "版本/幂等冲突",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "参数校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "参数校验失败",
                      "error_code": "VALIDATION_FAILED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求过多",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "请求过多",
                      "error_code": "RATE_LIMITED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "服务不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "服务不可用",
                      "error_code": "RECOGNIZER_UNAVAILABLE",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target_type": {
                    "type": "string",
                    "enum": [
                      "person",
                      "department"
                    ]
                  },
                  "target_uuid": {
                    "type": "string",
                    "description": "稳定UUID；须在当前租户和授权数据范围内",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "inherit",
                      "library",
                      "web"
                    ]
                  },
                  "expected_revision": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "additionalProperties": false,
                "required": [
                  "target_type",
                  "target_uuid",
                  "mode",
                  "expected_revision"
                ]
              },
              "examples": {
                "request": {
                  "value": {
                    "target_type": "person",
                    "target_uuid": "example-value",
                    "mode": "inherit",
                    "expected_revision": 0
                  }
                }
              }
            }
          }
        }
      }
    },
    "/p/DietPhoto/exportCreate": {
      "post": {
        "summary": "按部门与日期创建图片数据ZIP",
        "operationId": "dietPhotoExportCreate",
        "description": "## 接口概述\n按部门与日期创建图片数据ZIP。本接口为VWCG-1354技术审核草案，未实现、未导入Apifox。\n\n## 接口信息\nPOST /p/DietPhoto/exportCreate；store拥有，沿用PC后台会话。\n\n## 请求头（Header）\n沿用token请求头及现有PC会话；服务端验证原菜单、动作、人员/部门与租户范围，不依赖前端隐藏。\n\n## 请求参数\n- department_uuid（必填）：稳定UUID；须在当前租户和授权数据范围内\n- date_from（必填）：date\n- date_to（必填）：date\n- request_id（必填）：稳定UUID；须在当前租户和授权数据范围内\n\n## 响应格式\n成功为code=0的JSON，任务状态独立在data.status；失败code=1并有error_code。\n范围固定包含下级部门所有有效人员，无上传人员仍入清单；与当前查看人无关。冻结数据快照后异步生成，包含全部约定CSV、原图和manifest。\n\n## 状态码或业务状态说明\n兼容原PC业务码；HTTP401/403/409/422/429/503均按失败处理，不显示成功。版本冲突刷新数据后人工重新提交，不自动覆盖；识别或导出失败保留原图与当前人工结果。\n\n## 响应字段说明\n结构化Schema为完整字段定义。null表示未知，不代表0。上传时间/原图/可信身份只读；列表和统计使用同一当前revision。\n\n## trace_id排查\n服务端生成trace_id贯穿请求/record/attempt/export，日志仅记录必要标识，不写token、原图base64或人员敏感明细。",
        "tags": [
          "膳食监控/饮食照片"
        ],
        "x-apifox-folder": "膳食监控/饮食照片",
        "security": [
          {
            "pcToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；异步动作只表示任务已接受，须读状态；旧风格业务错误需检查code",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer",
                          "enum": [
                            0
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": ""
                        },
                        "trace_id": {
                          "type": "string",
                          "description": ""
                        },
                        "data": {
                          "$ref": "#/components/schemas/Export"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message",
                        "trace_id",
                        "data"
                      ]
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "message": "example-value",
                      "trace_id": "example-value",
                      "data": {
                        "export_id": "example-value",
                        "status": "queued",
                        "progress": 0,
                        "person_count": 0,
                        "record_count": 0,
                        "image_count": 0,
                        "missing_images": 0,
                        "download_path": null,
                        "expires_at": null,
                        "error_code": "example-value",
                        "expected_images": 0,
                        "manifest_path": null,
                        "failure_summary": [],
                        "department_uuid": "example-value",
                        "date_from": "2026-09-11",
                        "date_to": "2026-09-11",
                        "snapshot_at": null
                      }
                    }
                  },
                  "businessFailure": {
                    "value": {
                      "code": 1,
                      "message": "版本已更新，请刷新",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "未登录",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "未登录",
                      "error_code": "AUTH_REQUIRED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "越权",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "越权",
                      "error_code": "FORBIDDEN",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "记录或原图不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "记录或原图不存在",
                      "error_code": "NOT_FOUND",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "版本/幂等冲突",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "版本/幂等冲突",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "参数校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "参数校验失败",
                      "error_code": "VALIDATION_FAILED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求过多",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "请求过多",
                      "error_code": "RATE_LIMITED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "服务不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "服务不可用",
                      "error_code": "RECOGNIZER_UNAVAILABLE",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "department_uuid": {
                    "type": "string",
                    "description": "稳定UUID；须在当前租户和授权数据范围内",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "date_from": {
                    "type": "string",
                    "format": "date"
                  },
                  "date_to": {
                    "type": "string",
                    "format": "date"
                  },
                  "request_id": {
                    "type": "string",
                    "description": "稳定UUID；须在当前租户和授权数据范围内",
                    "minLength": 1,
                    "maxLength": 64
                  }
                },
                "additionalProperties": false,
                "required": [
                  "department_uuid",
                  "date_from",
                  "date_to",
                  "request_id"
                ]
              },
              "examples": {
                "request": {
                  "value": {
                    "department_uuid": "example-value",
                    "date_from": "2026-09-11",
                    "date_to": "2026-09-11",
                    "request_id": "example-value"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/p/DietPhoto/exportStatus": {
      "post": {
        "summary": "查询部门导出进度",
        "operationId": "dietPhotoExportStatus",
        "description": "## 接口概述\n查询部门导出进度。本接口为VWCG-1354技术审核草案，未实现、未导入Apifox。\n\n## 接口信息\nPOST /p/DietPhoto/exportStatus；store拥有，沿用PC后台会话。\n\n## 请求头（Header）\n沿用token请求头及现有PC会话；服务端验证原菜单、动作、人员/部门与租户范围，不依赖前端隐藏。\n\n## 请求参数\n- export_id（必填）：稳定UUID；须在当前租户和授权数据范围内\n\n## 响应格式\n成功为code=0的JSON，任务状态独立在data.status；失败code=1并有error_code。\n仅请求人及受权角色可读；缺图为partial，有缺图清单；不能把部分失败标为complete。\n\n## 状态码或业务状态说明\n兼容原PC业务码；HTTP401/403/409/422/429/503均按失败处理，不显示成功。版本冲突刷新数据后人工重新提交，不自动覆盖；识别或导出失败保留原图与当前人工结果。\n\n## 响应字段说明\n结构化Schema为完整字段定义。null表示未知，不代表0。上传时间/原图/可信身份只读；列表和统计使用同一当前revision。\n\n## trace_id排查\n服务端生成trace_id贯穿请求/record/attempt/export，日志仅记录必要标识，不写token、原图base64或人员敏感明细。",
        "tags": [
          "膳食监控/饮食照片"
        ],
        "x-apifox-folder": "膳食监控/饮食照片",
        "security": [
          {
            "pcToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；异步动作只表示任务已接受，须读状态；旧风格业务错误需检查code",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer",
                          "enum": [
                            0
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": ""
                        },
                        "trace_id": {
                          "type": "string",
                          "description": ""
                        },
                        "data": {
                          "$ref": "#/components/schemas/Export"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message",
                        "trace_id",
                        "data"
                      ]
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "message": "example-value",
                      "trace_id": "example-value",
                      "data": {
                        "export_id": "example-value",
                        "status": "queued",
                        "progress": 0,
                        "person_count": 0,
                        "record_count": 0,
                        "image_count": 0,
                        "missing_images": 0,
                        "download_path": null,
                        "expires_at": null,
                        "error_code": "example-value",
                        "expected_images": 0,
                        "manifest_path": null,
                        "failure_summary": [],
                        "department_uuid": "example-value",
                        "date_from": "2026-09-11",
                        "date_to": "2026-09-11",
                        "snapshot_at": null
                      }
                    }
                  },
                  "businessFailure": {
                    "value": {
                      "code": 1,
                      "message": "版本已更新，请刷新",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "未登录",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "未登录",
                      "error_code": "AUTH_REQUIRED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "越权",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "越权",
                      "error_code": "FORBIDDEN",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "记录或原图不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "记录或原图不存在",
                      "error_code": "NOT_FOUND",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "版本/幂等冲突",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "版本/幂等冲突",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "参数校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "参数校验失败",
                      "error_code": "VALIDATION_FAILED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求过多",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "请求过多",
                      "error_code": "RATE_LIMITED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "服务不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "服务不可用",
                      "error_code": "RECOGNIZER_UNAVAILABLE",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "export_id": {
                    "type": "string",
                    "description": "稳定UUID；须在当前租户和授权数据范围内",
                    "minLength": 1,
                    "maxLength": 64
                  }
                },
                "additionalProperties": false,
                "required": [
                  "export_id"
                ]
              },
              "examples": {
                "request": {
                  "value": {
                    "export_id": "example-value"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/p/DietPhoto/exportDownload": {
      "get": {
        "summary": "下载已完成的部门ZIP",
        "operationId": "dietPhotoExportDownload",
        "description": "## 接口概述\n下载已完成的部门ZIP。本接口为VWCG-1354技术审核草案，未实现、未导入Apifox。\n\n## 接口信息\nGET /p/DietPhoto/exportDownload；store拥有，沿用PC后台会话。\n\n## 请求头（Header）\n沿用token请求头及现有PC会话；服务端验证原菜单、动作、人员/部门与租户范围，不依赖前端隐藏。\n\n## 请求参数\n- export_id（必填）：稳定UUID；须在当前租户和授权数据范围内\n\n## 响应格式\n成功为code=0的JSON，任务状态独立在data.status；失败code=1并有error_code。二进制成功响应见application/zip或图片内容。\n下载时再次校验登录、发起人/任务范围、部门权限和有效期；撤权拒绝；Content-Disposition使用安全文件名；不返回永久公开URL。\n\n## 状态码或业务状态说明\n兼容原PC业务码；HTTP401/403/409/422/429/503均按失败处理，不显示成功。版本冲突刷新数据后人工重新提交，不自动覆盖；识别或导出失败保留原图与当前人工结果。\n\n## 响应字段说明\n结构化Schema为完整字段定义。null表示未知，不代表0。上传时间/原图/可信身份只读；列表和统计使用同一当前revision。\n\n## trace_id排查\n服务端生成trace_id贯穿请求/record/attempt/export，日志仅记录必要标识，不写token、原图base64或人员敏感明细。",
        "tags": [
          "膳食监控/饮食照片"
        ],
        "x-apifox-folder": "膳食监控/饮食照片",
        "security": [
          {
            "pcToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；异步动作只表示任务已接受，须读状态；旧风格业务错误需检查code",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "legacyFailure": {
                    "value": {
                      "code": 1,
                      "message": "无权下载",
                      "error_code": "FORBIDDEN",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "未登录",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "未登录",
                      "error_code": "AUTH_REQUIRED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "越权",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "越权",
                      "error_code": "FORBIDDEN",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "记录或原图不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "记录或原图不存在",
                      "error_code": "NOT_FOUND",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "版本/幂等冲突",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "版本/幂等冲突",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "参数校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "参数校验失败",
                      "error_code": "VALIDATION_FAILED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求过多",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "请求过多",
                      "error_code": "RATE_LIMITED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "服务不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "服务不可用",
                      "error_code": "RECOGNIZER_UNAVAILABLE",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "导出已过期",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "expired": {
                    "value": {
                      "code": 1,
                      "message": "导出已过期",
                      "error_code": "EXPORT_EXPIRED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "export_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "稳定UUID；须在当前租户和授权数据范围内",
              "minLength": 1,
              "maxLength": 64
            }
          }
        ]
      }
    },
    "/p/DietPhoto/photo": {
      "get": {
        "summary": "查看授权记录原图",
        "operationId": "dietPhotoPhoto",
        "description": "## 接口概述\n查看授权记录原图。本接口为VWCG-1354技术审核草案，未实现、未导入Apifox。\n\n## 接口信息\nGET /p/DietPhoto/photo；store拥有，沿用PC后台会话。\n\n## 请求头（Header）\n沿用token请求头及现有PC会话；服务端验证原菜单、动作、人员/部门与租户范围，不依赖前端隐藏。\n\n## 请求参数\n- record_id（必填）：稳定UUID；须在当前租户和授权数据范围内\n- photo_id（必填）：稳定UUID；须在当前租户和授权数据范围内\n\n## 响应格式\n成功为code=0的JSON，任务状态独立在data.status；失败code=1并有error_code。二进制成功响应见application/zip或图片内容。\n只从记录已验证的storage_ref取图；禁止任意URL参数和内网抓取。缺图明确404；授权后流式返回原图。\n\n## 状态码或业务状态说明\n兼容原PC业务码；HTTP401/403/409/422/429/503均按失败处理，不显示成功。版本冲突刷新数据后人工重新提交，不自动覆盖；识别或导出失败保留原图与当前人工结果。\n\n## 响应字段说明\n结构化Schema为完整字段定义。null表示未知，不代表0。上传时间/原图/可信身份只读；列表和统计使用同一当前revision。\n\n## trace_id排查\n服务端生成trace_id贯穿请求/record/attempt/export，日志仅记录必要标识，不写token、原图base64或人员敏感明细。",
        "tags": [
          "膳食监控/饮食照片"
        ],
        "x-apifox-folder": "膳食监控/饮食照片",
        "security": [
          {
            "pcToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；异步动作只表示任务已接受，须读状态；旧风格业务错误需检查code",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "legacyFailure": {
                    "value": {
                      "code": 1,
                      "message": "无权下载",
                      "error_code": "FORBIDDEN",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "未登录",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "未登录",
                      "error_code": "AUTH_REQUIRED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "越权",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "越权",
                      "error_code": "FORBIDDEN",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "记录或原图不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "记录或原图不存在",
                      "error_code": "NOT_FOUND",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "版本/幂等冲突",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "版本/幂等冲突",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "参数校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "参数校验失败",
                      "error_code": "VALIDATION_FAILED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求过多",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "请求过多",
                      "error_code": "RATE_LIMITED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "服务不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "服务不可用",
                      "error_code": "RECOGNIZER_UNAVAILABLE",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "record_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "稳定UUID；须在当前租户和授权数据范围内",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "photo_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "稳定UUID；须在当前租户和授权数据范围内",
              "minLength": 1,
              "maxLength": 64
            }
          }
        ]
      }
    },
    "/p/DietPhoto/exportManifest": {
      "post": {
        "summary": "回读导出快照与缺失清单",
        "operationId": "dietPhotoExportManifest",
        "description": "## 接口概述\n回读导出快照与缺失清单。本接口为VWCG-1354技术审核草案，未实现、未导入Apifox。\n\n## 接口信息\nPOST /p/DietPhoto/exportManifest；store拥有，沿用PC后台会话。\n\n## 请求头（Header）\n沿用token请求头及现有PC会话；服务端验证原菜单、动作、人员/部门与租户范围，不依赖前端隐藏。\n\n## 请求参数\n- export_id（必填）：稳定UUID；须在当前租户和授权数据范围内\n\n## 响应格式\n成功为code=0的JSON，任务状态独立在data.status；失败code=1并有error_code。\ncomplete/partial允许下载；必需数据集失败使任务failed。整个快照范围必须仍被授权；过期拒绝。\n\n## 状态码或业务状态说明\n兼容原PC业务码；HTTP401/403/409/422/429/503均按失败处理，不显示成功。版本冲突刷新数据后人工重新提交，不自动覆盖；识别或导出失败保留原图与当前人工结果。\n\n## 响应字段说明\n结构化Schema为完整字段定义。null表示未知，不代表0。上传时间/原图/可信身份只读；列表和统计使用同一当前revision。\n\n## trace_id排查\n服务端生成trace_id贯穿请求/record/attempt/export，日志仅记录必要标识，不写token、原图base64或人员敏感明细。",
        "tags": [
          "膳食监控/饮食照片"
        ],
        "x-apifox-folder": "膳食监控/饮食照片",
        "security": [
          {
            "pcToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；异步动作只表示任务已接受，须读状态；旧风格业务错误需检查code",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer",
                          "enum": [
                            0
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": ""
                        },
                        "trace_id": {
                          "type": "string",
                          "description": ""
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "schema_version": {
                              "type": "integer",
                              "enum": [
                                1
                              ]
                            },
                            "export": {
                              "$ref": "#/components/schemas/Export"
                            },
                            "datasets": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string",
                                    "description": ""
                                  },
                                  "rows": {
                                    "type": "integer",
                                    "minimum": 0
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "complete",
                                      "failed"
                                    ]
                                  },
                                  "error": {
                                    "type": "string",
                                    "description": "",
                                    "nullable": true
                                  }
                                },
                                "additionalProperties": false,
                                "required": [
                                  "name",
                                  "rows",
                                  "status",
                                  "error"
                                ]
                              }
                            },
                            "images": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "photo_id": {
                                    "type": "string",
                                    "description": "稳定UUID；须在当前租户和授权数据范围内",
                                    "minLength": 1,
                                    "maxLength": 64
                                  },
                                  "path": {
                                    "type": "string",
                                    "description": ""
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "packed",
                                      "missing",
                                      "failed"
                                    ]
                                  },
                                  "reason": {
                                    "type": "string",
                                    "description": "",
                                    "nullable": true
                                  }
                                },
                                "additionalProperties": false,
                                "required": [
                                  "photo_id",
                                  "path",
                                  "status",
                                  "reason"
                                ]
                              }
                            }
                          },
                          "additionalProperties": false,
                          "required": [
                            "schema_version",
                            "export",
                            "datasets",
                            "images"
                          ]
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message",
                        "trace_id",
                        "data"
                      ]
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "message": "example-value",
                      "trace_id": "example-value",
                      "data": {
                        "schema_version": 1,
                        "export": {
                          "export_id": "example-value",
                          "status": "queued",
                          "progress": 0,
                          "person_count": 0,
                          "record_count": 0,
                          "image_count": 0,
                          "missing_images": 0,
                          "download_path": null,
                          "expires_at": null,
                          "error_code": "example-value",
                          "expected_images": 0,
                          "manifest_path": null,
                          "failure_summary": [],
                          "department_uuid": "example-value",
                          "date_from": "2026-09-11",
                          "date_to": "2026-09-11",
                          "snapshot_at": null
                        },
                        "datasets": [],
                        "images": []
                      }
                    }
                  },
                  "businessFailure": {
                    "value": {
                      "code": 1,
                      "message": "版本已更新，请刷新",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "未登录",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "未登录",
                      "error_code": "AUTH_REQUIRED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "越权",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "越权",
                      "error_code": "FORBIDDEN",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "记录或原图不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "记录或原图不存在",
                      "error_code": "NOT_FOUND",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "版本/幂等冲突",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "版本/幂等冲突",
                      "error_code": "REVISION_CONFLICT",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "参数校验失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "参数校验失败",
                      "error_code": "VALIDATION_FAILED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求过多",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "请求过多",
                      "error_code": "RATE_LIMITED",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "服务不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 1,
                      "message": "服务不可用",
                      "error_code": "RECOGNIZER_UNAVAILABLE",
                      "trace_id": "trace-example",
                      "data": {}
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "export_id": {
                    "type": "string",
                    "description": "稳定UUID；须在当前租户和授权数据范围内",
                    "minLength": 1,
                    "maxLength": 64
                  }
                },
                "additionalProperties": false,
                "required": [
                  "export_id"
                ]
              },
              "examples": {
                "request": {
                  "value": {
                    "export_id": "example-value"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "pcToken": {
        "type": "apiKey",
        "in": "header",
        "name": "token"
      }
    },
    "schemas": {
      "Nutrients": {
        "type": "object",
        "properties": {
          "energy": {
            "type": "number",
            "minimum": 0,
            "nullable": true,
            "description": "kcal；未知null"
          },
          "protein": {
            "type": "number",
            "minimum": 0,
            "nullable": true,
            "description": "g；未知null"
          },
          "zinc": {
            "type": "number",
            "minimum": 0,
            "nullable": true,
            "description": "mg；未知null"
          },
          "magnesium": {
            "type": "number",
            "minimum": 0,
            "nullable": true,
            "description": "mg；未知null"
          }
        },
        "additionalProperties": false,
        "required": [
          "energy",
          "protein",
          "zinc",
          "magnesium"
        ]
      },
      "Ingredient": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "food_id": {
                "type": "string",
                "description": "稳定UUID；须在当前租户和授权数据范围内",
                "minLength": 1,
                "maxLength": 64
              },
              "composition_id": {
                "type": "string",
                "description": "稳定UUID；须在当前租户和授权数据范围内",
                "minLength": 1,
                "maxLength": 64
              },
              "name": {
                "type": "string",
                "description": ""
              },
              "weight_g": {
                "type": "number",
                "minimum": 0,
                "nullable": true,
                "description": "有限非负数；未知为null，不可用0代替"
              },
              "composition_version": {
                "type": "string",
                "description": "可追溯成分版本",
                "minLength": 1
              },
              "basis": {
                "type": "string",
                "description": "生/熟、可食部及基准单位，缺失时不能判matched",
                "minLength": 1
              },
              "match_status": {
                "type": "string",
                "enum": [
                  "matched"
                ]
              },
              "nutrients": {
                "$ref": "#/components/schemas/Nutrients"
              },
              "basis_amount_g": {
                "type": "number",
                "exclusiveMinimum": true,
                "minimum": 0
              },
              "food_state": {
                "type": "string",
                "enum": [
                  "raw",
                  "cooked"
                ]
              },
              "edible_ratio": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "cooking_ratio": {
                "type": "number",
                "minimum": 0,
                "exclusiveMinimum": true
              }
            },
            "additionalProperties": false,
            "required": [
              "food_id",
              "composition_id",
              "name",
              "weight_g",
              "composition_version",
              "basis",
              "match_status",
              "nutrients",
              "basis_amount_g",
              "food_state",
              "edible_ratio",
              "cooking_ratio"
            ]
          },
          {
            "type": "object",
            "properties": {
              "food_id": {
                "type": "string",
                "description": "稳定UUID；须在当前租户和授权数据范围内",
                "minLength": 1,
                "maxLength": 64
              },
              "composition_id": {
                "type": "string",
                "description": "稳定UUID；须在当前租户和授权数据范围内",
                "minLength": 1,
                "maxLength": 64
              },
              "name": {
                "type": "string",
                "description": ""
              },
              "weight_g": {
                "type": "number",
                "minimum": 0,
                "nullable": true,
                "description": "有限非负数；未知为null，不可用0代替"
              },
              "composition_version": {
                "type": "string",
                "description": ""
              },
              "basis": {
                "type": "string",
                "description": "生/熟、可食部与基准单位"
              },
              "match_status": {
                "type": "string",
                "enum": [
                  "partial",
                  "missing"
                ]
              },
              "nutrients": {
                "$ref": "#/components/schemas/Nutrients"
              },
              "basis_amount_g": {
                "type": "number",
                "exclusiveMinimum": true,
                "minimum": 0
              },
              "food_state": {
                "type": "string",
                "enum": [
                  "raw",
                  "cooked"
                ]
              },
              "edible_ratio": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "cooking_ratio": {
                "type": "number",
                "minimum": 0,
                "exclusiveMinimum": true
              }
            },
            "additionalProperties": false,
            "required": [
              "name",
              "weight_g",
              "match_status",
              "nutrients"
            ]
          }
        ]
      },
      "Food": {
        "type": "object",
        "properties": {
          "item_id": {
            "type": "string",
            "description": "稳定UUID；须在当前租户和授权数据范围内",
            "minLength": 1,
            "maxLength": 64
          },
          "dish_id": {
            "type": "string",
            "description": "稳定UUID；须在当前租户和授权数据范围内",
            "minLength": 1,
            "maxLength": 64,
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "",
            "minLength": 1,
            "maxLength": 100
          },
          "weight_g": {
            "type": "number",
            "minimum": 0,
            "nullable": true,
            "description": "有限非负数；未知为null，不可用0代替"
          },
          "portion_estimated": {
            "type": "boolean"
          },
          "nutrients": {
            "$ref": "#/components/schemas/Nutrients"
          },
          "nutrient_status": {
            "$ref": "#/components/schemas/NutrientStatus"
          },
          "ingredients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Ingredient"
            }
          }
        },
        "additionalProperties": false,
        "required": [
          "item_id",
          "name",
          "weight_g",
          "portion_estimated",
          "nutrients",
          "nutrient_status",
          "ingredients"
        ]
      },
      "FoodEdit": {
        "type": "object",
        "properties": {
          "item_id": {
            "type": "string",
            "description": "稳定UUID；须在当前租户和授权数据范围内",
            "minLength": 1,
            "maxLength": 64,
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "",
            "minLength": 1,
            "maxLength": 100
          },
          "weight_g": {
            "type": "number",
            "minimum": 0,
            "nullable": true,
            "description": "有限非负数；未知为null，不可用0代替"
          },
          "nutrients": {
            "$ref": "#/components/schemas/Nutrients"
          }
        },
        "additionalProperties": false,
        "required": [
          "name",
          "weight_g",
          "nutrients"
        ]
      },
      "Photo": {
        "type": "object",
        "properties": {
          "photo_id": {
            "type": "string",
            "description": "稳定UUID；须在当前租户和授权数据范围内",
            "minLength": 1,
            "maxLength": 64
          },
          "seq": {
            "type": "integer",
            "minimum": 1
          },
          "view_path": {
            "type": "string",
            "description": "需当前会话授权的原图路径，不是公共永久URL"
          },
          "status": {
            "type": "string",
            "enum": [
              "available",
              "missing",
              "pending"
            ]
          },
          "file_ext": {
            "type": "string",
            "description": ""
          }
        },
        "additionalProperties": false,
        "required": [
          "photo_id",
          "seq",
          "view_path",
          "status",
          "file_ext"
        ]
      },
      "Policy": {
        "type": "object",
        "properties": {
          "configured": {
            "type": "string",
            "enum": [
              "inherit",
              "library",
              "web"
            ]
          },
          "effective": {
            "type": "string",
            "enum": [
              "library",
              "web",
              "policy_conflict"
            ]
          },
          "source_type": {
            "type": "string",
            "enum": [
              "person",
              "department",
              "default",
              "conflict"
            ]
          },
          "source_uuid": {
            "type": "string",
            "description": "稳定UUID；须在当前租户和授权数据范围内",
            "minLength": 1,
            "maxLength": 64,
            "nullable": true
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          }
        },
        "additionalProperties": false,
        "required": [
          "configured",
          "effective",
          "source_type",
          "source_uuid",
          "revision"
        ]
      },
      "Record": {
        "type": "object",
        "properties": {
          "record_id": {
            "type": "string",
            "description": "稳定UUID；须在当前租户和授权数据范围内",
            "minLength": 1,
            "maxLength": 64
          },
          "staff_uuid": {
            "type": "string",
            "description": "稳定UUID；须在当前租户和授权数据范围内",
            "minLength": 1,
            "maxLength": 64
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "uploaded_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC3339且必须带时区；用餐日按业务时区Asia/Shanghai解释，上传时间不可编辑"
          },
          "meal_date": {
            "type": "string",
            "format": "date"
          },
          "meal_times": {
            "type": "integer",
            "nullable": true,
            "enum": [
              1,
              2,
              3,
              4,
              null
            ],
            "description": "1早餐及早加餐、2午餐及午加餐、3晚餐及晚加餐、4夜宵；未知null，禁止4归晚餐"
          },
          "meal_kind": {
            "type": "string",
            "enum": [
              "regular",
              "extra",
              "snack",
              "night_snack",
              "unassigned"
            ]
          },
          "meal_time": {
            "type": "string",
            "format": "date-time",
            "description": "RFC3339且必须带时区；用餐日按业务时区Asia/Shanghai解释，上传时间不可编辑",
            "nullable": true
          },
          "photos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Photo"
            }
          },
          "foods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Food"
            }
          },
          "current_origin": {
            "type": "string",
            "enum": [
              "ai",
              "user",
              "manual",
              "legacy",
              "none"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "queued",
              "running",
              "completed",
              "partial",
              "not_in_library",
              "failed",
              "policy_conflict"
            ],
            "description": "最新识别进度；不能覆盖或否定仍有效的人工当前版"
          },
          "suspected_error": {
            "type": "boolean"
          },
          "policy": {
            "$ref": "#/components/schemas/Policy"
          },
          "candidate_attempt_id": {
            "type": "string",
            "description": "稳定UUID；须在当前租户和授权数据范围内",
            "minLength": 1,
            "maxLength": 64,
            "nullable": true
          },
          "totals": {
            "$ref": "#/components/schemas/Nutrients"
          },
          "totals_status": {
            "$ref": "#/components/schemas/NutrientStatus"
          },
          "current_result_status": {
            "type": "string",
            "enum": [
              "none",
              "valid",
              "partial",
              "needs_review"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "record_id",
          "staff_uuid",
          "revision",
          "uploaded_at",
          "meal_date",
          "meal_times",
          "meal_kind",
          "meal_time",
          "photos",
          "foods",
          "current_origin",
          "status",
          "suspected_error",
          "policy",
          "candidate_attempt_id",
          "totals",
          "totals_status",
          "current_result_status"
        ]
      },
      "Attempt": {
        "type": "object",
        "properties": {
          "attempt_id": {
            "type": "string",
            "description": "稳定UUID；须在当前租户和授权数据范围内",
            "minLength": 1,
            "maxLength": 64
          },
          "record_id": {
            "type": "string",
            "description": "稳定UUID；须在当前租户和授权数据范围内",
            "minLength": 1,
            "maxLength": 64
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "completed",
              "partial",
              "failed",
              "not_in_library",
              "policy_conflict"
            ]
          },
          "candidate": {
            "type": "boolean"
          },
          "started_revision": {
            "type": "integer",
            "minimum": 0
          },
          "policy": {
            "$ref": "#/components/schemas/Policy"
          },
          "error_code": {
            "type": "string",
            "description": ""
          },
          "foods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Food"
            }
          }
        },
        "additionalProperties": false,
        "required": [
          "attempt_id",
          "record_id",
          "status",
          "candidate",
          "started_revision",
          "policy",
          "error_code",
          "foods"
        ]
      },
      "Export": {
        "type": "object",
        "properties": {
          "export_id": {
            "type": "string",
            "description": "稳定UUID；须在当前租户和授权数据范围内",
            "minLength": 1,
            "maxLength": 64
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "complete",
              "partial",
              "failed",
              "expired"
            ]
          },
          "progress": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "person_count": {
            "type": "integer",
            "minimum": 0
          },
          "record_count": {
            "type": "integer",
            "minimum": 0
          },
          "image_count": {
            "type": "integer",
            "minimum": 0,
            "description": "实际打包图片数；expected_images为预期数，两者不能混用"
          },
          "missing_images": {
            "type": "integer",
            "minimum": 0
          },
          "download_path": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC3339且必须带时区；用餐日按业务时区Asia/Shanghai解释，上传时间不可编辑",
            "nullable": true
          },
          "error_code": {
            "type": "string",
            "description": ""
          },
          "expected_images": {
            "type": "integer",
            "minimum": 0
          },
          "manifest_path": {
            "type": "string",
            "description": "受同任务权限和有效期控制",
            "nullable": true
          },
          "failure_summary": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "photo_id": {
                  "type": "string",
                  "description": "稳定UUID；须在当前租户和授权数据范围内",
                  "minLength": 1,
                  "maxLength": 64,
                  "nullable": true
                },
                "dataset": {
                  "type": "string",
                  "description": "",
                  "nullable": true
                },
                "reason": {
                  "type": "string",
                  "description": ""
                }
              },
              "additionalProperties": false,
              "required": [
                "photo_id",
                "dataset",
                "reason"
              ]
            }
          },
          "department_uuid": {
            "type": "string",
            "description": "稳定UUID；须在当前租户和授权数据范围内",
            "minLength": 1,
            "maxLength": 64
          },
          "date_from": {
            "type": "string",
            "format": "date"
          },
          "date_to": {
            "type": "string",
            "format": "date"
          },
          "snapshot_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC3339且必须带时区；用餐日按业务时区Asia/Shanghai解释，上传时间不可编辑",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "required": [
          "export_id",
          "status",
          "progress",
          "person_count",
          "record_count",
          "image_count",
          "missing_images",
          "download_path",
          "expires_at",
          "error_code",
          "expected_images",
          "manifest_path",
          "failure_summary",
          "department_uuid",
          "date_from",
          "date_to",
          "snapshot_at"
        ]
      },
      "Audit": {
        "type": "object",
        "properties": {
          "audit_id": {
            "type": "string",
            "description": "稳定UUID；须在当前租户和授权数据范围内",
            "minLength": 1,
            "maxLength": 64
          },
          "operation": {
            "type": "string",
            "description": ""
          },
          "operator_label": {
            "type": "string",
            "description": ""
          },
          "operated_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC3339且必须带时区；用餐日按业务时区Asia/Shanghai解释，上传时间不可编辑"
          },
          "reason": {
            "type": "string",
            "description": ""
          },
          "before_revision": {
            "type": "integer",
            "minimum": 0
          },
          "after_revision": {
            "type": "integer",
            "minimum": 0
          },
          "before": {
            "type": "object"
          },
          "after": {
            "type": "object"
          },
          "operator_uuid": {
            "type": "string",
            "description": "稳定UUID；须在当前租户和授权数据范围内",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "additionalProperties": false,
        "required": [
          "audit_id",
          "operation",
          "operator_label",
          "operated_at",
          "reason",
          "before_revision",
          "after_revision",
          "before",
          "after",
          "operator_uuid"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              1
            ]
          },
          "message": {
            "type": "string",
            "description": ""
          },
          "error_code": {
            "type": "string",
            "enum": [
              "VALIDATION_FAILED",
              "AUTH_REQUIRED",
              "FORBIDDEN",
              "NOT_FOUND",
              "REVISION_CONFLICT",
              "IDEMPOTENCY_CONFLICT",
              "POLICY_CONFLICT",
              "RECOGNIZER_UNAVAILABLE",
              "EXPORT_NOT_READY",
              "EXPORT_EXPIRED",
              "RATE_LIMITED"
            ]
          },
          "trace_id": {
            "type": "string",
            "description": ""
          },
          "data": {
            "type": "object"
          }
        },
        "additionalProperties": false,
        "required": [
          "code",
          "message",
          "error_code",
          "trace_id",
          "data"
        ]
      },
      "NutrientStatus": {
        "type": "object",
        "properties": {
          "energy": {
            "type": "string",
            "enum": [
              "matched",
              "partial",
              "missing",
              "manual"
            ]
          },
          "protein": {
            "type": "string",
            "enum": [
              "matched",
              "partial",
              "missing",
              "manual"
            ]
          },
          "zinc": {
            "type": "string",
            "enum": [
              "matched",
              "partial",
              "missing",
              "manual"
            ]
          },
          "magnesium": {
            "type": "string",
            "enum": [
              "matched",
              "partial",
              "missing",
              "manual"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "energy",
          "protein",
          "zinc",
          "magnesium"
        ]
      }
    }
  }
}
