فهرست منبع

chore: auto bump version and changelog [skip ci]

iwt 1 ماه پیش
والد
کامیت
2c3aadf42f
3فایلهای تغییر یافته به همراه71 افزوده شده و 36 حذف شده
  1. 68 33
      .anchored-summary.md
  2. 1 1
      cfc-web/.last_build_commit
  3. 2 2
      cfc-web/package-lock.json

+ 68 - 33
.anchored-summary.md

@@ -1,42 +1,77 @@
-# AI Mascot IP Display (浠宝/福宝) — Session Summary
+# CFC 膳食管理模块部署 — Session Summary
 
 ## Goal
-- Complete and verify the mascot IP形象 system (浠宝/福宝) across all touchpoints: database, backend API, login/registration, profile settings, AI chat display, and floating avatar
+- 部署 LangGraph meal 路由到 ai.etotem.com.cn,修复 404 错误
+- 验证食材识别和菜单生成 API 正常工作
 
 ## Progress
 ### Done
-- ✅ Investigated all mascot-related files and verified completion state
-- ✅ Fixed hardcoded typing indicator in `chat.vue` (`🤖` → `{{ mascotIcon || '🤖' }}`)
-- ✅ Added dynamic CSS class `mascot-{code}` to chat nav bar
-- ✅ Added mascot-specific nav gradient: `.mascot-xibao` (warm orange), `.mascot-fubao` (golden)
-- ✅ Added mascot-specific avatar styling (gradient + colored border)
-- ✅ Added welcome icon float animation with per-mascot delays
-- ✅ Added mascot selection to `user-edit.vue` (registration flow):
-  - Mascot card UI (浠宝/福宝 with gradient icons)
-  - `selectMascot(code)` method
-  - `form.mascot` field in data
-  - `mascot` passed in all API calls (saveUserInfo, directRegister, updateUserInfo)
-  - mascot saved to `uni.getStorageSync('userInfo')` on navigation
-  - Card styles with active state and gradient backgrounds
-- ✅ Verified other mascot components:
-  - `MascotEnum.java` ✅ (XIBAO/FUBAO with code, gender, persona)
-  - `User.java:95` ✅ (`private String mascot;` field)
-  - `AIChatController.java` ✅ (injects mascot_name/mascot_gender/mascot_persona into Dify)
-  - `UserMascotController.java` ✅ (POST set/get)
-  - `profile.vue` ✅ (mascot-selector with cards)
-  - `AIFloatingAvatar.vue` ✅ (reads from storage)
-  - `chat.vue` ✅ (reads from userInfo onLoad, mascot-specific styling)
-
-### Remaining
-- 🔄 Verify all diagnostics clean
-- 🔄 (Optional) Test full mascot flow: login → user-edit mascot selection → profile → AI chat
+- ✅ 修复 LangGraph 服务缺少 meal 路由的问题
+- ✅ 将 meal.py 和 models/meal.py 复制到服务器容器
+- ✅ 修改 main.py 添加 `app.include_router(meal.router)`
+- ✅ 重启容器并验证端点正常
+- ✅ 测试食材识别 API:成功识别番茄、鸡蛋、洋葱等食材
+- ✅ 测试菜单生成 API:成功生成一日三餐菜单
+
+### Key Files Updated
+- `/app/cfc/cfc-langgraph/app/api/meal.py` - 食材识别和菜单生成端点
+- `/app/cfc/cfc-langgraph/app/models/meal.py` - Pydantic 模型定义
+- `/app/cfc/cfc-langgraph/app/main.py` - 添加 meal 路由注册
+
+### API Endpoints
+| Method | Path | 说明 |
+|--------|------|------|
+| POST | `/api/v1/food/recognize` | 食材识别 - 上传图片 URL,返回识别食材列表 |
+| POST | `/api/v1/menu/generate` | 菜单生成 - 根据食材生成一日三餐菜单 |
+
+### Test Results
+**食材识别** - 成功识别图片中的食材:
+```json
+{
+  "foods": [
+    {"name": "西红柿", "confidence": 0.96, "category": "蔬菜"},
+    {"name": "鸡蛋", "confidence": 0.93, "category": "蛋奶"},
+    {"name": "洋葱", "confidence": 0.88, "category": "蔬菜"},
+    {"name": "青椒", "confidence": 0.85, "category": "蔬菜"},
+    {"name": "大蒜", "confidence": 0.79, "category": "调味"},
+    {"name": "食用油", "confidence": 0.65, "category": "调味"}
+  ]
+}
+```
+
+**菜单生成** - 成功生成一日三餐菜单(含营养信息)
+
+## Deployment Commands
+```bash
+# 复制文件到容器
+scp meal.py root@111.228.6.214:/tmp/
+scp models_meal.py root@111.228.6.214:/tmp/
+sudo docker cp /tmp/meal.py cfc-langgraph-langgraph-svc-1:/app/app/api/meal.py
+sudo docker cp /tmp/models_meal.py cfc-langgraph-langgraph-svc-1:/app/app/models/meal.py
+
+# 修改 main.py 添加路由
+sudo docker exec cfc-langgraph-langgraph-svc-1 sed -i 's/from app.api import health, recommend, chat, analyze, tongue, adapter/from app.api import health, recommend, chat, analyze, tongue, adapter, meal/' /app/app/main.py
+sudo docker exec cfc-langgraph-langgraph-svc-1 sed -i '/app.include_router(report_parse.router)/a app.include_router(meal.router)' /app/app/main.py
+
+# 重启服务
+sudo docker restart cfc-langgraph-langgraph-svc-1
+```
+
+## Current Status
+- ✅ LangGraph 服务运行正常 (端口 9000)
+- ✅ 后端服务运行正常 (端口 9082)
+- ✅ 前端代码已包含膳食管理模块 (7 个新页面)
+- ✅ API 端点可正常访问
+
+## Next Steps
+- 前端测试膳食管理模块完整流程
+- 验证后端 AiGateway 正确调用 LangGraph 服务
 
 ## Key Decisions
-- Added mascot selection to `user-edit.vue` during registration (not login.vue), since WeChat login is one-tap
-- Used gradient/card UI matching profile.vue style for consistency
-- Saved mascot to `userInfo` storage in `navigateToHome()` to ensure chat.vue reads it immediately
+- 直接在服务器上修改容器内的文件(因为 Docker 镜像重建需要修改 Dockerfile)
+- meal.py 使用 `/api/v1` 前缀与其他路由保持一致
 
 ## Critical Context
-- Pre-existing LSP warnings (unused `e` variables, string concatenation) — NOT introduced by edits
-- 小程序 limits: no optional chaining, no CSS Grid — all CSS uses flexbox
-- chat.vue has 4 pre-existing `var` declarations — kept as-is for legacy compatibility
+- 后端配置 `python.base-url: https://ai.etotem.com.cn`
+- LangGraph 服务通过 Docker 容器运行
+- 前端通过 `config.js` 自动适配环境(develop/trial/release)

+ 1 - 1
cfc-web/.last_build_commit

@@ -1 +1 @@
-a1b7a387b43981164d4c69c4db9f284e355a33d7
+91f9699fe3e12bd2acaead96acf39e308dfacdd9

+ 2 - 2
cfc-web/package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "cfc-web",
-  "version": "1.0.862",
+  "version": "1.0.863",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "cfc-web",
-      "version": "1.0.862",
+      "version": "1.0.863",
       "dependencies": {
         "@wangeditor/editor": "^5.1.23",
         "@wangeditor/editor-for-vue": "^1.0.2",