坐席智能体系统是一个面向客服人员的服务辅助工具,旨在通过标准化与智能化手段,提升服务效率与质量。系统采用前后端分离架构,后端基于Spring Boot框架,前端使用Vue 3 + TypeScript + Vite技术栈,支持智能对话、流程编排、话术推荐等功能。
-
用户认证与权限管理
- JWT Token认证
- 多角色权限控制(管理员、坐席、主管、运营)
- 用户个性化配置(主题、数字人形象)
-
诉求类型管理
- 分级分类管理
- 快速检索和选择
- 支持图标和颜色自定义
-
服务流程管理
- 标准化流程编排
- 流程步骤引导
- 流程版本管理
-
智能话术辅助
- 话术库管理
- 一键复制使用
- 智能搜索推荐
- 个人收藏夹
- 热门话术排行
-
会话管理
- 多会话并行处理
- 实时消息收发
- 会话转接
- 会话步骤跟踪
- 会话历史记录
-
工单系统
- 自动工单创建
- 工单分配和跟踪
- 工单状态管理
-
运营分析
- 坐席绩效统计
- 诉求类型分析
- 满意度统计
- 运营报表生成
-
AI智能服务
- 智能话术推荐
- 意图识别
- 会话摘要生成
- 情感分析
- 语音转文字
- 数字人交互
- 智能质检
-
系统配置管理
- 首页配置管理(标题、Logo、入口配置)
- 登录页配置管理(背景、标题、样式)
- 系统参数配置
-
安全监控
- 登录监控与异常检测
- 登录日志记录(成功/失败、IP、设备类型)
- 异常行为检测(多次失败、异地登录)
-
知识库管理
- 知识文档管理(增删改查)
- 知识分类和标签
- 智能搜索(标题、内容、关键词)
-
客户管理
- 客户基本信息管理
- 客户画像(VIP等级、消费金额、服务次数)
- 风险评估(基于投诉、满意度等)
-
反馈管理
- 多维度满意度评价
- 评价统计分析
- 需要跟进的反馈管理
-
高频问题分析
- 自动记录高频问题
- 问题去重和热度统计
- 关联标准答案、话术、知识库
-
服务质量监控
- 坐席质量评分(满意度、响应速度、服务量)
- 实时质量指标监控
- 会话质量检查
-
前端功能
- 响应式用户界面
- 智能卡片消息系统
- 流程可视化编辑器
- 实时聊天界面
- 数据可视化图表
- 知识学习模块
- 工作台集成
- 后端框架: Spring Boot 3.2.0
- 编程语言: Java 17
- 数据库: MySQL 8.0+
- 缓存: Redis
- 认证: Spring Security + JWT
- ORM: Spring Data JPA (Hibernate)
- 实时通信: WebSocket (STOMP)
- API文档: Swagger/OpenAPI 3.0
- 构建工具: Maven
- JSON处理: FastJSON
- HTTP客户端: OkHttp3
- AI集成: OpenAI API Client, DashScope SDK
- 框架: Vue 3
- 语言: TypeScript
- 构建工具: Vite
- UI库: Ant Design
- 样式: Tailwind CSS
- 动画: Framer Motion
- 图表: Recharts
- 状态管理: Zustand
- HTTP客户端: Axios
- 路由: React Router v6
- 工具库: dayjs, ahooks
agent-system/
├── frontend/ # 前端项目
│ ├── src/
│ │ ├── api/ # API 接口
│ │ ├── assets/ # 资源文件
│ │ ├── components/ # 公共组件
│ │ │ ├── CardMessage/ # 卡片消息组件
│ │ │ ├── Loading/ # 加载组件
│ │ │ ├── EmptyState/ # 空状态组件
│ │ │ ├── PageHeader/ # 页面头部
│ │ │ ├── AnimatedCard/ # 动画卡片
│ │ │ ├── StatCard/ # 统计卡片
│ │ │ ├── ChatMessage/ # 聊天消息
│ │ │ ├── ScriptCard/ # 话术卡片
│ │ │ ├── ProcessStep/ # 流程步骤
│ │ │ └── SessionCard/ # 会话卡片
│ │ ├── layouts/ # 布局组件
│ │ ├── pages/ # 页面组件
│ │ │ ├── Login/ # 登录页
│ │ │ ├── Workbench/ # 工作台
│ │ │ ├── Analytics/ # 数据分析
│ │ │ ├── FlowEditor/ # 流程编辑
│ │ │ ├── FlowViewer/ # 流程查看
│ │ │ ├── Knowledge/ # 知识库
│ │ │ ├── KnowledgeLearning/ # 知识学习
│ │ │ ├── ProcessManagement/ # 流程管理
│ │ │ ├── ScriptManagement/ # 话术管理
│ │ │ ├── SystemManagement/ # 系统管理
│ │ │ ├── Settings/ # 系统设置
│ │ │ └── NotFound/ # 404页面
│ │ ├── store/ # 状态管理
│ │ ├── utils/ # 工具函数
│ │ ├── App.tsx # 根组件
│ │ └── main.tsx # 入口文件
│ ├── public/ # 静态资源
│ ├── package.json # 依赖配置
│ └── vite.config.ts # Vite配置
├── src/
│ ├── main/
│ │ ├── java/com/study/
│ │ │ ├── config/ # 配置类
│ │ │ ├── controller/ # 控制器层
│ │ │ ├── converter/ # 类型转换器
│ │ │ ├── dto/ # 数据传输对象
│ │ │ ├── entity/ # 实体类
│ │ │ ├── enums/ # 枚举类
│ │ │ ├── exception/ # 异常处理
│ │ │ ├── repository/ # 数据访问层
│ │ │ ├── security/ # 安全相关
│ │ │ ├── service/ # 业务逻辑层
│ │ │ ├── util/ # 工具类
│ │ │ ├── websocket/ # WebSocket
│ │ │ └── AgentSystemApplication.java
│ │ └── resources/
│ │ ├── application.yml # 主配置文件
│ │ ├── application-dev.yml # 开发环境配置
│ │ └── application-prod.yml # 生产环境配置
│ └── test/ # 测试代码
├── Dockerfile # Docker配置
├── docker-compose.yml # Docker Compose配置
├── pom.xml # Maven配置
└── README.md # 项目说明
- JDK 17+
- MySQL 8.0+
- Redis 6.0+
- Maven 3.6+
- Node.js 16+
- npm 8+
创建数据库:
CREATE DATABASE agent_system CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;执行初始化脚本(可选):
mysql -u root -p agent_system < init.sql编辑 src/main/resources/application.yml:
spring:
datasource:
url: jdbc:mysql://localhost:3306/agent_system
username: your_username
password: your_password
data:
redis:
host: localhost
port: 6379# 使用Maven启动后端
mvn spring-boot:run
# 或者先打包再运行
mvn clean package
java -jar target/agent-1.0-SNAPSHOT.jar启动前端(在frontend目录下):
cd frontend
npm install
npm run dev- 应用地址: http://localhost:3000 (前端)
- 后端API: http://localhost:8080/api
- API文档: http://localhost:8080/api/swagger-ui.html
- WebSocket: ws://localhost:8080/api/ws
POST /auth/login- 用户登录POST /auth/register- 用户注册GET /auth/current- 获取当前用户信息PUT /auth/profile- 更新用户信息POST /auth/change-password- 修改密码POST /auth/logout- 退出登录POST /auth/avatar- 上传用户头像
GET /request-types- 获取所有诉求类型GET /request-types/active- 获取启用的诉求类型GET /request-types/parent/{parentId}- 根据父级ID获取诉求类型POST /request-types- 创建诉求类型PUT /request-types/{id}- 更新诉求类型DELETE /request-types/{id}- 删除诉求类型
GET /flows- 获取所有流程GET /flows/request-type/{requestTypeId}- 根据诉求类型获取流程GET /flows/request-type/{requestTypeId}/default- 获取默认流程GET /flows/{id}- 根据ID获取流程GET /flows/{id}/steps- 获取流程步骤POST /flows- 创建流程PUT /flows/{id}- 更新流程DELETE /flows/{id}- 删除流程POST /flows/steps- 创建流程步骤PUT /flows/steps/{id}- 更新流程步骤DELETE /flows/steps/{id}- 删除流程步骤PUT /flows/{flowId}/steps/order- 批量更新流程步骤顺序PUT /flows/{flowId}/steps/{stepId}/move- 移动流程步骤位置POST /flows/steps/{stepId}/duplicate- 复制流程步骤
GET /scripts- 获取所有公开话术GET /scripts/{id}- 根据ID获取话术GET /scripts/request-type/{requestTypeId}- 根据诉求类型获取话术GET /scripts/flow-step/{flowStepId}- 根据流程步骤获取话术GET /scripts/category/{category}- 根据分类获取话术GET /scripts/categories- 获取所有话术分类GET /scripts/search- 搜索话术(智能推荐)GET /scripts/autocomplete- 实时话术联想GET /scripts/smart-autocomplete- 智能自动补全GET /scripts/popular- 获取热门话术GET /scripts/with-summary- 获取话术列表(带摘要)GET /scripts/{id}/summary- 获取话术摘要POST /scripts/{id}/use- 使用话术(增加计数)GET /scripts/favorites- 获取我的收藏GET /scripts/favorites/details- 获取收藏夹详情GET /scripts/favorites/by-tags- 按标签分类获取收藏夹GET /scripts/favorites/frequently-used- 获取高频使用的收藏话术GET /scripts/favorites/search- 搜索收藏夹中的话术POST /scripts/favorites- 添加收藏DELETE /scripts/favorites/{scriptId}- 取消收藏PUT /scripts/favorites/{id}- 更新收藏POST /scripts- 创建话术PUT /scripts/{id}- 更新话术DELETE /scripts/{id}- 删除话术POST /scripts/templates/update- 手动触发话术模板更新POST /scripts/generate-contextual- 生成上下文化话术POST /scripts/templates/{id}/variants- 批量生成话术变体GET /scripts/smart-recommend- 智能推荐话术POST /scripts/ai-generate- 使用AI生成全新话术POST /scripts/{id}/ai-optimize- 使用AI优化现有话术POST /scripts/ai-test- 测试AI话术生成
GET /sessions/my- 获取我的会话列表GET /sessions/my/active- 获取活动会话GET /sessions/my/multi-session-overview- 获取多会话概览POST /sessions/{id}/switch- 切换当前工作会话POST /sessions- 创建会话PUT /sessions/{id}- 更新会话POST /sessions/{id}/messages- 发送消息GET /sessions/{id}/unread-count- 获取未读消息数POST /sessions/{id}/evaluation- 提交会话评价GET /sessions/{id}/customer-info- 获取当前会话客户信息POST /sessions/{id}/select-request-type- 选择诉求类型GET /sessions/request-type/{requestTypeId}/matched- 获取诉求类型匹配的流程和话术PUT /sessions/{id}/request-type- 更新会话诉求类型GET /sessions/{id}/request-type-switch-history- 获取诉求类型切换历史GET /sessions/{id}/flow-steps- 获取会话的服务流程步骤GET /sessions/{id}/script-recommendations- 获取会话的话术推荐GET /sessions/{id}/smart-script-recommendations- 获取智能话术推荐GET /sessions/flow-step/{flowStepId}/scripts- 获取流程步骤的话术列表POST /sessions/{id}/move-to-next-step- 移动到下一步POST /sessions/{id}/move-to-previous-step- 移动到上一步POST /sessions/{id}/move-to-step- 移动到指定步骤GET /sessions/{id}/emotion-analysis- 获取会话情绪分析概览POST /sessions/{id}/transfer- 转接会话POST /sessions/{id}/close- 结束会话POST /sessions/messages/{messageId}/read- 标记消息已读
GET /work-orders/my- 获取我的工单GET /work-orders/{id}- 根据ID获取工单GET /work-orders/session/{sessionId}- 根据会话ID获取工单POST /work-orders- 创建工单PUT /work-orders/{id}- 更新工单POST /work-orders/{id}/assign- 分配工单POST /work-orders/{id}/resolve- 解决工单POST /work-orders/{id}/close- 关闭工单POST /work-orders/{id}/cancel- 取消工单DELETE /work-orders/{id}- 删除工单POST /work-orders/auto-create/{sessionId}- 自动创建工单GET /work-orders/{id}/tracking- 获取工单跟踪信息
POST /ai/suggest-scripts- 智能话术建议POST /ai/analyze-intent- 意图识别POST /ai/generate-summary- 生成会话摘要POST /ai/speech-to-text- 语音转文字POST /ai/digital-avatar- 数字人交互
GET /analytics/my-statistics- 获取个人统计数据GET /analytics/request-types- 获取诉求类型统计GET /analytics/overview- 获取系统概览GET /analytics/top-request-types- 获取热门诉求类型排行GET /analytics/agent-ranking- 获取坐席排行榜GET /analytics/operation-report- 生成运营报表GET /analytics/agent-service-time- 获取各坐席服务时间统计GET /analytics/agent-call-volume- 获取各坐席通话量统计
GET /system-config- 获取所有配置GET /system-config/public- 获取公开配置GET /system-config/type/{type}- 根据类型获取配置GET /system-config/key/{key}- 根据Key获取配置GET /system-config/homepage- 获取首页配置GET /system-config/homepage/entries- 获取首页快捷入口PUT /system-config/batch- 批量更新配置
GET /security-monitor/login-stats- 获取登录统计GET /security-monitor/login-history- 获取登录历史GET /security-monitor/pending-anomalies- 获取待处理异常GET /security-monitor/high-severity-anomalies- 获取高危异常POST /security-monitor/anomalies/{id}/resolve- 解决异常
GET /knowledge- 获取所有知识GET /knowledge/search?keyword=xxx- 搜索知识GET /knowledge/popular- 热门知识POST /knowledge/{id}/use- 使用知识POST /knowledge/{id}/helpful- 标记有帮助
GET /customers/{id}- 根据ID获取客户GET /customers/no/{customerNo}- 根据客户编号获取客户GET /customers/phone/{phone}- 根据手机号获取客户GET /customers/high-risk- 获取高风险客户GET /customers/top-value- 获取高价值客户GET /customers/vip- 获取VIP客户POST /customers- 创建客户PUT /customers/{id}- 更新客户信息POST /customers/{id}/risk-assessment- 更新风险评估
POST /feedback- 提交反馈GET /feedback/my- 获取我的反馈GET /feedback/customer/{customerId}- 获取客户反馈历史GET /feedback/my-average- 获取我的平均满意度GET /feedback/overall-average- 获取整体平均满意度GET /feedback/require-followup- 获取需要跟进的反馈GET /feedback/statistics- 反馈统计
GET /frequent-questions/top- 获取热门问题Top20GET /frequent-questions/recent- 获取最近高频问题GET /frequent-questions/analysis-report- 获取分析报告POST /frequent-questions/record- 记录问题GET /frequent-questions/without-answer- 获取未关联答案的高频问题POST /frequent-questions/analyze-messages- 从历史消息中分析常见问题GET /frequent-questions/{id}/recommend-scripts- 根据高频问题推荐话术
GET /quality-monitor/my-score- 获取我的质量评分GET /quality-monitor/real-time-metrics- 获取实时质量指标POST /quality-monitor/check-session/{id}- 会话质检GET /quality-monitor/alerts- 获取质量告警GET /quality-monitor/report- 生成质量报告
系统已在 application.yml 中预置了第三方API配置模板,无需修改代码,只需填写你的 API Key:
编辑 src/main/resources/application.yml,找到 third-party: 配置段
third-party:
# 智能对话API (OpenAI / 通义千问 / 文心一言)
ai:
provider: openai # 选择服务商
api-url: https://api.openai.com/v1/chat/completions
api-key: sk-proj-xxxxxxxxxx # ⬅️ 填写你的API Key
model: gpt-3.5-turbo
# 短信服务API (阿里云 / 腾讯云)
sms:
provider: aliyun
access-key-id: LTAI5xxxxxxxxxx # ⬅️ 填写你的Key
access-key-secret: xxxxxxxxxx # ⬅️ 填写你的Secret
# 邮件服务API
email:
api-url: smtp.qq.com
api-key: xxxxxxxxxxxxxxxx # ⬅️ QQ邮箱授权码
from: your-email@qq.com配置完成后重启应用即可使用!
- 🔑 API配置快速指南: 查看下方API配置详细说明
- 📖 API对接详细说明: 查看下方API对接指南
- 💡 API使用示例: 查看下方API使用示例
- OpenAI GPT (gpt-3.5-turbo, gpt-4)
- 阿里云通义千问 (qwen-turbo, qwen-max)
- 百度文心一言 (ERNIE-Bot)
- 阿里云短信服务
- 腾讯云短信服务
- SMTP (支持QQ邮箱、163邮箱等)
- SendGrid
- Mailgun
- 科大讯飞
- 百度语音识别
- 腾讯云语音识别
生产环境建议使用环境变量,而不是直接在配置文件中写API Key:
third-party:
ai:
api-key: ${OPENAI_API_KEY:} # 从环境变量读取设置环境变量:
# Windows
set OPENAI_API_KEY=sk-proj-xxxxxxxxxx
# Linux/Mac
export OPENAI_API_KEY="sk-proj-xxxxxxxxxx"主要数据表:
sys_user- 用户表request_type- 诉求类型表service_flow- 服务流程表flow_step- 流程步骤表script- 话术表script_favorite- 话术收藏表session- 会话表message- 消息表session_step- 会话步骤记录表work_order- 工单表service_record- 服务记录表system_config- 系统配置表login_log- 登录日志表anomaly_log- 异常日志表knowledge- 知识库表customer- 客户表feedback- 反馈表frequent_question- 高频问题表
系统启动后可使用以下默认账号登录(需先执行初始化脚本):
- 管理员: admin / admin123
- 坐席: agent / agent123
- 使用开发环境配置:
--spring.profiles.active=dev - API测试推荐使用Postman或通过Swagger UI
- WebSocket测试可使用在线工具或编写前端测试页面
- 建议使用Redis Desktop Manager查看缓存数据
# 构建镜像
docker build -t agent-system:1.0 .
# 运行容器
docker run -d -p 8080:8080 \
-e DB_USERNAME=root \
-e DB_PASSWORD=password \
-e REDIS_HOST=redis \
agent-system:1.0# 打包
mvn clean package -DskipTests
# 运行
java -jar target/agent-1.0-SNAPSHOT.jar --spring.profiles.active=prod实体: SystemConfig
功能:
- 首页配置管理(标题、Logo、入口配置)
- 登录页配置管理(背景、标题、样式)
- 系统参数配置
- 支持按类型分组管理
实体: LoginLog, AnomalyLog
功能:
- 登录日志记录(成功/失败、IP、设备类型)
- 登录次数统计
- 异常登录检测(多次失败、异地登录)
- 安全告警机制
异常检测规则:
- 1小时内失败登录超过5次 → HIGH级别告警
- 同一IP 1小时内失败超过10次 → HIGH级别告警
实体: Knowledge
功能:
- 知识文档管理(增删改查)
- 知识分类和标签
- 智能搜索(标题、内容、关键词)
- 浏览次数、使用次数统计
- 有帮助/无帮助反馈
实体: Customer
功能:
- 客户基本信息管理
- 客户画像(VIP等级、消费金额、服务次数)
- 风险评估(基于投诉、满意度等)
- 客户分级管理
风险评估规则:
- 投诉次数 > 5次:+30分
- 平均满意度 < 3分:+20分
- 风险分数 >= 50:HIGH风险
实体: Feedback
功能:
- 多维度满意度评价(服务态度、问题解决、响应速度等)
- 评价统计分析
- 需要跟进的反馈管理
- 自动更新客户满意度
实体: FrequentQuestion
功能:
- 自动记录高频问题
- 问题去重(基于MD5哈希)
- 问题热度统计
- 关联标准答案、话术、知识库
服务: QualityMonitorService
功能:
- 坐席质量评分(满意度、响应速度、服务量)
- 实时质量指标监控
- 会话质量检查
- 质量报告生成
评分体系:
- 满意度评分:基于用户评价
- 速度评分:5分钟内100分,超过10分钟0分
- 服务量评分:每天20单满分
系统已在 src/main/resources/application.yml 中预置了第三方API配置模板。
找到 application.yml 文件底部的 third-party 配置段。
根据需要,修改对应服务的配置:
third-party:
# 智能对话API配置
ai:
provider: openai # 你使用的服务商
api-url: https://api.openai.com/v1/chat/completions # API地址
api-key: sk-xxxxxxxxxxxxxxxx # 替换为你的真实API Key
model: gpt-3.5-turbo
timeout: 30000
max-tokens: 2000
temperature: 0.7
# 短信服务API配置
sms:
provider: aliyun
api-url: https://dysmsapi.aliyuncs.com
access-key-id: LTAI5xxxxxxxxxx # 替换为你的AccessKeyId
access-key-secret: xxxxxxxxxxxxx # 替换为你的AccessKeySecret
sign-name: 您的签名名称
template-code: SMS_123456789
# 邮件服务API配置
email:
provider: smtp
api-url: smtp.qq.com
api-key: xxxxxxxxxxxxxxxx # QQ邮箱授权码或其他邮箱密码
from: your-email@qq.com # 发件人邮箱
port: 587修改完成后,保存文件并重启Spring Boot应用,配置即生效。
third-party:
ai:
provider: openai
api-url: https://api.openai.com/v1/chat/completions
api-key: sk-proj-xxxxxxxxxxxxxxxxxxxxxxxx
model: gpt-3.5-turbo # 或 gpt-4获取API Key: https://platform.openai.com/api-keys
third-party:
ai:
provider: tongyi
api-url: https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation
api-key: sk-xxxxxxxxxxxxxxxxxxxxxxxx
model: qwen-turbo获取API Key: https://dashscope.console.aliyun.com/apiKey
third-party:
ai:
provider: wenxin
api-url: https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions
api-key: your-api-key
model: ERNIE-Bot-turbo获取API Key: https://console.bce.baidu.com/qianfan/ais/console/applicationConsole/application
public List<String> suggestScripts(String context, String inputText) {
// 添加依赖:com.theokanning.openai-gpt3-java
OpenAiService service = new OpenAiService("YOUR_API_KEY");
ChatCompletionRequest request = ChatCompletionRequest.builder()
.model("gpt-3.5-turbo")
.messages(Arrays.asList(
new ChatMessage("system", "你是一个客服助手,根据上下文推荐合适的话术。上下文:" + context),
new ChatMessage("user", inputText)
))
.maxTokens(200)
.build();
ChatCompletionResult result = service.createChatCompletion(request);
return result.getChoices().stream()
.map(choice -> choice.getMessage().getContent())
.collect(Collectors.toList());
}public List<String> suggestScripts(String context, String inputText) {
// 添加依赖:com.aliyun:dashscope-sdk-java
Generation gen = new Generation();
Message systemMsg = Message.builder()
.role("system")
.content("你是客服助手,根据上下文推荐话术:" + context)
.build();
Message userMsg = Message.builder()
.role("user")
.content(inputText)
.build();
GenerationParam param = GenerationParam.builder()
.apiKey("YOUR_API_KEY")
.model("qwen-turbo")
.messages(Arrays.asList(systemMsg, userMsg))
.build();
GenerationResult result = gen.call(param);
return Arrays.asList(result.getOutput().getText());
}public List<String> suggestScripts(String context, String inputText) {
// 使用百度千帆SDK
String url = "https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions";
Map<String, Object> params = new HashMap<>();
params.put("messages", Arrays.asList(
Map.of("role", "user", "content", context + "\n" + inputText)
));
// 发送HTTP请求
// ... 返回结果
}public String speechToText(String audioUrl) {
// 添加依赖:com.aliyun:aliyun-java-sdk-core
IAcsClient client = new DefaultAcsClient(profile);
SpeechRecognitionRequest request = new SpeechRecognitionRequest();
request.setFileLink(audioUrl);
request.setFormat("wav");
request.setSampleRate(16000);
SpeechRecognitionResponse response = client.getAcsResponse(request);
return response.getResult();
}public Long analyzeIntent(List<String> messages) {
// 使用阿里云NLP
String url = "https://nlp.cn-shanghai.aliyuncs.com/";
Map<String, Object> params = new HashMap<>();
params.put("text", String.join("\n", messages));
params.put("service", "intent_classification");
// 发送请求并解析结果
// 根据识别出的意图返回对应的诉求类型ID
return requestTypeId;
}public Integer analyzeSentiment(String text) {
String url = "https://aip.baidubce.com/rpc/2.0/nlp/v1/sentiment_classify";
Map<String, String> params = new HashMap<>();
params.put("text", text);
// 发送请求
JSONObject response = sendRequest(url, params);
// 解析情感得分(0-4分别对应:非常负面、负面、中性、正面、非常正面)
int sentiment = response.getJSONObject("items").getInt("sentiment");
return sentiment + 1; // 转换为1-5分
}public Map<String, String> digitalAvatarInteract(String message, String digitalAvatarId) {
String apiUrl = "https://api.sensetime.com/digital-avatar/interact";
Map<String, Object> params = new HashMap<>();
params.put("avatar_id", digitalAvatarId);
params.put("text", message);
params.put("emotion", "neutral");
JSONObject response = sendRequest(apiUrl, params);
return Map.of(
"text", response.getString("response_text"),
"videoUrl", response.getString("video_url")
);
}curl -X POST http://localhost:8080/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"username": "admin",
"password": "admin123"
}'curl -X GET http://localhost:8080/api/auth/current \
-H "Authorization: Bearer YOUR_TOKEN"curl -X GET http://localhost:8080/api/request-types/active \
-H "Authorization: Bearer YOUR_TOKEN"curl -X POST http://localhost:8080/api/request-types \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "话费咨询",
"code": "BILL_CONSULT",
"description": "话费相关咨询",
"icon": "bill",
"color": "#409EFF",
"sortOrder": 1,
"status": true
}'curl -X GET "http://localhost:8080/api/scripts/search?keyword=您好" \
-H "Authorization: Bearer YOUR_TOKEN"curl -X POST http://localhost:8080/api/scripts/favorites \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"scriptId": 1,
"customTitle": "我的常用问候语",
"customTags": "常用,问候"
}'curl -X POST http://localhost:8080/api/sessions \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customerId": "13800138000",
"customerName": "张三",
"customerPhone": "13800138000",
"requestTypeId": 1
}'curl -X POST http://localhost:8080/api/sessions/1/messages \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"content": "您好,请问有什么可以帮助您?",
"type": "TEXT",
"senderName": "客服小张"
}'curl -X POST http://localhost:8080/api/work-orders \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "网络故障",
"description": "客户反馈网络无法连接",
"sessionId": 1,
"requestTypeId": 3,
"priority": 3,
"customerId": "13800138000",
"customerName": "张三",
"customerPhone": "13800138000"
}'curl -X POST http://localhost:8080/api/ai/suggest-scripts \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"context": "客户咨询话费",
"inputText": "我想查一下"
}'curl -X GET "http://localhost:8080/api/analytics/my-statistics?startTime=2024-01-01T00:00:00&endTime=2024-01-31T23:59:59" \
-H "Authorization: Bearer YOUR_TOKEN"curl -X PUT http://localhost:8080/api/system-config/batch \
-H "Authorization: Bearer TOKEN" \
-d '{
"homepage.title": "我的客服系统",
"homepage.logo": "/assets/my-logo.png"
}'curl -X GET "http://localhost:8080/api/security-monitor/login-history?startTime=2024-01-01T00:00:00&endTime=2024-12-31T23:59:59" \
-H "Authorization: Bearer TOKEN"curl -X GET "http://localhost:8080/api/knowledge/search?keyword=话费" \
-H "Authorization: Bearer TOKEN"curl -X GET "http://localhost:8080/api/frequent-questions/top?limit=20" \
-H "Authorization: Bearer TOKEN"curl -X GET "http://localhost:8080/api/quality-monitor/my-score?startTime=2024-01-01T00:00:00" \
-H "Authorization: Bearer TOKEN"-
安全性:
- 修改默认的JWT密钥
- 在生产环境使用强密码
- 启用HTTPS
-
性能优化:
- 合理使用Redis缓存
- 数据库索引优化
- 启用数据库连接池
-
第三方API:
- 需要自行申请API密钥
- 注意API调用频率限制
- 处理好异常情况
-
数据库迁移:
- 如果您已经运行了旧版本,新表会通过JPA的
ddl-auto: update自动创建 - 或者可以重新执行init.sql初始化脚本
- 如果您已经运行了旧版本,新表会通过JPA的
MIT License
如有问题,请联系项目维护者。