| | |
| | | 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; |
| | |
| | | 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()); |
| | |
| | | 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()); |
| | |
| | | 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(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", |
| | |
| | | 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); |