Browse Source

,修复了分块查询、状态切换和批量操作三个核心问题

dev-mcp
wanghanlin 3 weeks ago
parent
commit
250f643a42
  1. 12
      CLAUDE.md
  2. 5
      client/dist/chatbot-sdk.js
  3. 2
      client/dist/chatbot-sdk.js.map
  4. 2
      client/dist/chatbot-sdk.min.js
  5. 2
      client/dist/chatbot-sdk.min.js.map
  6. 4
      src/main/resources/init-database.sql
  7. 5
      src/main/resources/static/sdk/chatbot-sdk.js
  8. 2
      src/main/resources/static/sdk/chatbot-sdk.js.map
  9. 2
      src/main/resources/static/sdk/chatbot-sdk.min.js
  10. 2
      src/main/resources/static/sdk/chatbot-sdk.min.js.map

12
CLAUDE.md

@ -117,6 +117,18 @@ AI 智能客服系统,基于 Spring AI Alibaba + 通义千问 + PGVector,支
## 开发规范与踩坑记录 ## 开发规范与踩坑记录
### 后端:数据库变更必须同步到启动初始化
**规则**: 任何涉及表结构(建表、增删改列、索引)、初始数据(种子数据、默认配置)的变更,**必须同步记录到以下两个文件**,否则新部署环境或重建数据库时会丢失变更:
| 文件 | 作用 | 需要同步的内容 |
|------|------|----------------|
| `DatabaseInitConfig.java` | 应用启动自动执行(主力) | 建表 SQL(`CREATE TABLE IF NOT EXISTS`)、列迁移(`ALTER TABLE ADD COLUMN IF NOT EXISTS`)、种子数据(`ON CONFLICT ... DO UPDATE`) |
| `init-database.sql` | 手动备用脚本 | 与 `DatabaseInitConfig` 保持一致的完整建表 + 索引 + 种子数据 |
**流程**: 改完 Entity / Mapper 后,先在 `DatabaseInitConfig.init()` 中添加对应的初始化逻辑(幂等检查 + safeInit 包裹),再同步更新 `init-database.sql`
**反面案例**: `knowledge_document.content_hash` 列仅在 `DatabaseInitConfig` 中迁移,未同步到 `knowledge-base.sql`,导致该脚本变为过时版本。
### 后端:Long ID 序列化为字符串 ### 后端:Long ID 序列化为字符串
**规则**: 所有雪花算法生成的 Long 类型 ID 字段,必须保证前端收到的是**字符串**而非数字,防止 JS 超过 `Number.MAX_SAFE_INTEGER`(2^53)精度丢失。 **规则**: 所有雪花算法生成的 Long 类型 ID 字段,必须保证前端收到的是**字符串**而非数字,防止 JS 超过 `Number.MAX_SAFE_INTEGER`(2^53)精度丢失。

5
client/dist/chatbot-sdk.js

