新增功能: - AI智能助手: DeepSeek多轮推理、函数调用(searchStock/createOrder等) - silent动作: AI识别无需回复的消息(好的/谢谢/再见)自动跳过回执 - ai_enabled灰度开关: 群级别控制AI启停,支持逐群放量 - 消息列表增强: storeId/groupId/groupName/userName/content/sourceType多条件筛选,时间格式化 代码优化: - processWithAI: 多轮推理循环(MAX_ROUNDS=5)、对话历史不含[#N]前缀防AI污染 - 回执记录补齐group_id/user_id/group_name/user_name上下文 - 移除未使用的target_channel字段及迁移 - bindCode文档修正: store_warehouse → store 接口文档: - system.json v0.3.18→0.3.19: 新增aiEnabled参数、消息列表响应扩充 - changes/system.json: 新增bindCode变更记录 杂项: - store_warehouse.js JSDoc补全 - wave.js waveBatchSource修复
58 lines
1.5 KiB
JavaScript
58 lines
1.5 KiB
JavaScript
'use strict';
|
|
|
|
const TABLE_NAME = 'wms_inbox_block';
|
|
|
|
module.exports = {
|
|
/**
|
|
* 创建站内信屏蔽表。
|
|
* @param {Object} queryInterface Sequelize QueryInterface 实例。
|
|
* @param {Object} Sequelize Sequelize 类。
|
|
* @return {Promise<void>} 迁移执行结果。
|
|
*/
|
|
up: async (queryInterface, Sequelize) => {
|
|
const tables = await queryInterface.showAllTables();
|
|
const exists = tables.some(t => (typeof t === 'string' ? t : t.tableName) === TABLE_NAME);
|
|
if (exists) return;
|
|
|
|
await queryInterface.createTable(TABLE_NAME, {
|
|
id: {
|
|
type: Sequelize.BIGINT(20).UNSIGNED,
|
|
primaryKey: true,
|
|
autoIncrement: true,
|
|
allowNull: false,
|
|
comment: '主键',
|
|
},
|
|
group_name: {
|
|
type: Sequelize.STRING(100),
|
|
allowNull: true,
|
|
comment: '群名称',
|
|
},
|
|
user_name: {
|
|
type: Sequelize.STRING(100),
|
|
allowNull: true,
|
|
comment: '用户名称',
|
|
},
|
|
created_at: {
|
|
type: Sequelize.DATE,
|
|
allowNull: false,
|
|
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
comment: '创建时间',
|
|
},
|
|
});
|
|
|
|
await queryInterface.addIndex(TABLE_NAME, [ 'group_name', 'user_name' ], {
|
|
unique: true,
|
|
name: 'uk_group_user',
|
|
});
|
|
},
|
|
|
|
/**
|
|
* 回滚:删除站内信屏蔽表。
|
|
* @param {Object} queryInterface Sequelize QueryInterface 实例。
|
|
* @return {Promise<void>} 迁移回滚结果。
|
|
*/
|
|
down: async queryInterface => {
|
|
await queryInterface.dropTable(TABLE_NAME);
|
|
},
|
|
};
|