feat: 重构订单和物流信息展示格式
主要改动: - 订单列表:使用 order_list 格式,展示 5 个订单(全部状态) - 订单详情:使用 order_detail 格式,优化价格和时间显示 - 物流信息:使用 logistics 格式,根据 track id 动态生成步骤 - 商品图片:从 orderProduct.imageUrl 字段获取 - 时间格式:统一为 YYYY-MM-DD HH:MM:SS - 多语言支持:amountLabel、orderTime 支持中英文 - 配置管理:新增 FRONTEND_URL 环境变量 - API 集成:改进 Mall API tracks 数据解析 - 认证优化:account_id 从 webhook 动态获取 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,29 +2,8 @@ version: '3.8'
|
||||
|
||||
services:
|
||||
# ============ Infrastructure ============
|
||||
|
||||
# PostgreSQL (Chatwoot Database)
|
||||
postgres:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: postgres-with-pgvector.Dockerfile
|
||||
container_name: ai_postgres
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-chatwoot}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-chatwoot}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- ai_network
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-chatwoot}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
restart: unless-stopped
|
||||
|
||||
# Redis (Cache & Queue)
|
||||
# Redis (Cache & Queue) - Agent 和 MCP 服务都需要
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: ai_redis
|
||||
@@ -40,84 +19,8 @@ services:
|
||||
retries: 5
|
||||
restart: unless-stopped
|
||||
|
||||
# Nginx (Static File Server)
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
container_name: ai_nginx
|
||||
ports:
|
||||
- "8080:80"
|
||||
volumes:
|
||||
- ./docs:/usr/share/nginx/html/docs:ro
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
networks:
|
||||
- ai_network
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/test-chat.html"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
# ============ Messaging Platform ============
|
||||
|
||||
# Chatwoot
|
||||
chatwoot:
|
||||
image: chatwoot/chatwoot:latest
|
||||
container_name: ai_chatwoot
|
||||
# 启动前清理 PID 文件,避免重启循环
|
||||
command: sh -c "rm -f /app/tmp/pids/server.pid && bundle exec rails s -p 3000 -b 0.0.0.0"
|
||||
environment:
|
||||
RAILS_ENV: production
|
||||
SECRET_KEY_BASE: ${CHATWOOT_SECRET_KEY_BASE}
|
||||
FRONTEND_URL: ${CHATWOOT_FRONTEND_URL:-http://localhost:3000}
|
||||
# 允许 Widget 从多个域名访问(逗号分隔)
|
||||
ALLOWED_DOMAINS_FOR_WIDGET: ${CHATWOOT_ALLOWED_DOMAINS:-http://localhost:3000,http://localhost:8080,http://127.0.0.1:3000,http://127.0.0.1:8080}
|
||||
POSTGRES_HOST: postgres
|
||||
POSTGRES_DATABASE: ${POSTGRES_DB:-chatwoot}
|
||||
POSTGRES_USERNAME: ${POSTGRES_USER:-chatwoot}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
REDIS_URL: redis://redis:6379
|
||||
INSTALLATION_NAME: B2B AI Assistant
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- chatwoot_data:/app/storage
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- ai_network
|
||||
restart: unless-stopped
|
||||
|
||||
# Chatwoot Sidekiq Worker
|
||||
chatwoot_worker:
|
||||
image: chatwoot/chatwoot:latest
|
||||
container_name: ai_chatwoot_worker
|
||||
command: bundle exec sidekiq -C config/sidekiq.yml
|
||||
environment:
|
||||
RAILS_ENV: production
|
||||
SECRET_KEY_BASE: ${CHATWOOT_SECRET_KEY_BASE}
|
||||
POSTGRES_HOST: postgres
|
||||
POSTGRES_DATABASE: ${POSTGRES_DB:-chatwoot}
|
||||
POSTGRES_USERNAME: ${POSTGRES_USER:-chatwoot}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
REDIS_URL: redis://redis:6379
|
||||
INSTALLATION_NAME: B2B AI Assistant
|
||||
volumes:
|
||||
- chatwoot_data:/app/storage
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- ai_network
|
||||
restart: unless-stopped
|
||||
|
||||
# ============ AI Agent Layer ============
|
||||
|
||||
|
||||
# LangGraph Agent Main Service
|
||||
agent:
|
||||
build:
|
||||
@@ -133,8 +36,8 @@ services:
|
||||
REDIS_PORT: 6379
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD}
|
||||
REDIS_DB: 0
|
||||
# Chatwoot
|
||||
CHATWOOT_API_URL: http://chatwoot:3000
|
||||
# Chatwoot (远程服务器)
|
||||
CHATWOOT_API_URL: ${CHATWOOT_API_URL}
|
||||
CHATWOOT_API_TOKEN: ${CHATWOOT_API_TOKEN}
|
||||
CHATWOOT_WEBHOOK_SECRET: ${CHATWOOT_WEBHOOK_SECRET}
|
||||
# External APIs
|
||||
@@ -142,6 +45,14 @@ services:
|
||||
STRAPI_API_TOKEN: ${STRAPI_API_TOKEN}
|
||||
HYPERF_API_URL: ${HYPERF_API_URL}
|
||||
HYPERF_API_TOKEN: ${HYPERF_API_TOKEN}
|
||||
# Mall API
|
||||
MALL_API_URL: ${MALL_API_URL}
|
||||
MALL_TENANT_ID: ${MALL_TENANT_ID:-2}
|
||||
MALL_CURRENCY_CODE: ${MALL_CURRENCY_CODE:-EUR}
|
||||
MALL_LANGUAGE_ID: ${MALL_LANGUAGE_ID:-1}
|
||||
MALL_SOURCE: ${MALL_SOURCE:-us.qa1.gaia888.com}
|
||||
# Frontend URLs
|
||||
FRONTEND_URL: ${FRONTEND_URL:-https://www.qa1.gaia888.com}
|
||||
# MCP Servers
|
||||
STRAPI_MCP_URL: http://strapi_mcp:8001
|
||||
ORDER_MCP_URL: http://order_mcp:8002
|
||||
@@ -167,7 +78,7 @@ services:
|
||||
restart: unless-stopped
|
||||
|
||||
# ============ MCP Servers ============
|
||||
|
||||
|
||||
# Strapi MCP (FAQ/Knowledge Base)
|
||||
strapi_mcp:
|
||||
build:
|
||||
@@ -256,7 +167,5 @@ networks:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
chatwoot_data:
|
||||
agent_logs:
|
||||
|
||||
Reference in New Issue
Block a user