@ -249,7 +249,7 @@ var ChatbotSDK = (function () {
showTeaser: (_f = raw.showTeaser) !== null && _f !== void 0 ? _f : true, showTeaser: (_f = raw.showTeaser) !== null && _f !== void 0 ? _f : true,
teaserText: (typeof raw.teaserText === 'string' && raw.teaserText.trim()) || '', teaserText: (typeof raw.teaserText === 'string' && raw.teaserText.trim()) || '',
streaming: (_g = raw.streaming) !== null && _g !== void 0 ? _g : true, streaming: (_g = raw.streaming) !== null && _g !== void 0 ? _g : true,
enableRag: (_h = raw.enableRag) !== null && _h !== void 0 ? _h : false,
enableRag: (_h = raw.enableRag) !== null && _h !== void 0 ? _h : true,
rewriteStrategy: raw.rewriteStrategy || 'REWRITE', rewriteStrategy: raw.rewriteStrategy || 'REWRITE',
locale: raw.locale || 'zh-CN', locale: raw.locale || 'zh-CN',
debug: (_j = raw.debug) !== null && _j !== void 0 ? _j : true, debug: (_j = raw.debug) !== null && _j !== void 0 ? _j : true,
@ -4059,8 +4059,9 @@ var ChatbotSDK = (function () {
} }
/** 设置当前知识库分类 */ /** 设置当前知识库分类 */
function setCategory(categoryId) { function setCategory(categoryId) {
var _a;
currentCategoryId = categoryId; currentCategoryId = categoryId;
useRag = config$1?.enableRag ?? true;
useRag = (_a = config$1 === null || config$1 === void 0 ? void 0 : config$1.enableRag) !== null && _a !== void 0 ? _a : true;
logger.lifecycleCategoryChange(categoryId !== null && categoryId !== void 0 ? categoryId : '全部'); logger.lifecycleCategoryChange(categoryId !== null && categoryId !== void 0 ? categoryId : '全部');
} }
// ==================== 会话管理面板 ==================== // ==================== 会话管理面板 ====================

2
client/dist/chatbot-sdk.js.map
File diff suppressed because it is too large
View File

2
client/dist/chatbot-sdk.min.js
File diff suppressed because it is too large
View File

2
client/dist/chatbot-sdk.min.js.map
File diff suppressed because it is too large
View File

4
src/main/resources/init-database.sql

@ -3,6 +3,10 @@
-- 适用环境: PostgreSQL 12+ 且已安装 pgvector 扩展 -- 适用环境: PostgreSQL 12+ 且已安装 pgvector 扩展
-- 表数量: 14 张(基础 8 张 + P0 阶段新增 6 张) -- 表数量: 14 张(基础 8 张 + P0 阶段新增 6 张)
-- --
-- ⚠️ 开发规范:任何涉及建表、增删改列、初始数据的变更,
-- 必须同时更新本脚本和 DatabaseInitConfig.java(自动初始化),
-- 保持两者一致,否则新部署环境会丢失变更。
--
-- 使用方法: -- 使用方法:
-- 方式一(psql 命令行): -- 方式一(psql 命令行):
-- psql -U postgres -f init-database.sql -- psql -U postgres -f init-database.sql

5
src/main/resources/static/sdk/chatbot-sdk.js

@ -249,7 +249,7 @@ var ChatbotSDK = (function () {
showTeaser: (_f = raw.showTeaser) !== null && _f !== void 0 ? _f : true, showTeaser: (_f = raw.showTeaser) !== null && _f !== void 0 ? _f : true,
teaserText: (typeof raw.teaserText === 'string' && raw.teaserText.trim()) || '', teaserText: (typeof raw.teaserText === 'string' && raw.teaserText.trim()) || '',
streaming: (_g = raw.streaming) !== null && _g !== void 0 ? _g : true, streaming: (_g = raw.streaming) !== null && _g !== void 0 ? _g : true,
enableRag: (_h = raw.enableRag) !== null && _h !== void 0 ? _h : false,
enableRag: (_h = raw.enableRag) !== null && _h !== void 0 ? _h : true,
rewriteStrategy: raw.rewriteStrategy || 'REWRITE', rewriteStrategy: raw.rewriteStrategy || 'REWRITE',
locale: raw.locale || 'zh-CN', locale: raw.locale || 'zh-CN',
debug: (_j = raw.debug) !== null && _j !== void 0 ? _j : true, debug: (_j = raw.debug) !== null && _j !== void 0 ? _j : true,
@ -4059,8 +4059,9 @@ var ChatbotSDK = (function () {
} }
/** 设置当前知识库分类 */ /** 设置当前知识库分类 */
function setCategory(categoryId) { function setCategory(categoryId) {
var _a;
currentCategoryId = categoryId; currentCategoryId = categoryId;
useRag = config$1?.enableRag ?? true;
useRag = (_a = config$1 === null || config$1 === void 0 ? void 0 : config$1.enableRag) !== null && _a !== void 0 ? _a : true;
logger.lifecycleCategoryChange(categoryId !== null && categoryId !== void 0 ? categoryId : '全部'); logger.lifecycleCategoryChange(categoryId !== null && categoryId !== void 0 ? categoryId : '全部');
} }
// ==================== 会话管理面板 ==================== // ==================== 会话管理面板 ====================

2
src/main/resources/static/sdk/chatbot-sdk.js.map
File diff suppressed because it is too large
View File

2
src/main/resources/static/sdk/chatbot-sdk.min.js
File diff suppressed because it is too large
View File

2
src/main/resources/static/sdk/chatbot-sdk.min.js.map
File diff suppressed because it is too large
View File

Loading…
Cancel
Save