# 智能客服-后端 **Repository Path**: map_development/intelligent-customer-service-cloud ## Basic Information - **Project Name**: 智能客服-后端 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-29 - **Last Updated**: 2026-08-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Intelligent Customer Service Cloud - Spring Cloud 微服务版本 AI Agent 客服系统的 Spring Cloud 微服务改造版,原版基于 Go (Gin + GORM)。 ## 技术栈 | 层次 | 技术 | |------|------| | 框架 | Spring Boot 3.2 + Spring Cloud 2023.0 + Spring Cloud Alibaba | | 注册/配置 | Nacos | | 网关 | Spring Cloud Gateway | | 服务调用 | OpenFeign | | 限流 | Sentinel | | ORM | MyBatis-Plus | | 数据库 | MySQL 8.0 | | 连接池 | Druid | | 认证 | Spring Security + JWT | | 向量库 | Qdrant (保留原版) | ## 项目结构 ``` intelligent-customer-service-cloud/ ├── pom.xml # 父级 POM ├── intelligent-customer-common/ # 公共模块(DTO/枚举/异常/工具/MP配置) ├── intelligent-customer-gateway/ # API 网关(端口 8080) ├── intelligent-customer-auth/ # 认证服务(端口 8081) ├── intelligent-customer-user/ # 用户权限服务(端口 8082) ├── intelligent-customer-customer/ # 客户管理服务(端口 8083) ├── intelligent-customer-conversation/ # 会话消息服务(端口 8084) ├── intelligent-customer-ticket/ # 工单服务(端口 8085) ├── intelligent-customer-knowledge/ # 知识库服务(端口 8086) ├── intelligent-customer-ai/ # AI 智能体服务(端口 8087) ├── intelligent-customer-channel/ # 渠道接入服务(端口 8088) ├── sql/ │ ├── migration.sql # 正向迁移脚本(57 张表) │ └── rollback.sql # 回滚脚本 └── docs/ └── api/ └── API-Intelligent-Customer-Service-Cloud.md # API 接口文档 ``` ## 微服务拆分 | 原 Go 模块 | Spring Cloud 服务 | 包含表 | |-----------|-------------------|--------| | handlers/api (auth) | intelligent-customer-auth | login_session, login_credential_log | | handlers/dashboard (user/role/permission) | intelligent-customer-user | user, user_identity, role, permission, user_role, role_permission, user_permission | | handlers/dashboard (customer/company) | intelligent-customer-customer | company, customer, customer_identity, customer_contact | | handlers/dashboard (conversation/message/agent) | intelligent-customer-conversation | conversation, conversation_*, message, agent_profile, agent_team, agent_team_schedule, quick_reply, tag, conversation_interrupt | | handlers/dashboard (ticket) | intelligent-customer-ticket | ticket, ticket_tag, ticket_progress, ticket_view, ticket_no_sequence | | handlers/dashboard (knowledge) | intelligent-customer-knowledge | knowledge_base, knowledge_directory, knowledge_document, knowledge_faq, knowledge_chunk, knowledge_retrieve_log, knowledge_retrieve_hit, knowledge_feedback | | handlers/dashboard (ai_agent/workflow/skill/ai_config) | intelligent-customer-ai | ai_agent, ai_config, ai_workflow, ai_workflow_version, ai_workflow_run, ai_workflow_node_run, skill_definition, skill_run_log, notification | | handlers/dashboard (channel) + third | intelligent-customer-channel | channel, channel_message_outbox, wxwork_kf_*, asset | | - | intelligent-customer-common | system_config, migration (公共基础) | ## 快速开始 ### 前置条件 - JDK 17+ - Maven 3.8+ - MySQL 8.0+ - Nacos Server(可选,本地开发可先不启动) ### 1. 初始化数据库 ```bash mysql -u root -p < sql/migration.sql ``` ### 2. 修改配置 各服务的 `application.yml` 中数据库连接信息通过环境变量注入: ```bash export MYSQL_HOST=127.0.0.1 export MYSQL_PORT=3306 export MYSQL_DB=intelligent_customer export MYSQL_USER=root export MYSQL_PASS=your_password export NACOS_ADDR=127.0.0.1:8848 ``` ### 3. 编译全部服务 ```bash mvn clean package -DskipTests ``` ### 4. 启动各服务 ```bash # 先启动网关 java -jar intelligent-customer-gateway/target/intelligent-customer-gateway-1.0.0-SNAPSHOT.jar # 再启动业务服务(按需) java -jar intelligent-customer-auth/target/intelligent-customer-auth-1.0.0-SNAPSHOT.jar java -jar intelligent-customer-user/target/intelligent-customer-user-1.0.0-SNAPSHOT.jar java -jar intelligent-customer-customer/target/intelligent-customer-customer-1.0.0-SNAPSHOT.jar java -jar intelligent-customer-conversation/target/intelligent-customer-conversation-1.0.0-SNAPSHOT.jar java -jar intelligent-customer-ticket/target/intelligent-customer-ticket-1.0.0-SNAPSHOT.jar java -jar intelligent-customer-knowledge/target/intelligent-customer-knowledge-1.0.0-SNAPSHOT.jar java -jar intelligent-customer-ai/target/intelligent-customer-ai-1.0.0-SNAPSHOT.jar java -jar intelligent-customer-channel/target/intelligent-customer-channel-1.0.0-SNAPSHOT.jar ``` ### 5. 访问网关 网关统一入口:`http://localhost:8080` - 认证:`/api/auth/login` - 管理后台:`/dashboard/**` - 客户侧:`/api/v1/**` - 第三方:`/third/**` ## 与原版差异 | 维度 | 原版 (Go) | 本版 (Spring Cloud) | |------|----------|-------------------| | 架构 | 单体 | 微服务(9个独立服务) | | 语言 | Go 1.26 | Java 17 | | Web 框架 | Gin | Spring Boot + Spring Cloud Gateway | | ORM | GORM | MyBatis-Plus | | 认证 | JWT (自定义) | Spring Security + JWT | | 配置 | 本地 YAML + Viper | Nacos 配置中心 | | 部署 | 单二进制 | 多服务独立部署 | | 数据库 | SQLite / MySQL | MySQL | | 向量检索 | Qdrant (保留) | Qdrant (保留) | ## 开发规范 - 统一响应体:`R` - 异常处理:`BizException` + `GlobalExceptionHandler` - 分页:MyBatis-Plus `Page` + `PageResult` - 实体基类:`BaseEntity`(自动填充审计字段) - 枚举:使用 `@EnumValue` + `@JsonValue` 注解 ## 下一步 1. 按服务补充完整的 Entity / Mapper / Service / Controller 代码 2. 实现 Spring Security + JWT 鉴权过滤器 3. 实现 WebSocket 实时通信(会话消息推送) 4. 对接 Qdrant 向量检索 5. 对接 OpenFeign 服务间调用 6. 补充单元测试和集成测试