Commit Graph

7 Commits

Author SHA1 Message Date
hailin 931055b51f feat(admin): add conversation management with device tracking display
## Backend (conversation-service)
- Add AdminConversationController with JWT auth for admin API
- Endpoints: list conversations, by user, detail, messages, statistics
- Support filtering by status, userId, date range, conversion
- Add JWT_SECRET environment variable to docker-compose.yml
- Add jsonwebtoken dependency for admin token verification

## Frontend (admin-client)
### New Features:
- Add conversations feature module with:
  - API layer (conversations.api.ts)
  - React Query hooks (useConversations.ts)
  - ConversationsPage with full management UI

### User Management Enhancement:
- Add "最近咨询记录" section in user detail drawer
- Display device info for each conversation:
  - IP address with region
  - User-Agent (parsed to browser/OS)
  - Device fingerprint
- Show conversation status, conversion status, message count

### Navigation:
- Add "对话管理" menu item with MessageOutlined icon
- Add /conversations route

## Files Added:
- admin-conversation.controller.ts (backend admin API)
- conversations feature folder (frontend)
  - infrastructure/conversations.api.ts
  - application/useConversations.ts
  - presentation/pages/ConversationsPage.tsx

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 10:04:17 -08:00
hailin b70035ad2f fix(migration): add production migration support for Docker
- Add data-source.prod.ts for compiled JS migrations
- Add migration:run:prod script to package.json
- Update deploy.sh to try prod migration first, fallback to dev
- Keep SQL fallback in full-reset as safety net with proper indexes

This ensures migrations work in Docker where ts-node may not be available.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 08:05:14 -08:00
hailin 9f2bdee8d9 feat(conversation): integrate ClaudeAgentServiceV2 for consulting workflow
- Switch ConversationService to use ClaudeAgentServiceV2
- Pass consultingState and deviceInfo from conversation to context
- Handle state_update chunks and save updated state to database
- Move dotenv to dependencies for migration runtime

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 06:43:19 -08:00
hailin c0a9710943 feat(conversation): add TypeORM migration scripts and data-source config
- Add migration:run, migration:revert, migration:generate scripts
- Create data-source.ts for TypeORM CLI
- Add dotenv, ts-node, tsconfig-paths dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 06:38:41 -08:00
hailin 7f2fc153b5 refactor: simplify Anthropic client config using baseURL
Remove https-proxy-agent dependency since ANTHROPIC_BASE_URL already
supports pointing to a proxy server directly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 20:45:44 -08:00
hailin c6c9623f36 feat(conversation): add proxy support for Anthropic API
- Add https-proxy-agent dependency
- Configure httpAgent in ClaudeAgentService when ANTHROPIC_PROXY_URL is set
- Add ANTHROPIC_PROXY_URL environment variable to docker-compose.yml

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 20:34:13 -08:00
hailin a7add8ff90 Initial commit: iConsulting 香港移民咨询智能客服系统
项目架构:
- Monorepo (pnpm + Turborepo)
- 后端: NestJS 微服务 + Claude Agent SDK
- 前端: React + Vite + Ant Design

包含服务:
- conversation-service: 对话服务 (Claude AI)
- user-service: 用户认证服务
- payment-service: 支付服务 (支付宝/微信/Stripe)
- knowledge-service: 知识库服务 (RAG + Neo4j)
- evolution-service: 自我进化服务
- web-client: 用户前端
- admin-client: 管理后台

基础设施:
- PostgreSQL + Redis + Neo4j
- Kong API Gateway
- Nginx 反向代理
- Docker Compose 部署配置

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 00:01:12 -08:00