|
|
@@ -8855,5 +8855,53 @@ private void runMigration100() {
|
|
|
} catch (Exception ex) {
|
|
|
log.warn("插入GROWTH_COACH权益种子数据失败: {}", ex.getMessage());
|
|
|
}
|
|
|
+
|
|
|
+ // 迁移230: 创建 admin_menu 表(后台菜单管理)
|
|
|
+ try {
|
|
|
+ jdbcTemplate.execute(
|
|
|
+ "CREATE TABLE IF NOT EXISTS admin_menu (" +
|
|
|
+ "id BIGINT AUTO_INCREMENT PRIMARY KEY, " +
|
|
|
+ "parent_id BIGINT DEFAULT 0 COMMENT '父菜单ID,0=顶级', " +
|
|
|
+ "name VARCHAR(50) NOT NULL COMMENT '菜单名称', " +
|
|
|
+ "path VARCHAR(200) DEFAULT NULL COMMENT '路由路径', " +
|
|
|
+ "icon VARCHAR(50) DEFAULT NULL COMMENT '图标类名', " +
|
|
|
+ "sort_order INT DEFAULT 0 COMMENT '排序号', " +
|
|
|
+ "perm VARCHAR(100) DEFAULT NULL COMMENT '权限标识', " +
|
|
|
+ "component VARCHAR(200) DEFAULT NULL COMMENT '前端组件路径', " +
|
|
|
+ "visible TINYINT DEFAULT 1 COMMENT '是否显示:0隐藏1显示', " +
|
|
|
+ "created_at DATETIME DEFAULT CURRENT_TIMESTAMP, " +
|
|
|
+ "updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, " +
|
|
|
+ "INDEX idx_parent (parent_id)" +
|
|
|
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='后台管理菜单'"
|
|
|
+ );
|
|
|
+ log.info("已创建admin_menu表");
|
|
|
+ } catch (Exception ex) {
|
|
|
+ log.warn("创建admin_menu表失败: {}", ex.getMessage());
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ jdbcTemplate.execute("INSERT IGNORE INTO admin_menu (parent_id, name, path, icon, sort_order, perm, component, visible) VALUES " +
|
|
|
+ "(0, '首页', '/dashboard', 'el-icon-house', 0, 'dashboard', 'admin/Dashboard', 1), " +
|
|
|
+ "(0, '家庭管理', NULL, 'el-icon-user', 10, 'family:list', NULL, 1), " +
|
|
|
+ "(1, '家庭列表', '/families', 'el-icon-office-building', 1, 'family:list', 'Families', 1), " +
|
|
|
+ "(1, '孩子管理', '/children', 'el-icon-child', 2, 'family:children', 'Children', 1), " +
|
|
|
+ "(0, '积分管理', NULL, 'el-icon-ticket', 20, 'family:points', NULL, 1), " +
|
|
|
+ "(3, '积分记录', '/points-log', 'el-icon-document', 1, 'family:points', 'admin/PointsLog', 1), " +
|
|
|
+ "(0, '会员管理', NULL, 'el-icon-v-ip', 30, 'system:config', NULL, 1), " +
|
|
|
+ "(4, '会员中心', '/membership-center', 'el-icon-setting', 1, 'system:config', 'admin/MembershipCenter', 1), " +
|
|
|
+ "(0, '订单管理', NULL, 'el-icon-shopping-cart-2', 40, 'product:list', NULL, 1), " +
|
|
|
+ "(6, '商品订单', '/product-orders', 'el-icon-s-order', 1, 'product:list', 'admin/ProductManage', 1), " +
|
|
|
+ "(0, '内容管理', NULL, 'el-icon-document-checked', 50, 'article:list', NULL, 1), " +
|
|
|
+ "(8, '文章管理', '/article-manage', 'el-icon-edit', 1, 'article:list', 'admin/ArticleManage', 1), " +
|
|
|
+ "(8, '分类管理', '/article-category', 'el-icon-folder', 2, 'article:list', 'admin/ArticleCategory', 1), " +
|
|
|
+ "(0, '测评管理', NULL, 'el-icon-reading', 60, 'assessment:list', NULL, 1), " +
|
|
|
+ "(10, '测评订单', '/assessment-orders', 'el-icon-tickets', 1, 'assessment:list', 'admin/AssessmentOrders', 1), " +
|
|
|
+ "(10, '测评产品', '/assessment-products', 'el-icon-price-tag', 2, 'assessment:product', 'admin/AssessmentProducts', 1), " +
|
|
|
+ "(0, '系统配置', NULL, 'el-icon-setting', 90, 'system:config', NULL, 1), " +
|
|
|
+ "(14, '菜单管理', '/menu-manage', 'el-icon-menu', 1, 'system:menu', 'admin/MenuManage', 1), " +
|
|
|
+ "(14, '系统配置', '/sys-config', 'el-icon-setting', 2, 'system:config', 'admin/SysConfig', 1)");
|
|
|
+ log.info("已插入admin_menu种子数据");
|
|
|
+ } catch (Exception ex) {
|
|
|
+ log.warn("插入admin_menu种子数据失败: {}", ex.getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
}
|