ToB企服应用市场:ToB评测及商务社交产业平台

标题: 【门生管理系统】环境搭建 [打印本页]

作者: 铁佛    时间: 2024-12-30 12:17
标题: 【门生管理系统】环境搭建
目录
1. 环境搭建
1.1 前端环境
1.2 后端环境
1.2.1 父项目
1.2.2 domain项目
1.2.3 gateway项目
1.3 数据库环境
1.3.1 用户数据库
1.3.2 班级数据库
1.3.3 门生数据库
1.3.4 课程数据库
1. 环境搭建

1.1 前端环境



1.2 后端环境

1.2.1 父项目

  


1.2.2 domain项目





1.2.3 gateway项目


1.3 数据库环境

1.3.1 用户数据库

  1. package com.czxy;
  2. import org.springframework.boot.SpringApplication;
  3. import org.springframework.boot.autoconfigure.SpringBootApplication;
  4. import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
  5. /**
  6. * @author 桐叔
  7. * @email liangtong@itcast.cn
  8. * @description
  9. */
  10. @SpringBootApplication
  11. @EnableDiscoveryClient      //服务发现
  12. public class GatewayApplication {
  13.    public static void main(String[] args) {
  14.        SpringApplication.run(GatewayApplication.class, args);
  15.    }
  16. }
复制代码

1.3.2 班级数据库

  1. # 用户数据库
  2. CREATE DATABASE cloud_es_user;
  3. USE cloud_es_user;
  4. CREATE TABLE `tb_user` (
  5.  `u_id` VARCHAR(32) PRIMARY KEY NOT NULL COMMENT '用户编号',
  6.  `user_name` VARCHAR(50) UNIQUE DEFAULT NULL COMMENT '用户名',
  7.  `password` VARCHAR(32) DEFAULT NULL COMMENT '密码',
  8.  `gender` BIT(1) DEFAULT NULL COMMENT '性别,1表示男,0表示女',
  9.  `image` VARCHAR(50) UNIQUE DEFAULT NULL COMMENT '头像图片'
  10. );
  11. INSERT  INTO `tb_user`(`u_id`,`user_name`,`password`,`gender`,`image`) VALUES ('u001','jack','1234',1,'1.jpg');
  12. INSERT  INTO `tb_user`(`u_id`,`user_name`,`password`,`gender`,`image`) VALUES ('u002','rose','1234',0,'2.jpg');
  13. INSERT  INTO `tb_user`(`u_id`,`user_name`,`password`,`gender`,`image`) VALUES ('u003','tom','1234',1,'3.jpg');
复制代码

1.3.3 门生数据库

  1. # 班级数据库
  2. CREATE DATABASE cloud_es_classes;
  3. USE cloud_es_classes;
  4. CREATE TABLE `tb_teacher` (
  5.  `tid` INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  6.  `tname` VARCHAR(50) DEFAULT NULL COMMENT '老师姓名',
  7.  `type` INT(11) DEFAULT NULL COMMENT '老师类型:1.授课老师、2.助理老师、3.辅导员老师'
  8. );
  9. INSERT  INTO `tb_teacher`(`tid`,`tname`,`type`) VALUES (1,'梁桐老师',1);
  10. INSERT  INTO `tb_teacher`(`tid`,`tname`,`type`) VALUES (2,'马坤老师',2);
  11. INSERT  INTO `tb_teacher`(`tid`,`tname`,`type`) VALUES (3,'仲燕老师',3);
  12. INSERT  INTO `tb_teacher`(`tid`,`tname`,`type`) VALUES (4,'袁新奇老师',1);
  13. INSERT  INTO `tb_teacher`(`tid`,`tname`,`type`) VALUES (5,'任林达老师',2);
  14. INSERT  INTO `tb_teacher`(`tid`,`tname`,`type`) VALUES (6,'王珊珊老师',3);
  15. CREATE TABLE `tb_class` (
  16.  `cid` INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  17.  `cname` VARCHAR(50) DEFAULT NULL COMMENT '班级名称',
  18.  `teacher1_id` INT(11) DEFAULT NULL COMMENT '授课老师',
  19.  `teacher2_id` INT(11) DEFAULT NULL COMMENT '助理老师',
  20.  `teacher3_id` INT(11) DEFAULT NULL COMMENT '辅导员老师'
  21. );
  22. INSERT  INTO `tb_class`(`cid`,`cname`,`teacher1_id`,`teacher2_id`,`teacher3_id`) VALUES (1,'Java56',1,2,3);
  23. INSERT  INTO `tb_class`(`cid`,`cname`,`teacher1_id`,`teacher2_id`,`teacher3_id`) VALUES (2,'Java78',1,2,3);
  24. INSERT  INTO `tb_class`(`cid`,`cname`,`teacher1_id`,`teacher2_id`,`teacher3_id`) VALUES (3,'Java12',4,5,6);
  25. INSERT  INTO `tb_class`(`cid`,`cname`,`teacher1_id`,`teacher2_id`,`teacher3_id`) VALUES (4,'Java34',4,5,6);
