
-- 清理旧数据，确保脚本可重复执行
DELETE FROM system_menu WHERE id IN (6500,6501,650101,650102,650103);

-- 顶级目录（父级假定为 id=2 的系统管理目录）
INSERT INTO system_menu (
	id, name, permission, type, sort, parent_id,
	path, icon, component, status, component_name
) VALUES (
	6500, '统一外部网关', '', 1, 20, 1,
	'databus', 'ep:data-line', '', 0, NULL
);

-- API 门户页面
INSERT INTO system_menu (
	id, name, permission, type, sort, parent_id,
	path, icon, component, status, component_name
) VALUES (
	6501, 'API 门户', 'databus:gateway:query', 2, 1, 6500,
	'databus-gateway', 'ep:cpu', 'databus/gateway/index', 0, 'DatabusGateway'
);

-- 页面内操作按钮权限
INSERT INTO system_menu (
	id, name, permission, type, sort, parent_id,
	path, icon, component, status
) VALUES
	(650101, 'API 列表', 'databus:gateway:query', 3, 1, 6501, '', '', '', 0),
	(650102, 'API 调试', 'databus:gateway:invoke', 3, 2, 6501, '', '', '', 0),
	(650103, '刷新定义', 'databus:gateway:refresh', 3, 3, 6501, '', '', '', 0);
d