From 540ef65220e05b75c183cd3554aaeb554927600a Mon Sep 17 00:00:00 2001
From: hejianhao <15708179461@qq.com>
Date: 星期二, 01 九月 2026 15:34:46 +0800
Subject: [PATCH] fix0901: 提交新生成的类
---
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/bootstrap/DataInitializer.java | 43 +++++++++++++++++++++++++++----------------
1 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/tcm-training-admin-backend/src/main/java/com/tcm/training/admin/bootstrap/DataInitializer.java b/tcm-training-admin-backend/src/main/java/com/tcm/training/admin/bootstrap/DataInitializer.java
index 144d0fa..4c24eb2 100644
--- a/tcm-training-admin-backend/src/main/java/com/tcm/training/admin/bootstrap/DataInitializer.java
+++ b/tcm-training-admin-backend/src/main/java/com/tcm/training/admin/bootstrap/DataInitializer.java
@@ -15,12 +15,13 @@
import org.springframework.boot.ApplicationRunner;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Component;
+import com.tcm.training.admin.common.enums.EnabledStatus;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
-@Component
+//@Component
public class DataInitializer implements ApplicationRunner {
private final SysUserService sysUserService;
@@ -56,7 +57,7 @@
user.setUsername("admin");
user.setNickname("管理员");
user.setRealName("系统管理员");
- user.setStatus(1);
+ user.setStatus(EnabledStatus.ENABLED.getValue());
user.setDeleted(0);
user.setPassword(passwordEncoder.encode("Admin@123456"));
user.setCreatedAt(LocalDateTime.now());
@@ -82,7 +83,7 @@
role = new SysRole();
role.setRoleName("超级管理员");
role.setRoleCode("SUPER_ADMIN");
- role.setStatus(1);
+ role.setStatus(EnabledStatus.ENABLED.getValue());
role.setDeleted(0);
role.setRemark("默认拥有全部后台权限");
role.setCreatedAt(LocalDateTime.now());
@@ -316,24 +317,34 @@
null, null, null, 8, "live:health-course:video:edit", "养生课程视频编辑按钮"));
menuIds.add(saveMenu(3119L, 3110L, "删除视频课程", "live_health_course_video_delete", "B",
null, null, null, 9, "live:health-course:video:delete", "养生课程视频删除按钮"));
- menuIds.add(saveMenu(3120L, 3050L, "健康科普", "live_health_popularization_manage", "C",
- "/live/course/health-popularization", "Live/HealthPopularizationList", null, 50, "live:health-popularization:view", "健康科普菜单"));
- menuIds.add(saveMenu(3121L, 3120L, "新增健康科普", "live_health_popularization_add", "B",
- null, null, null, 1, "live:health-popularization:add", "健康科普新增按钮"));
- menuIds.add(saveMenu(3122L, 3120L, "编辑健康科普", "live_health_popularization_edit", "B",
- null, null, null, 2, "live:health-popularization:edit", "健康科普编辑按钮"));
- menuIds.add(saveMenu(3123L, 3120L, "删除健康科普", "live_health_popularization_delete", "B",
- null, null, null, 3, "live:health-popularization:delete", "健康科普删除按钮"));
- menuIds.add(saveMenu(6010L, 3050L, "项目介绍", "live_project_introduction_manage", "C",
- "/live/course/project-introduction", "Live/ProjectIntroductionList", null, 60, "live:project-introduction:view", "项目介绍菜单"));
+ menuIds.add(saveMenu(3120L, 6100L, "健康知识", "live_health_popularization_manage", "C",
+ "/live/promotion/health-popularization", "Live/HealthPopularizationList", null, 50, "live:health-popularization:view", "健康知识菜单"));
+ menuIds.add(saveMenu(3121L, 3120L, "新增健康知识", "live_health_popularization_add", "B",
+ null, null, null, 1, "live:health-popularization:add", "健康知识新增按钮"));
+ menuIds.add(saveMenu(3122L, 3120L, "编辑健康知识", "live_health_popularization_edit", "B",
+ null, null, null, 2, "live:health-popularization:edit", "健康知识编辑按钮"));
+ menuIds.add(saveMenu(3123L, 3120L, "删除健康知识", "live_health_popularization_delete", "B",
+ null, null, null, 3, "live:health-popularization:delete", "健康知识删除按钮"));
+ menuIds.add(saveMenu(6110L, 6100L, "养生科普", "live_health_promotion_manage", "C",
+ "/live/promotion/health-promotion", "Live/HealthPromotionList", null, 51, "live:health-promotion:view", "养生科普菜单"));
+ menuIds.add(saveMenu(6111L, 6110L, "新增养生科普", "live_health_promotion_add", "B",
+ null, null, null, 1, "live:health-promotion:add", "养生科普新增按钮"));
+ menuIds.add(saveMenu(6112L, 6110L, "编辑养生科普", "live_health_promotion_edit", "B",
+ null, null, null, 2, "live:health-promotion:edit", "养生科普编辑按钮"));
+ menuIds.add(saveMenu(6113L, 6110L, "删除养生科普", "live_health_promotion_delete", "B",
+ null, null, null, 3, "live:health-promotion:delete", "养生科普删除按钮"));
+ menuIds.add(saveMenu(6100L, 3000L, "宣传知识", "live_promotion_root", "M",
+ "/live/promotion", null, null, 20, null, "宣传知识目录"));
+ menuIds.add(saveMenu(6010L, 6100L, "项目介绍", "live_project_introduction_manage", "C",
+ "/live/promotion/project-introduction", "Live/ProjectIntroductionList", null, 60, "live:project-introduction:view", "项目介绍菜单"));
menuIds.add(saveMenu(6011L, 6010L, "新增项目介绍", "live_project_introduction_add", "B",
null, null, null, 1, "live:project-introduction:add", "项目介绍新增按钮"));
menuIds.add(saveMenu(6012L, 6010L, "编辑项目介绍", "live_project_introduction_edit", "B",
null, null, null, 2, "live:project-introduction:edit", "项目介绍编辑按钮"));
menuIds.add(saveMenu(6013L, 6010L, "删除项目介绍", "live_project_introduction_delete", "B",
null, null, null, 3, "live:project-introduction:delete", "项目介绍删除按钮"));
- menuIds.add(saveMenu(6014L, 3050L, "项目介绍密码", "live_project_introduction_password", "C",
- "/live/course/project-introduction-password", "Live/ProjectIntroductionPassword", null, 61, "live:project-introduction-password:view", "项目介绍密码菜单"));
+ menuIds.add(saveMenu(6014L, 6100L, "项目介绍密码", "live_project_introduction_password", "C",
+ "/live/promotion/project-introduction-password", "Live/ProjectIntroductionPassword", null, 61, "live:project-introduction-password:view", "项目介绍密码菜单"));
menuIds.add(saveMenu(6015L, 6014L, "编辑项目介绍密码", "live_project_introduction_password_edit", "B",
null, null, null, 1, "live:project-introduction-password:edit", "项目介绍密码编辑按钮"));
menuIds.add(saveMenu(4000L, 0L, "交易与财务", "trade_root", "M",
@@ -418,7 +429,7 @@
menu.setComponent(component);
menu.setIcon(icon);
menu.setSort(sort);
- menu.setStatus(1);
+ menu.setStatus(EnabledStatus.ENABLED.getValue());
menu.setVisible(1);
menu.setPermissionKey(permissionKey);
menu.setRemark(remark);
--
Gitblit v1.7.1