-- 2026-06-16
-- Add Tencent Cloud voice clone menu and permissions.

DELETE FROM `sys_role_menu`
WHERE `menu_id` IN (4028, 4029, 4030);

DELETE FROM `sys_menu`
WHERE `menu_id` IN (4028, 4029, 4030)
   OR `perms` IN ('aicall:txvoiceclone:view', 'aicall:txvoiceclone:uploadAndClone', 'aicall:txvoiceclone:ttsTest')
   OR `url` = '/aicall/txvoiceclone/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
(4028, '腾讯云音色克隆', 'txvoiceclone', 3019, 10, '/aicall/txvoiceclone/voiceclone', 'menuItem', 'C', '0', '1', 'aicall:txvoiceclone:view', 'fa fa-microphone', 'admin', NOW(), '腾讯云音色克隆工具');

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
(4029, '腾讯云音色克隆上传', 'txvoicecloneUpload', 4028, 1, '#', '', 'F', '0', '1', 'aicall:txvoiceclone:uploadAndClone', '#', 'admin', NOW(), '腾讯云音色克隆上传权限'),
(4030, '腾讯云音色克隆试听', 'txvoicecloneTtsTest', 4028, 2, '#', '', 'F', '0', '1', 'aicall:txvoiceclone:ttsTest', '#', 'admin', NOW(), '腾讯云音色克隆试听权限');

INSERT INTO `sys_role_menu` (`role_id`, `menu_id`)
VALUES
(2, 4028),
(2, 4029),
(2, 4030);
