SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- 社区管理模块按钮权限补充
-- ----------------------------
BEGIN;

-- 文章管理按钮权限（parent_id = 2075）
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(2077, '文章创建', 'community:post:create', 3, 1, 2075, '', '', NULL, NULL, 0, b'0', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(2078, '文章更新', 'community:post:update', 3, 2, 2075, '', '', NULL, NULL, 0, b'0', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(2079, '文章删除', 'community:post:delete', 3, 3, 2075, '', '', NULL, NULL, 0, b'0', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(2080, '文章审核', 'community:post:review', 3, 4, 2075, '', '', NULL, NULL, 0, b'0', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- 活动管理按钮权限（parent_id = 2062）
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(2081, '活动创建', 'community:activity:create', 3, 1, 2062, '', '', NULL, NULL, 0, b'0', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(2082, '活动更新', 'community:activity:update', 3, 2, 2062, '', '', NULL, NULL, 0, b'0', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(2083, '活动删除', 'community:activity:delete', 3, 3, 2062, '', '', NULL, NULL, 0, b'0', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- Banner管理按钮权限（parent_id = 2063）
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(2084, 'Banner创建', 'community:banner:create', 3, 1, 2063, '', '', NULL, NULL, 0, b'0', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(2085, 'Banner更新', 'community:banner:update', 3, 2, 2063, '', '', NULL, NULL, 0, b'0', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(2086, 'Banner删除', 'community:banner:delete', 3, 3, 2063, '', '', NULL, NULL, 0, b'0', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- 封禁管理按钮权限（parent_id = 2060）
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(2087, '封禁创建', 'community:ban:create', 3, 1, 2060, '', '', NULL, NULL, 0, b'0', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(2088, '封禁更新', 'community:ban:update', 3, 2, 2060, '', '', NULL, NULL, 0, b'0', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(2089, '解禁用户', 'community:ban:unban', 3, 3, 2060, '', '', NULL, NULL, 0, b'0', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- 举报管理按钮权限（parent_id = 2061）
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(2090, '举报处理', 'community:report:handle', 3, 1, 2061, '', '', NULL, NULL, 0, b'0', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- 敏感词管理按钮权限补充（parent_id = 2076，如果2032已存在则跳过）
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(2091, '敏感词导入', 'community:sensitive-word:import', 3, 5, 2076, '', '', NULL, NULL, 0, b'0', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0')
ON DUPLICATE KEY UPDATE `name` = VALUES(`name`);

COMMIT;
SET FOREIGN_KEY_CHECKS = 1;

