From 2f25a943b825ebc0321c72b2951cdbc47900ec17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E5=A3=AE?= Date: Thu, 2 Apr 2026 09:44:56 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=92=8C=E4=BE=9D=E8=B5=96=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 配置更新: 1. 前端配置 - 添加 hook-fetch 依赖用于 HTTP 请求 - 更新 vite.config.mts 配置 - 添加 .npmrc 配置文件 2. 后端配置 - 更新 application.yml 和 application-dev.yml 配置 - 更新 docker-compose.yml 配置 3. 代码优化 - OSS 客户端优化 - SSE 管理器优化 - 聊天服务和向量存储策略优化 4. 项目文档 - 添加 CLAUDE.md 项目指南 Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 333 ++++++++++++++++++ hzhub-admin/.npmrc | 1 + hzhub-admin/apps/web-antd/package.json | 1 + hzhub-admin/apps/web-antd/vite.config.mts | 4 + hzhub-admin/pnpm-lock.yaml | 37 ++ .../src/main/resources/application-dev.yml | 2 +- .../src/main/resources/application.yml | 4 +- .../org/hzhub/common/oss/core/OssClient.java | 50 ++- .../common/sse/core/SseEmitterManager.java | 18 + .../service/chat/impl/ChatServiceFacade.java | 124 ++++--- .../chat/impl/provider/OllamaServiceImpl.java | 3 + .../impl/MilvusVectorStoreStrategy.java | 6 +- .../impl/WeaviateVectorStoreStrategy.java | 76 +++- hzhub-deploy/docker-compose.yml | 23 +- 14 files changed, 584 insertions(+), 98 deletions(-) create mode 100644 CLAUDE.md create mode 100644 hzhub-admin/.npmrc diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..d4af14e --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,333 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +HZHub (汇智中台) is an enterprise-level business platform built on HZHub-AI, integrating AI capabilities with ERP data adaptation. It consists of multiple frontend portals, a backend AI service, an ERP service, and a gateway, orchestrated via Docker Compose. + +## Commands + +### Docker Deployment (Production-like) + +```bash +# Start all services (recommended for integration testing) +cd hzhub-deploy +docker-compose up -d + +# View service status +docker-compose ps + +# View logs +docker-compose logs -f hzhub-ai +docker-compose logs -f hzhub-admin + +# Restart services +docker-compose restart hzhub-ai + +# Stop all services +docker-compose down +``` + +### Backend Development (Spring Boot) + +```bash +# Run AI service locally +cd hzhub-ai/hzhub-admin +mvn spring-boot:run -Dspring-boot.run.profiles=dev + +# Build all modules +cd hzhub-ai +mvn clean package + +# Build specific module +cd hzhub-ai/hzhub-modules/hzhub-chat +mvn clean package + +# Run tests +mvn test +``` + +### Frontend Development (Vue 3 + Vben Admin) + +```bash +# Admin portal development +cd hzhub-admin +pnpm install # Install dependencies +pnpm dev # Start dev server +pnpm build # Build all packages +pnpm --filter=@vben/web-antd build:prod # Build admin frontend + +# Company portal development +cd hzhub-portal-company +pnpm install +pnpm dev + +# Dealer portal development +cd hzhub-portal-dealer +pnpm install +pnpm dev +``` + +## Architecture + +### Multi-Service Structure + +``` +┌─────────────────────────────────────────┐ +│ Frontend Layer │ +│ hzhub-admin | hzhub-portal-company │ +│ | hzhub-portal-dealer │ +└────────────┬────────────────────────────┘ + │ + ┌────────┴────────┐ + │ hzhub-gateway │ (API Gateway - planned) + │ Spring Cloud │ Auth, routing, rate limiting + └────────┬────────┘ + │ + ┌────────┴────────┬────────────┐ + │ hzhub-ai │ hzhub-erp │ + │ (AI Service) │ (Planned) │ + │ Spring Boot │ JDBC to │ + │ 3.5.8 │ SQL Server│ + └─────────────────┴────────────┘ +``` + +### Backend Module Organization + +**hzhub-ai** is organized as a multi-module Maven project: + +- **hzhub-admin**: Main application entry point (`HZHubAIApplication.java`), configuration files +- **hzhub-common**: Shared utilities (core, redis, mybatis, security, satoken, oss, chat, etc.) +- **hzhub-modules**: Business modules + - **hzhub-chat**: Chat/AI conversation functionality + - **hzhub-system**: System management, users, roles, permissions + - **hzhub-workflow**: Workflow engine (Flowable-based) + - **hzhub-aiflow**: AI workflow orchestration + - **hzhub-generator**: Code generator +- **hzhub-extend**: Extensions (monitoring, job scheduling) + +### Frontend Architecture + +**hzhub-admin** uses a monorepo structure with pnpm + turbo: + +``` +hzhub-admin/ +├── apps/ +│ └── web-antd/ # Main admin application (Ant Design Vue) +│ ├── src/ +│ │ ├── api/ # API calls +│ │ ├── views/ # Page components +│ │ ├── router/ # Vue Router config +│ │ └── store/ # Pinia stores +│ └── package.json +├── packages/ # Shared packages +└── package.json # Root monorepo config +``` + +**Portal applications** (hzhub-portal-company, hzhub-portal-dealer) are Vue 3 apps with: +- Composition API (`