复制代码

1.3.4 课程数据库

  1. #学生数据库
  2. CREATE DATABASE cloud_es_student;
  3. USE cloud_es_student;
  4. CREATE TABLE tb_city(
  5.   c_id VARCHAR(32) PRIMARY KEY COMMENT '城市ID',
  6.   city_name VARCHAR(20) COMMENT '城市名称' ,
  7.   parent_id VARCHAR(32) COMMENT '父ID'
  8. );
  9. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('320000','江苏省','0');
  10. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('140000','山西省','0');
  11. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('130000','河北省','0');
  12. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('320100','南京市','320000');
  13. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('320102','玄武区','320100');
  14. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('320103','白下区','320100');
  15. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('321300','宿迁市','320000');
  16. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('321322','沭阳县','321300');
  17. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('321323','泗阳县','321300');
  18. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('140100','太原市','140000');
  19. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('140106','迎泽区','140100');
  20. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('140108','尖草坪区','140100');
  21. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('140800','运城市','140000');
  22. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('140823','闻喜县','140800');
  23. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('140828','夏 县','140800');
  24. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('130100','石家庄市','130000');
  25. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('130127','高邑县','130100');
  26. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('130185','鹿泉市','130100');
  27. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('131000','廊坊市','130000');
  28. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('131003','广阳区','131000');
  29. INSERT INTO tb_city(c_id,city_name,parent_id) VALUES('131022','固安县','131000');
  30. CREATE TABLE `tb_student` (
  31.  `s_id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '学生ID',
  32.  `sname` VARCHAR(50) DEFAULT NULL COMMENT '姓名',
  33.  `age` INT(11) DEFAULT NULL COMMENT '年龄',
  34.  `birthday` DATETIME DEFAULT NULL COMMENT '生日',
  35.  `gender` CHAR(1) DEFAULT NULL COMMENT '性别',
  36.  `c_id` INT DEFAULT NULL,
  37.  `city_ids` VARCHAR(32) DEFAULT NULL COMMENT '城市:320000,321300,321322'
  38. );
  39. INSERT  INTO `tb_student`(`s_id`,`sname`,`age`,`birthday`,`gender`,`c_id`,`city_ids`) VALUES (1,'赵三33',21,'2001-01-17 00:00:00','1',1,'320000,321300,321322');
  40. INSERT  INTO `tb_student`(`s_id`,`sname`,`age`,`birthday`,`gender`,`c_id`,`city_ids`) VALUES (2,'钱四444',1900,'2001-05-16 00:00:00','1',2,'320000,321300,321322');
  41. INSERT  INTO `tb_student`(`s_id`,`sname`,`age`,`birthday`,`gender`,`c_id`,`city_ids`) VALUES (3,'孙五56',189,'2022-03-15 00:00:00','0',1,'320000,321300,321322');
  42. INSERT  INTO `tb_student`(`s_id`,`sname`,`age`,`birthday`,`gender`,`c_id`,`city_ids`) VALUES (4,'张三',20,'2020-12-21 00:00:00','0',2,'320000,321300,321322');
  43. INSERT  INTO `tb_student`(`s_id`,`sname`,`age`,`birthday`,`gender`,`c_id`,`city_ids`) VALUES (5,'xxx',18,'2020-12-21 00:00:00','0',2,'140000,140800,140823');
  44. INSERT  INTO `tb_student`(`s_id`,`sname`,`age`,`birthday`,`gender`,`c_id`,`city_ids`) VALUES (6,'123',18,'2020-11-01 00:00:00','0',3,'130000,130100,130127');
  45. INSERT  INTO `tb_student`(`s_id`,`sname`,`age`,`birthday`,`gender`,`c_id`,`city_ids`) VALUES (7,'xx',18,'2020-11-02 00:00:00','0',1,'130000,131000,131003');
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4