diff --git a/sql/teaching_db5.0.sql b/sql/teaching_db5.0.sql new file mode 100644 index 0000000..cabf9fb --- /dev/null +++ b/sql/teaching_db5.0.sql @@ -0,0 +1,607 @@ +/* + Navicat Premium Data Transfer + + Source Server : localhost_3306 + Source Server Type : MySQL + Source Server Version : 80026 (8.0.26) + Source Host : localhost:3306 + Source Schema : teaching_db + + Target Server Type : MySQL + Target Server Version : 80026 (8.0.26) + File Encoding : 65001 + + Date: 12/06/2024 16:15:18 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for course_objectives +-- ---------------------------- +DROP TABLE IF EXISTS `course_objectives`; +CREATE TABLE `course_objectives` ( + `id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '内部编号', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建日期', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新日期', + `pid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '父级节点 默认0没有', + `has_child` varchar(3) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '是否有子节点 添加子节点变1,默认0没有', + `name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '目标名称', + `type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '目标类型', + `course_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '课程id', + `requireid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '毕业要求id', + `temp` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '毕业要求', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of course_objectives +-- ---------------------------- +INSERT INTO `course_objectives` VALUES ('3e42492c201d2a9378be5af2edc92b47', '2024-06-06 16:17:39', NULL, '0', '0', '近代史纲要课程总体目标', NULL, 'd8d7bb93f100164659cac44ef2c4f55a', NULL, NULL); +INSERT INTO `course_objectives` VALUES ('43f2c4b4a10a47784e50e772b9d10457', '2024-05-31 17:39:13', NULL, '0', '0', '测试课程课程总体目标', NULL, '6f5de6dd8c8d5d9d02a63c8444b9d5bb', NULL, NULL); +INSERT INTO `course_objectives` VALUES ('503dc084653ffd003cb404b62266dc7c', '2024-06-06 15:58:43', NULL, 'da6e7283befa8965dae0f0f39ea7f24e', '0', '知识目标', 'c126ef1a66733ab7a4ba12aba0eb7f82', NULL, NULL, NULL); +INSERT INTO `course_objectives` VALUES ('53b27c94fe8af02ac8b23d9be9a2e329', '2024-06-03 11:32:19', NULL, 'da6e7283befa8965dae0f0f39ea7f24e', '0', '思政目标', '71f73bd999f678bcbbdb101e23277feb', NULL, NULL, NULL); +INSERT INTO `course_objectives` VALUES ('7a302cd72d653647778840b42f4e076a', '2024-06-03 10:43:13', NULL, '0', '0', '软件构造课程总体目标', NULL, 'ee2447b4463a5ad3f47e1744d912a824', NULL, NULL); +INSERT INTO `course_objectives` VALUES ('aa839ff1345a04f95b4efcca02494cab', '2024-06-06 16:45:22', NULL, '0', '0', '毛概课程总体目标', NULL, '72e1ad71bb855ba328f8c17964697354', NULL, NULL); +INSERT INTO `course_objectives` VALUES ('b41fa8332f39cca11d35635bd9fac720', '2024-05-31 11:24:33', NULL, '0', '0', '计算机导论课程总体目标', NULL, '2fa0fd63262230639d2c45a3acd9045c', NULL, NULL); +INSERT INTO `course_objectives` VALUES ('c84dc451086f7938c28a4f757957f415', '2024-06-06 15:58:19', NULL, 'da6e7283befa8965dae0f0f39ea7f24e', '0', '价值目标', '410fc58cd757cd248941af1bea6888e5', NULL, NULL, NULL); +INSERT INTO `course_objectives` VALUES ('d452f583115465d067a1719458690b95', '2024-05-31 11:16:37', NULL, '0', '0', '计算机组成原理总体目标', NULL, '36c34a4225526dd20ee3840da61d3701', NULL, NULL); +INSERT INTO `course_objectives` VALUES ('da6e7283befa8965dae0f0f39ea7f24e', '2024-05-31 20:49:52', '2024-06-06 15:58:43', '0', '1', '离散数学及其应用课程总体目标', NULL, 'de3100cad98f76be3176dd39aa748a9e', NULL, NULL); + +-- ---------------------------- +-- Table structure for courses +-- ---------------------------- +DROP TABLE IF EXISTS `courses`; +CREATE TABLE `courses` ( + `id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '内部编号', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `img` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '课程封面', + `category` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '课程类别', + `nature` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '课程性质', + `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '课程名称', + `code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '课程编码', + `semester` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '开课学期', + `credit` decimal(5, 2) NULL DEFAULT NULL COMMENT '课程学分', + `classhours` int NULL DEFAULT NULL COMMENT '课程学时', + `theoryhours` int NULL DEFAULT NULL COMMENT '理论学时', + `practicehours` int NULL DEFAULT NULL COMMENT '实践学时', + `experimenthours` int NULL DEFAULT NULL COMMENT '实验学时', + `otherhours` int NULL DEFAULT NULL COMMENT '其他学时', + `weeks` int NULL DEFAULT NULL COMMENT '上课周数', + `assessmenttype` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '考核类型', + `assessmentway` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '考核方式', + `teacher` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '负责教师', + `teachermethod` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '教学方法', + `teacherway` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '教学方式', + `description` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '课程简介', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of courses +-- ---------------------------- +INSERT INTO `courses` VALUES ('2fa0fd63262230639d2c45a3acd9045c', '2024-05-30 20:58:34', NULL, '', '1', '1', '计算机导论12', '111007', NULL, 4.50, 64, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334,2140110339', '暂定', '线下授课', NULL); +INSERT INTO `courses` VALUES ('36c34a4225526dd20ee3840da61d3701', '2024-05-28 20:58:36', NULL, '', '1', '1', '计算机组成原理', '111006', NULL, 4.00, 64, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334,2140110339', '暂定', '线下授课', NULL); +INSERT INTO `courses` VALUES ('6f5de6dd8c8d5d9d02a63c8444b9d5bb', '2024-05-26 20:58:40', NULL, '', '1', '1', '测试课程', '111008', NULL, 4.00, 64, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334,2140110339', '暂定', '线下授课', NULL); +INSERT INTO `courses` VALUES ('72e1ad71bb855ba328f8c17964697354', '2024-06-06 16:45:22', NULL, 'http://teaching-edu123.oss-cn-beijing.aliyuncs.com/KdxGCt8rKbruw3zEDTdkA.jpg', '1', '1', '毛概', '111012', NULL, 3.60, 48, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334', '暂定', '线下授课', NULL); +INSERT INTO `courses` VALUES ('8721e6864387eb99b04692f125ac0a9f', '2024-05-27 20:58:43', NULL, '', '1', '1', 'SQLServer数据库教程', '111004', NULL, 4.00, 0, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334,2140110327', '暂定111', '线下机房授课', NULL); +INSERT INTO `courses` VALUES ('90ce365ae4e362f616776550e04ae0b4', '2024-05-24 20:58:48', NULL, '', '1', '1', 'JavaEE', '111002', NULL, 4.00, 0, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334,2140110327', '暂定', '线下机房授课', NULL); +INSERT INTO `courses` VALUES ('a2ba84374d86e85208c5906a96ea8205', '2024-05-24 20:58:48', NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '1', '1', 'JavaWeb', '111003', NULL, 4.00, 0, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334,2140110327', '暂定', '线下机房授课', NULL); +INSERT INTO `courses` VALUES ('d511d26df8de551bc85ce765089771b4', '2024-05-24 20:58:48', NULL, '', '1', '1', '高级编程', '111001', NULL, 4.00, 0, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334,2140110327', '暂定', '线下机房授课', NULL); +INSERT INTO `courses` VALUES ('d8d7bb93f100164659cac44ef2c4f55a', '2024-06-06 16:17:39', NULL, '', '1', '1', '近代史纲要', '111011', NULL, 2.60, 48, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334', '暂定', '线下授课', NULL); +INSERT INTO `courses` VALUES ('de3100cad98f76be3176dd39aa748a9e', '2024-05-31 20:49:52', NULL, 'http://teaching-edu123.oss-cn-beijing.aliyuncs.com/E96JlmbPeqvzVcPvg43Lb.jpg', '1', '1', '离散数学及其应用', '111009', NULL, 2.00, 64, NULL, NULL, NULL, NULL, NULL, '1', '1', '2140110334', '暂定', '线下授课', NULL); + +-- ---------------------------- +-- Table structure for know +-- ---------------------------- +DROP TABLE IF EXISTS `know`; +CREATE TABLE `know` ( + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'id', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '知识点名称', + `info` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '简介', + `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '知识点内容', + `img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '知识点图片', + `hour` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '知识点学时', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of know +-- ---------------------------- + +-- ---------------------------- +-- Table structure for know_relationship +-- ---------------------------- +DROP TABLE IF EXISTS `know_relationship`; +CREATE TABLE `know_relationship` ( + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键id', + `chapterId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '章节id', + `courseId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '课程id', + `knowId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '知识点id', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of know_relationship +-- ---------------------------- + +-- ---------------------------- +-- Table structure for learning_records +-- ---------------------------- +DROP TABLE IF EXISTS `learning_records`; +CREATE TABLE `learning_records` ( + `id` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '学习记录id', + `user_id` varchar(36) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '用户id', + `courses_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '课程id', + `chapter_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '章节id', + `knowledge_point_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '知识点id', + `resource_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '资源id', + `access_time` datetime NULL DEFAULT NULL COMMENT '访问时间', + `learning_method1` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT '0' COMMENT '学习方式:打开; 1,打开过,2未打开', + `learning_method2` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT '0' COMMENT '学习方式:下载; 1下载过, 2未下载', + `video_duration` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '视频学习时长', + `is_completed` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '是否完成观看:1,已完成,0未完成', + `content` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '记录封面图片', + `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '资源地址', + `status` varchar(2) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT '1' COMMENT '是否存在: 1存在;0不存在;', + `parent_node` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '父节点', + `type` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '类型, 如:1,课程; 2,章节; 3,知识点; 4,学习资源', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of learning_records +-- ---------------------------- +INSERT INTO `learning_records` VALUES ('1', '1', '290bf0217c6a1569abf225289c7e11ea', NULL, NULL, NULL, '2024-05-31 21:35:11', NULL, '1', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '1', NULL, '1'); +INSERT INTO `learning_records` VALUES ('2', '2', 'd511d26df8de551bc85ce765089771b4', NULL, NULL, NULL, '2024-05-31 00:00:00', NULL, '0', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '1', NULL, '1'); +INSERT INTO `learning_records` VALUES ('3', '1', 'd511d26df8de551bc85ce765089771b4', NULL, NULL, NULL, '2024-05-31 00:00:00', NULL, '1', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '1', NULL, '1'); +INSERT INTO `learning_records` VALUES ('4', '1', '1', '', '', '', '2024-06-07 10:49:42', '1', '0', '', '', 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '0', '', '2'); +INSERT INTO `learning_records` VALUES ('5', '1', '2', NULL, NULL, NULL, '2024-05-02 00:00:00', NULL, '1', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '1', NULL, '1'); +INSERT INTO `learning_records` VALUES ('6', '1', '3', NULL, NULL, NULL, '2024-06-04 10:10:49', NULL, '0', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '1', NULL, '1'); +INSERT INTO `learning_records` VALUES ('7', '1', '4', NULL, NULL, NULL, '2024-06-04 10:12:01', NULL, '1', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '0', NULL, '1'); +INSERT INTO `learning_records` VALUES ('96', '1', '5', NULL, NULL, NULL, '2024-05-30 20:46:21', NULL, '0', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '1', NULL, '1'); +INSERT INTO `learning_records` VALUES ('8', '2', '3', NULL, NULL, NULL, '2024-06-04 10:15:01', NULL, '1', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', 'https://www.taobao.com/', '1', NULL, '1'); +INSERT INTO `learning_records` VALUES ('75', '2', '4', NULL, NULL, NULL, '2024-06-04 10:17:16', NULL, '0', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', 'https://www.taobao.com/', '1', NULL, '1'); +INSERT INTO `learning_records` VALUES ('71', '2', '5', NULL, NULL, NULL, '2024-06-04 12:01:48', NULL, '1', NULL, NULL, 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', 'https://www.taobao.com/', '1', NULL, '1'); +INSERT INTO `learning_records` VALUES ('1797841286352658434', '3', '5', '', '', '', '2024-06-06 16:59:38', '1', '1', '', '', '', '/portal', '1', '', '1'); +INSERT INTO `learning_records` VALUES ('1798911495222161409', '1', '1', '', '', '', '2024-06-07 10:54:57', '1', '0', '', '', 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', '/portal', '0', '', '1'); +INSERT INTO `learning_records` VALUES ('1797984330104299521', '3', '1', NULL, NULL, NULL, '2024-06-04 21:30:44', NULL, '1', '1', '1', 'https://teaching-edu123.oss-cn-beijing.aliyuncs.com/Borovets_ZH-CN5914681811_UHD.jpg', 'https://www.baidu.com/', '1', NULL, '1'); + +-- ---------------------------- +-- Table structure for objective_contents +-- ---------------------------- +DROP TABLE IF EXISTS `objective_contents`; +CREATE TABLE `objective_contents` ( + `id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `objective_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '对应的目标id', + `content` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '内容', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of objective_contents +-- ---------------------------- +INSERT INTO `objective_contents` VALUES ('3f85eb79c29be4a15c729d98b17676a5', 'c84dc451086f7938c28a4f757957f415', '价值目标3'); +INSERT INTO `objective_contents` VALUES ('406c85c99bd2d4b9f624ca3a67c3ce66', '53b27c94fe8af02ac8b23d9be9a2e329', '思政目标2'); +INSERT INTO `objective_contents` VALUES ('4ad5a1f0f584e35e7af6ef5142773990', '503dc084653ffd003cb404b62266dc7c', '知识目标1'); +INSERT INTO `objective_contents` VALUES ('4b4458cd64b0a1e21b54191a89e9f83d', 'c84dc451086f7938c28a4f757957f415', '价值目标2'); +INSERT INTO `objective_contents` VALUES ('53d9d78b41051696314c0b1c0efa5313', '503dc084653ffd003cb404b62266dc7c', '知识目标3'); +INSERT INTO `objective_contents` VALUES ('6689ed187bcbd36309510a21ea492225', 'da6e7283befa8965dae0f0f39ea7f24e', '总目标3'); +INSERT INTO `objective_contents` VALUES ('979e59083e81f28145e1162069ffebb8', 'c84dc451086f7938c28a4f757957f415', '价值目标1'); +INSERT INTO `objective_contents` VALUES ('9efcc83089e6de9945499876d1a6235a', 'da6e7283befa8965dae0f0f39ea7f24e', '总目标1'); +INSERT INTO `objective_contents` VALUES ('c6b3fc522a5479e28cd3f0c9b971a871', '53b27c94fe8af02ac8b23d9be9a2e329', '思政目标3'); +INSERT INTO `objective_contents` VALUES ('dc31075d57f371970c5af09fd534a9af', 'da6e7283befa8965dae0f0f39ea7f24e', '总目标2'); +INSERT INTO `objective_contents` VALUES ('eca937e6f047e3b6b06d67c5b4a9beff', '53b27c94fe8af02ac8b23d9be9a2e329', '思政目标1'); +INSERT INTO `objective_contents` VALUES ('ffde482fac55e6dec5b60f6c6208d42c', '503dc084653ffd003cb404b62266dc7c', '知识目标2'); + +-- ---------------------------- +-- Table structure for objectives_type +-- ---------------------------- +DROP TABLE IF EXISTS `objectives_type`; +CREATE TABLE `objectives_type` ( + `id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `type_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型名称', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `type_name`(`type_name` ASC) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of objectives_type +-- ---------------------------- +INSERT INTO `objectives_type` VALUES ('410fc58cd757cd248941af1bea6888e5', '价值目标'); +INSERT INTO `objectives_type` VALUES ('71f73bd999f678bcbbdb101e23277feb', '思政目标'); +INSERT INTO `objectives_type` VALUES ('c126ef1a66733ab7a4ba12aba0eb7f82', '知识目标'); +INSERT INTO `objectives_type` VALUES ('2350f69ef928cd2949e7fc05b05bd0c3', '素质目标'); + +-- ---------------------------- +-- Table structure for resource +-- ---------------------------- +DROP TABLE IF EXISTS `resource`; +CREATE TABLE `resource` ( + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '资源名称', + `type` int NULL DEFAULT NULL COMMENT '资源类型', + `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '资源路径', + `status` int NULL DEFAULT NULL COMMENT '资源状态', + `tags` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '标签', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of resource +-- ---------------------------- + +-- ---------------------------- +-- Table structure for resource_relationship +-- ---------------------------- +DROP TABLE IF EXISTS `resource_relationship`; +CREATE TABLE `resource_relationship` ( + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键', + `courseId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '课程id', + `chapterId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '章节id', + `knowId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '知识点id', + `resourceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '资源id', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of resource_relationship +-- ---------------------------- + +-- ---------------------------- +-- Table structure for se_course_favour +-- ---------------------------- +DROP TABLE IF EXISTS `se_course_favour`; +CREATE TABLE `se_course_favour` ( + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'id', + `course_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '课程id', + `user_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of se_course_favour +-- ---------------------------- +INSERT INTO `se_course_favour` VALUES ('1796378327262564353', 'a2ba84374d86e85208c5906a96ea8205', '2'); +INSERT INTO `se_course_favour` VALUES ('1796454599099658242', '36c34a4225526dd20ee3840da61d3701', '2'); +INSERT INTO `se_course_favour` VALUES ('1796789887730647041', '2fa0fd63262230639d2c45a3acd9045c', '2'); +INSERT INTO `se_course_favour` VALUES ('1797497056650289154', 'd511d26df8de551bc85ce765089771b4', '1'); +INSERT INTO `se_course_favour` VALUES ('1797499380101767170', 'd511d26df8de551bc85ce765089771b4', '2'); +INSERT INTO `se_course_favour` VALUES ('1798221492412149761', 'd511d26df8de551bc85ce765089771b4', '5'); +INSERT INTO `se_course_favour` VALUES ('1798621775654993922', 'd511d26df8de551bc85ce765089771b4', '8'); +INSERT INTO `se_course_favour` VALUES ('1798632199670714369', 'de3100cad98f76be3176dd39aa748a9e', '2'); + +-- ---------------------------- +-- Table structure for se_course_thumb +-- ---------------------------- +DROP TABLE IF EXISTS `se_course_thumb`; +CREATE TABLE `se_course_thumb` ( + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, + `course_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `user_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of se_course_thumb +-- ---------------------------- +INSERT INTO `se_course_thumb` VALUES ('1796343958854623233', '2', '1'); +INSERT INTO `se_course_thumb` VALUES ('1796344002215337985', '2', '2'); +INSERT INTO `se_course_thumb` VALUES ('1796362250491191298', '1', '2'); +INSERT INTO `se_course_thumb` VALUES ('1796437673614974977', '6', '2'); +INSERT INTO `se_course_thumb` VALUES ('1796445964822847489', '7', '4'); + +-- ---------------------------- +-- Table structure for se_know_favour +-- ---------------------------- +DROP TABLE IF EXISTS `se_know_favour`; +CREATE TABLE `se_know_favour` ( + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, + `course_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `know_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `user_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of se_know_favour +-- ---------------------------- +INSERT INTO `se_know_favour` VALUES ('1796378889450295297', '1', '2', '3'); + +-- ---------------------------- +-- Table structure for se_know_thumb +-- ---------------------------- +DROP TABLE IF EXISTS `se_know_thumb`; +CREATE TABLE `se_know_thumb` ( + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, + `course_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `know_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `user_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of se_know_thumb +-- ---------------------------- +INSERT INTO `se_know_thumb` VALUES ('1796347057337982977', '1', '2', '2'); +INSERT INTO `se_know_thumb` VALUES ('1796347303317135361', '2', '2', '3'); +INSERT INTO `se_know_thumb` VALUES ('1796347343968329730', '2', '3', '3'); +INSERT INTO `se_know_thumb` VALUES ('1796347380697849857', '1', '3', '3'); + +-- ---------------------------- +-- Table structure for se_resource_favour +-- ---------------------------- +DROP TABLE IF EXISTS `se_resource_favour`; +CREATE TABLE `se_resource_favour` ( + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, + `course_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `resource_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `user_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of se_resource_favour +-- ---------------------------- +INSERT INTO `se_resource_favour` VALUES ('1796379012112715778', '1', '2', '3'); + +-- ---------------------------- +-- Table structure for se_resource_thumb +-- ---------------------------- +DROP TABLE IF EXISTS `se_resource_thumb`; +CREATE TABLE `se_resource_thumb` ( + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, + `course_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `resource_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `user_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of se_resource_thumb +-- ---------------------------- +INSERT INTO `se_resource_thumb` VALUES ('1796366535710904322', '2', '1', '1'); + +-- ---------------------------- +-- Table structure for ums_admin +-- ---------------------------- +DROP TABLE IF EXISTS `ums_admin`; +CREATE TABLE `ums_admin` ( + `id` int NOT NULL AUTO_INCREMENT COMMENT '主键', + `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户名', + `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '密码', + `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '手机号', + `nick_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '昵称', + `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '头像', + `create_time` datetime NULL DEFAULT NULL COMMENT '注册时间', + `status` int NULL DEFAULT 1 COMMENT '帐号启用状态:0->禁用;1->启用', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of ums_admin +-- ---------------------------- +INSERT INTO `ums_admin` VALUES (2, '123', '$2a$10$ACn80kN2ZEREGH3yOce9mui/KoWQllCHjNVXzXzrTI3gKJi/LB/YK', '123456789', '', '', '2024-06-05 23:23:45', 1); +INSERT INTO `ums_admin` VALUES (3, 'youhang', '$2a$10$TYJcMWBdDmmYfV/Kxi771ee7krjYJCLzI8O6MyjCofty9Y0OPLEna', '13547534472', 'yy', '', '2024-06-12 15:09:10', 1); +INSERT INTO `ums_admin` VALUES (4, 'xiao1111', '$2a$10$lDwfuRcOuNNdSXhmcwV9w.2SUblbwlS4ipxHXmqzTpw54CvxTwtU.', '', '', '', '2024-06-12 16:13:34', 1); + +-- ---------------------------- +-- Table structure for ums_admin_role_relation +-- ---------------------------- +DROP TABLE IF EXISTS `ums_admin_role_relation`; +CREATE TABLE `ums_admin_role_relation` ( + `id` int NOT NULL AUTO_INCREMENT, + `admin_id` int NULL DEFAULT NULL, + `role_id` int NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of ums_admin_role_relation +-- ---------------------------- +INSERT INTO `ums_admin_role_relation` VALUES (1, 3, 2); +INSERT INTO `ums_admin_role_relation` VALUES (2, 4, 1); + +-- ---------------------------- +-- Table structure for ums_menu +-- ---------------------------- +DROP TABLE IF EXISTS `ums_menu`; +CREATE TABLE `ums_menu` ( + `id` int NOT NULL AUTO_INCREMENT, + `parent_id` int NULL DEFAULT NULL COMMENT '父级ID', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '菜单名称', + `level` int NULL DEFAULT NULL COMMENT '菜单级数', + `sort` int NULL DEFAULT NULL COMMENT '菜单排序', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '前端名称', + `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '前端图标', + `hidden` int NULL DEFAULT NULL COMMENT '前端隐藏', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of ums_menu +-- ---------------------------- +INSERT INTO `ums_menu` VALUES (1, NULL, '2024-06-12 15:44:52', '个人中心', NULL, NULL, 'Home', NULL, NULL); +INSERT INTO `ums_menu` VALUES (2, NULL, '2024-06-12 15:45:19', '课程', NULL, NULL, 'Course', NULL, NULL); +INSERT INTO `ums_menu` VALUES (3, NULL, '2024-06-12 15:45:26', '学生', NULL, NULL, 'Student', NULL, NULL); +INSERT INTO `ums_menu` VALUES (4, NULL, '2024-06-12 15:45:34', '分组', NULL, NULL, 'Group', NULL, NULL); +INSERT INTO `ums_menu` VALUES (5, NULL, '2024-06-12 15:45:38', '消息', NULL, NULL, 'Message', NULL, NULL); +INSERT INTO `ums_menu` VALUES (6, NULL, '2024-06-12 15:45:44', '课程基本信息', NULL, NULL, 'BasicCourseInformation', NULL, NULL); +INSERT INTO `ums_menu` VALUES (7, NULL, '2024-06-12 15:46:48', '课程目标', NULL, NULL, 'CourseObjectives', NULL, NULL); +INSERT INTO `ums_menu` VALUES (8, NULL, '2024-06-12 15:46:53', '课程章节', NULL, NULL, 'CourseChapters', NULL, NULL); +INSERT INTO `ums_menu` VALUES (9, NULL, '2024-06-12 15:46:59', '知识点', NULL, NULL, 'KnowledgePoints', NULL, NULL); +INSERT INTO `ums_menu` VALUES (10, NULL, '2024-06-12 15:47:04', '课程图谱', NULL, NULL, 'CurriculumMap', NULL, NULL); +INSERT INTO `ums_menu` VALUES (11, NULL, '2024-06-12 15:47:10', '课程资源', NULL, NULL, 'CourseResources', NULL, NULL); +INSERT INTO `ums_menu` VALUES (12, NULL, '2024-06-12 15:47:16', '课程学习记录', NULL, NULL, 'LearningProcess', NULL, NULL); +INSERT INTO `ums_menu` VALUES (13, NULL, '2024-06-12 15:49:09', '课程收藏', NULL, NULL, 'CourseCollections', NULL, NULL); +INSERT INTO `ums_menu` VALUES (14, NULL, '2024-06-12 15:49:17', '课程点赞', NULL, NULL, 'Courselikes', NULL, NULL); +INSERT INTO `ums_menu` VALUES (15, NULL, '2024-06-12 15:50:03', '网站首页', NULL, NULL, 'WebHome', NULL, NULL); +INSERT INTO `ums_menu` VALUES (16, NULL, '2024-06-12 15:50:09', '课程首页', NULL, NULL, 'CourseHome', NULL, NULL); +INSERT INTO `ums_menu` VALUES (17, NULL, '2024-06-12 15:50:15', '学习路径推荐', NULL, NULL, 'LearningPathRecommendations', NULL, NULL); +INSERT INTO `ums_menu` VALUES (18, NULL, '2024-06-12 15:51:24', '知识点学习', NULL, NULL, 'KnowledgePointLearning', NULL, NULL); +INSERT INTO `ums_menu` VALUES (19, NULL, '2024-06-12 15:51:31', '课程报告', NULL, NULL, 'CourseReports', NULL, NULL); +INSERT INTO `ums_menu` VALUES (20, NULL, '2024-06-12 15:53:15', '学习过程', NULL, NULL, 'MyCourseStudyManagement', NULL, NULL); + +-- ---------------------------- +-- Table structure for ums_resource +-- ---------------------------- +DROP TABLE IF EXISTS `ums_resource`; +CREATE TABLE `ums_resource` ( + `id` int NOT NULL AUTO_INCREMENT, + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '资源名称', + `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '资源URL', + `description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '描述', + `category_id` int NULL DEFAULT NULL COMMENT '资源分类ID', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of ums_resource +-- ---------------------------- +INSERT INTO `ums_resource` VALUES (1, '2024-06-04 09:56:19', '首页', '/home/advertise/**', NULL, 1); + +-- ---------------------------- +-- Table structure for ums_resource_category +-- ---------------------------- +DROP TABLE IF EXISTS `ums_resource_category`; +CREATE TABLE `ums_resource_category` ( + `id` int NOT NULL AUTO_INCREMENT, + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '分类名称', + `sort` int NULL DEFAULT NULL COMMENT '排序', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of ums_resource_category +-- ---------------------------- +INSERT INTO `ums_resource_category` VALUES (1, '2024-06-04 09:57:23', '首页模块', 0); + +-- ---------------------------- +-- Table structure for ums_role +-- ---------------------------- +DROP TABLE IF EXISTS `ums_role`; +CREATE TABLE `ums_role` ( + `id` int NOT NULL AUTO_INCREMENT, + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '名称', + `description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '描述', + `admin_count` int NULL DEFAULT NULL COMMENT '后台用户数量', + `create_time` datetime NOT NULL COMMENT '创建时间', + `status` int NULL DEFAULT 1 COMMENT '启用状态:0->禁用;1->启用', + `sort` int NULL DEFAULT 0, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of ums_role +-- ---------------------------- +INSERT INTO `ums_role` VALUES (1, '老师', '能查看自己和所有学生的信息', 0, '2024-06-04 09:59:47', 1, 0); +INSERT INTO `ums_role` VALUES (2, '学生', '只能查看自己信息', 0, '2024-06-04 10:02:15', 1, 0); + +-- ---------------------------- +-- Table structure for ums_role_menu_relation +-- ---------------------------- +DROP TABLE IF EXISTS `ums_role_menu_relation`; +CREATE TABLE `ums_role_menu_relation` ( + `id` int NOT NULL AUTO_INCREMENT, + `role_id` int NULL DEFAULT NULL COMMENT '角色ID', + `menu_id` int NULL DEFAULT NULL COMMENT '菜单ID', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 23 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of ums_role_menu_relation +-- ---------------------------- +INSERT INTO `ums_role_menu_relation` VALUES (1, 1, 1); +INSERT INTO `ums_role_menu_relation` VALUES (2, 1, 2); +INSERT INTO `ums_role_menu_relation` VALUES (3, 1, 3); +INSERT INTO `ums_role_menu_relation` VALUES (4, 1, 4); +INSERT INTO `ums_role_menu_relation` VALUES (5, 1, 5); +INSERT INTO `ums_role_menu_relation` VALUES (6, 1, 6); +INSERT INTO `ums_role_menu_relation` VALUES (7, 1, 7); +INSERT INTO `ums_role_menu_relation` VALUES (8, 1, 8); +INSERT INTO `ums_role_menu_relation` VALUES (9, 1, 9); +INSERT INTO `ums_role_menu_relation` VALUES (10, 1, 10); +INSERT INTO `ums_role_menu_relation` VALUES (11, 2, 1); +INSERT INTO `ums_role_menu_relation` VALUES (12, 2, 5); +INSERT INTO `ums_role_menu_relation` VALUES (13, 2, 11); +INSERT INTO `ums_role_menu_relation` VALUES (14, 2, 12); +INSERT INTO `ums_role_menu_relation` VALUES (15, 2, 13); +INSERT INTO `ums_role_menu_relation` VALUES (16, 2, 14); +INSERT INTO `ums_role_menu_relation` VALUES (17, 2, 15); +INSERT INTO `ums_role_menu_relation` VALUES (18, 2, 16); +INSERT INTO `ums_role_menu_relation` VALUES (19, 2, 17); +INSERT INTO `ums_role_menu_relation` VALUES (20, 2, 18); +INSERT INTO `ums_role_menu_relation` VALUES (21, 2, 19); +INSERT INTO `ums_role_menu_relation` VALUES (22, 2, 20); + +-- ---------------------------- +-- Table structure for ums_role_resource_relation +-- ---------------------------- +DROP TABLE IF EXISTS `ums_role_resource_relation`; +CREATE TABLE `ums_role_resource_relation` ( + `id` int NOT NULL AUTO_INCREMENT, + `role_id` int NULL DEFAULT NULL COMMENT '角色ID', + `resource_id` int NULL DEFAULT NULL COMMENT '资源ID', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of ums_role_resource_relation +-- ---------------------------- +INSERT INTO `ums_role_resource_relation` VALUES (1, 1, 1); +INSERT INTO `ums_role_resource_relation` VALUES (2, 2, 1); + +-- ---------------------------- +-- Table structure for ums_student +-- ---------------------------- +DROP TABLE IF EXISTS `ums_student`; +CREATE TABLE `ums_student` ( + `id` int NOT NULL, + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '姓名', + `sex` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '性别', + `nationality` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '民族', + `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '学号', + `birthday` datetime NULL DEFAULT NULL COMMENT '生日', + `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '手机号', + `faculty` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '院系', + `major` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '专业', + `year` date NULL DEFAULT NULL COMMENT '入学年份', + `class` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '班级', + `user_id` int NULL DEFAULT NULL COMMENT 'user_id', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of ums_student +-- ---------------------------- + +-- ---------------------------- +-- Table structure for ums_teacher +-- ---------------------------- +DROP TABLE IF EXISTS `ums_teacher`; +CREATE TABLE `ums_teacher` ( + `id` int NOT NULL, + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '姓名', + `sex` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '性别', + `nationality` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '民族', + `profession` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '专业', + `education` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '学历', + `degree` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '学位', + `professional_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '职称', + `emergency_contact` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '手机号', + `join_work_time` datetime NULL DEFAULT NULL COMMENT '参加工作时间', + `political_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '政治面貌', + `user_id` int NULL DEFAULT NULL COMMENT 'user_id', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of ums_teacher +-- ---------------------------- + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/src/main/java/com/teaching/backend/controller/umsAdmin/UmsAdminController.java b/src/main/java/com/teaching/backend/controller/umsAdmin/UmsAdminController.java index 4983f03..13d1cf5 100644 --- a/src/main/java/com/teaching/backend/controller/umsAdmin/UmsAdminController.java +++ b/src/main/java/com/teaching/backend/controller/umsAdmin/UmsAdminController.java @@ -54,7 +54,7 @@ public class UmsAdminController { return CommonResult.success(umsAdmin); } - @ApiOperation(value = "登录以后返回token") + @ApiOperation(value = "用户名登录以后返回token") @PostMapping("/login") public CommonResult login(@Validated @RequestBody UmsAdmin umsAdmin) { String token = umsAdminService.login(umsAdmin.getUsername(), umsAdmin.getPassword()); @@ -67,6 +67,19 @@ public class UmsAdminController { return CommonResult.success(tokenMap); } + @ApiOperation(value = "手机号登录以后返回token") + @PostMapping("/phone/login") + public CommonResult phoneLogin(@RequestParam("phone")String phone) { + String token = umsAdminService.phoneLogin(phone); + if (token == null) { + return CommonResult.validateFailed("手机号不存在!"); + } + Map tokenMap = new HashMap<>(); + tokenMap.put("token", token); + tokenMap.put("tokenHead", tokenHead); + return CommonResult.success(tokenMap); + } + /** * 发送短信 * @param phone @@ -102,11 +115,12 @@ public class UmsAdminController { return CommonResult.success(tokenMap); } + @ApiOperation(value = "获取当前登录用户信息") @GetMapping ("/info") public CommonResult getAdminInfo(Principal principal) { if(principal == null){ - return CommonResult.unauthorized(null); + return CommonResult.unauthorized("用户名为空"); } String username = principal.getName(); UmsAdmin umsAdmin = umsAdminService.getAdminByUsername(username); diff --git a/src/main/java/com/teaching/backend/service/umsAdmin/UmsAdminService.java b/src/main/java/com/teaching/backend/service/umsAdmin/UmsAdminService.java index 5dd107d..8e90b61 100644 --- a/src/main/java/com/teaching/backend/service/umsAdmin/UmsAdminService.java +++ b/src/main/java/com/teaching/backend/service/umsAdmin/UmsAdminService.java @@ -71,4 +71,9 @@ public interface UmsAdminService extends IService { * 手机号注册 */ UmsAdmin phoneRegister(UmsAdminParam umsAdminParam); + + /** + * 手机号登录 + */ + String phoneLogin(String phone); } diff --git a/src/main/java/com/teaching/backend/service/umsAdmin/impl/UmsAdminServiceImpl.java b/src/main/java/com/teaching/backend/service/umsAdmin/impl/UmsAdminServiceImpl.java index 710ba6d..0eeb61f 100644 --- a/src/main/java/com/teaching/backend/service/umsAdmin/impl/UmsAdminServiceImpl.java +++ b/src/main/java/com/teaching/backend/service/umsAdmin/impl/UmsAdminServiceImpl.java @@ -34,26 +34,19 @@ import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; - import com.aliyuncs.DefaultAcsClient; import com.aliyuncs.IAcsClient; import com.aliyuncs.exceptions.ClientException; import com.aliyuncs.exceptions.ServerException; import com.aliyuncs.profile.DefaultProfile; - - import java.time.LocalDateTime; import java.util.List; -import java.util.Random; import java.util.UUID; -import java.util.concurrent.TimeUnit; @Service @Slf4j public class UmsAdminServiceImpl extends ServiceImpl implements UmsAdminService { - private static final String CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - private static final int USERNAME_LENGTH = 10; // 用户名长度 private static final Logger LOGGER = LoggerFactory.getLogger(UmsAdminServiceImpl.class); @Autowired private JwtTokenUtil jwtTokenUtil; @@ -66,7 +59,6 @@ public class UmsAdminServiceImpl extends ServiceImpl i @Autowired private StringRedisTemplate redisTemplate; - private final String KEY_PREFIX = "ly:sms:phone:"; @Override public UmsAdmin register(UmsAdminParam umsAdminParam) { @@ -109,6 +101,33 @@ public class UmsAdminServiceImpl extends ServiceImpl i return token; } + @Override + public String phoneLogin(String phone) { + if (phone == null){ + return null; + } + String token = null; + //密码需要客户端加密后传递 + try { + UmsAdmin phoneAdmin = lambdaQuery().eq(UmsAdmin::getPhone, phone) + .one(); + if (phoneAdmin == null){ + return null; + } + + UserDetails userDetails = loadUserByUsername(phoneAdmin.getUsername()); + if(!userDetails.isEnabled()){ + Asserts.fail("帐号已被禁用"); + } + UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities()); + SecurityContextHolder.getContext().setAuthentication(authentication); + token = jwtTokenUtil.generateToken(userDetails); + } catch (AuthenticationException e) { + LOGGER.warn("登录异常:{}", e.getMessage()); + } + return token; + } + @Override public boolean updateUms(UmsAdmin umsadmin) { if (umsadmin.getPassword().length() > 0){ @@ -148,13 +167,13 @@ public class UmsAdminServiceImpl extends ServiceImpl i throw new LyException(400, "手机号格式错误"); } - UmsAdmin admin = lambdaQuery() - .eq(UmsAdmin::getPhone, phone) - .one(); - if (admin != null){ -// throw new ; - return null; - } +// UmsAdmin admin = lambdaQuery() +// .eq(UmsAdmin::getPhone, phone) +// .one(); +// if (admin != null){ +//// throw new ; +// return null; +// } String code = RandomStringUtils.randomNumeric(5); @@ -172,7 +191,7 @@ public class UmsAdminServiceImpl extends ServiceImpl i try { SendSmsResponse response = client.getAcsResponse(request); - System.out.println("11112"+new Gson().toJson(response)); + System.out.println(new Gson().toJson(response)); } catch (ServerException e) { e.printStackTrace(); } catch (ClientException e) { @@ -180,10 +199,8 @@ public class UmsAdminServiceImpl extends ServiceImpl i System.out.println("ErrMsg:" + e.getErrMsg()); System.out.println("RequestId:" + e.getRequestId()); } - - //存入,redis,存5min - this.redisTemplate.opsForValue().set(KEY_PREFIX + phone, code, 5, TimeUnit.MINUTES); - +// //存入,redis,存5min +// this.redisTemplate.opsForValue().set(KEY_PREFIX + phone, code, 5, TimeUnit.MINUTES); return code; } @@ -200,7 +217,6 @@ public class UmsAdminServiceImpl extends ServiceImpl i if (umsAdminList.size() > 0 ) { return null; } - //将密码进行加密操作 String encodePassword = passwordEncoder.encode(umsAdmin.getPassword()); umsAdmin.setUsername(randomUsername()); @@ -210,7 +226,7 @@ public class UmsAdminServiceImpl extends ServiceImpl i } /* - 随机生成用户名 + 随机生成用户名(方法) */ private String randomUsername(){ String username; @@ -222,7 +238,6 @@ public class UmsAdminServiceImpl extends ServiceImpl i newUsername = lambdaQuery().eq(UmsAdmin::getUsername, username) .one(); } while ( newUsername != null); // 如果用户名已存在,则重新生成 - return username; } @@ -236,8 +251,6 @@ public class UmsAdminServiceImpl extends ServiceImpl i return adminRoleRelation.getRoleList(adminId); } - - @Override public UmsAdmin getAdminByUsername(String username) { //从数据库中获取 @@ -249,7 +262,6 @@ public class UmsAdminServiceImpl extends ServiceImpl i return null; } - @Override public List getResourceList(Long adminId) { //从数据库中获取 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 57daa0b..bf45001 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -14,7 +14,9 @@ spring: mybatis: configuration: map-underscore-to-camel-case: true - + mapper-locations: + - classpath:mapper/*.xml + - classpath*:com/**/mapper/*.xml # 自定义jwt key jwt: tokenHeader: Authorization #JWT存储的请求头 @@ -55,7 +57,5 @@ secure: - /user/info - /user/logout - /minio/upload - mapper-locations: - - classpath:dao/*.xml - - classpath*:com/**/mapper/*.xml +