CREATE TABLE IF NOT EXISTS `hot_words` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `text` VARCHAR(255) NOT NULL COMMENT '热词内容',
  `weight` INT NOT NULL DEFAULT 4 COMMENT '词汇权重 (1-10)',
  `lang` VARCHAR(20) NOT NULL DEFAULT 'zh' COMMENT '语言 (zh/en)',
  `status` TINYINT NOT NULL DEFAULT 1 COMMENT '状态 (1:启用, 0:禁用)',
  `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_text_lang` (`text`, `lang`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统语音识别热词表';

-- 预留存储 Vocabulary ID 的配置项（如果不想用字典表存储配置，也可以在系统配置表中增加）
INSERT INTO `dict_data` (dict_type, dict_code, parent_code, label_cn, status) 
VALUES ('system_config', 'asr_vocabulary_id', 'ROOT', '阿里云ASR热词表ID', 1)
ON DUPLICATE KEY UPDATE label_cn='阿里云ASR热词表ID';
