-- 2026-07-15
-- Add ViiTorTTS voice clone menu and permissions.

DELETE FROM `sys_role_menu`
WHERE `menu_id` IN (4034, 4035);

DELETE FROM `sys_menu`
WHERE `menu_id` IN (4034, 4035)
   OR `perms` IN ('aicall:vtvoiceclone:view', 'aicall:vtvoiceclone:registerVoice')
   OR `url` = '/aicall/vtvoiceclone/voiceclone';

INSERT INTO `sys_menu`
(`menu_id`, `menu_name`, `menu_code`, `parent_id`, `order_num`, `url`, `target`, `menu_type`, `visible`, `is_refresh`, `perms`, `icon`, `create_by`, `create_time`, `remark`)
VALUES
(4034, 'ViiTorTTS音色注册', 'vtvoiceclone', 3019, 12, '/aicall/vtvoiceclone/voiceclone', 'menuItem', 'C', '0', '1', 'aicall:vtvoiceclone:view', 'fa fa-microphone', 'admin', NOW(), 'ViiTorTTS音色注册工具');

INSERT INTO `sys_menu`
(`menu_id`, `menu_name`, `menu_code`, `parent_id`, `order_num`, `url`, `target`, `menu_type`, `visible`, `is_refresh`, `perms`, `icon`, `create_by`, `create_time`, `remark`)
VALUES
(4035, 'ViiTorTTS音色注册提交', 'vtvoicecloneRegister', 4032, 1, '#', '', 'F', '0', '1', 'aicall:vtvoiceclone:registerVoice', '#', 'admin', NOW(), 'ViiTorTTS音色注册提交权限');

INSERT INTO `sys_role_menu` (`role_id`, `menu_id`)
VALUES
(2, 4034),
(2, 4035);

DELETE FROM `cc_tts_aliyun`
WHERE `voice_code` = 'juvenile'
  AND `voice_source` = 'vt_tts';

INSERT INTO `cc_tts_aliyun`
(`voice_name`, `voice_code`, `voice_enabled`, `voice_source`, `priority`, `provider`, `language_code`, `language_name`, `tts_models`)
VALUES
('ViiTor默认女声 - juvenile', 'juvenile', 1, 'vt_tts', 0, 'vt_tts', 'zh-CN', '中文', 'standard');
