实现教程: https://www.bilibili.com/video/BV1YT4y1y7V1/ 项目名称: 校园社团管理系统 系统实现:SpringBoot + MyBatisPlus+ VUE + ElementUI + axios 运行环境:JDK8 + Maven + MySQL8.x + NodeJS 开发工具:IDEA + VSCode 特别说明:项目开发是在 IDEA 中完成的,但是如果将项目导入到 Eclipse 或者其他代码编辑器中同样也是可以运行的,只不过需要按照所使用工具的实际情况合理的进行配置进行,同理,前端项目也可以在 Sublime、Atom等其他前端代码编辑器中运行
1. 项目预览

用户登陆页面
2. 项目设计
3. 项目结构
4. 项目部署
4.1 环境要求
JDK8,这是JAVA项目运行编译的基础,而且SpringBoot项目的开发对于 JDK的版本有明确的要求,尽量采用 JDK8的版本,如果本地没有 JDK,可以参考 JDK安装和使用 进行安装配置
Maven,项目使用 Maven进行构建,这是一个JAVA开发中常用的版本构建工具,如果本地没有 Maven,可以参考 Maven安装和配置 进行安装和配置
MySQL,需要考虑版本问题,MySQL5.x 和 MySQL8.x 在使用 JAVA进行处理的过程中,涉及的链接地址、驱动包名称、驱动包版本具有差异,本项目采用 MySQL8.x 开发完成,其他版本修改对应信息后才可以正常运行,关于 MySQL 数据库安装运行可以参考 MySQL数据库安装 进行安装和配置
NodeJS,这是前端运行所需要的,项目压缩包里包含前端运行所需的依赖模块,所以只需要安装 NodeJS 就可以在终端运行 npm run serve 就可以运行了
4.2 项目运行流程
首先,按照环境要求,在本地计算机中正确的安装 JDK、MySQL 、Maven、NodeJS等依赖,关于具体代码编辑器可以使用IDEA、VSCode 这样的组合,也可以根据自己的情况选择合适的代码编辑工具
第二,复制第5章数据库相关中找到数据库执行的SQL语句,这些SQL语句可以在命令窗口中执行,也可以在Navicat 等图形化管理窗口中执行,执行过程中请移除注释内容,避免对运行造成干扰
第三,使用代码编辑器打开项目,按照本节4.3、4.4 介绍的内容运行项目,成功运行之后,复制前端运行结果窗口中的路径,在浏览器中打开,输入 账号和密码即可,测试账号和密码存储在 users 表中(账号:admin 密码: admin)
4.3 服务端运行

如上,项目打开之后,找到 application.yml 文件,然后在图中标注位置正确配置数据库链接信息,主要是数据库用户名、用户密码、驱动类。
如上,使用 IDEA 打开项目后,找到SpringBoot启动类 Application 点击打开,然后在文件中右键运行,如果控制台无异常内容出现,即证明程序启动正常。
4.4 前端运行

如上,VSCode 打开项目后,按照图中标注方式打开终端,在终端控制台输入 npm run serve 即可运行。
5. 相关资源
5.1 依赖POM
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>self.cases</groupId><artifactId>server</artifactId><version>1.0.0</version><!-- SpringBoot 依赖 --><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.3.4.RELEASE</version><relativePath /></parent><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><ehcache.version>3.8.1</ehcache.version><druid.version>1.2.1</druid.version><fastjson.version>1.2.72</fastjson.version><slf4j.version>1.7.30</slf4j.version><log4j2.version>2.13.3</log4j2.version><mysql.version>8.0.17</mysql.version><mybatis.version>3.4.2</mybatis.version></properties><dependencies><!-- SpringBoot --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter</artifactId><exclusions><exclusion><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-logging</artifactId></exclusion></exclusions></dependency><!-- SpringBoot Test模块 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>org.junit.platform</groupId><artifactId>junit-platform-launcher</artifactId><scope>test</scope></dependency><!-- SpringBoot mybatis模块 --><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>${mybatis.version}</version></dependency><!-- SpringBoot Web模块 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!-- SpringBoot log4j2模块 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-log4j2</artifactId></dependency><!--devtools热部署 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><optional>true</optional><scope>true</scope></dependency><!-- ehcache缓存 --><dependency><groupId>org.ehcache</groupId><artifactId>ehcache</artifactId><version>${ehcache.version}</version></dependency><!-- MySQL数据库驱动 --><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>${mysql.version}</version></dependency><!-- 数据连接池 --><dependency><groupId>com.alibaba</groupId><artifactId>druid</artifactId><version>${druid.version}</version></dependency><!-- slf4j依赖程序 --><dependency><groupId>org.slf4j</groupId><artifactId>slf4j-api</artifactId><version>${slf4j.version}</version></dependency><!-- lo4j2依赖程序 --><dependency><groupId>org.apache.logging.log4j</groupId><artifactId>log4j-core</artifactId><version>${log4j2.version}</version></dependency><!-- FastJSON 处理响应数据格式 --><dependency><groupId>com.alibaba</groupId><artifactId>fastjson</artifactId><version>${fastjson.version}</version></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><fork>true</fork></configuration></plugin></plugins><!-- 设置静态资源 --><resources><resource><directory>src/main/resources</directory><includes><include>application.yml</include><include>log4j2.xml</include></includes></resource></resources></build></project>
5.2 数据库相关
-- 创建数据库CREATE DATABASE `self_student_teams` DEFAULT CHARACTER SET utf8;-- 选择数据库USE `self_student_teams`;-- 建立数据表CREATE TABLE `users` (`id` char(13) NOT NULL COMMENT '记录ID',`user_name` varchar(32) NOT NULL COMMENT '用户账号',`pass_word` varchar(32) NOT NULL COMMENT '用户密码',`name` varchar(20) COMMENT '用户姓名',`gender` char(2) COMMENT '用户性别',`age` int COMMENT '用户年龄',`phone` char(11) COMMENT '联系电话',`address` varchar(64) COMMENT '联系地址',`create_time` char(19) NOT NULL COMMENT '添加时间',`type` int NOT NULL COMMENT '用户身份',PRIMARY KEY(`id`))ENGINE=INNODB DEFAULT CHARSET=UTF8 COMMENT '系统用户';CREATE TABLE `team_types` (`id` char(13) NOT NULL COMMENT '记录ID',`name` varchar(20) NOT NULL COMMENT '类型名称',`create_time` char(19) NOT NULL COMMENT '创建时间',PRIMARY KEY(`id`))ENGINE=INNODB DEFAULT CHARSET=UTF8 COMMENT '社团类型';CREATE TABLE `teams` (`id` char(13) NOT NULL COMMENT '记录ID',`name` varchar(20) NOT NULL COMMENT '社团名称',`create_time` char(10) NOT NULL COMMENT '建立时间',`total` int NOT NULL COMMENT '社团人数',`manager` char(13) NOT NULL COMMENT '社团团长',`type_id` char(13) NOT NULL COMMENT '社团编号',PRIMARY KEY(`id`),FOREIGN KEY(type_id) REFERENCES team_types(id))ENGINE=INNODB DEFAULT CHARSET=UTF8 COMMENT '社团信息';CREATE TABLE `notices` (`id` char(13) NOT NULL COMMENT '记录ID',`title` varchar(20) NOT NULL COMMENT '通知标题',`detail` varchar(125) NOT NULL COMMENT '通知详情',`create_time` char(10) NOT NULL COMMENT '发布时间',`team_id` char(13) COMMENT '发布社团',PRIMARY KEY(`id`))ENGINE=INNODB DEFAULT CHARSET=UTF8 COMMENT '通知记录';CREATE TABLE `activities` (`id` char(13) NOT NULL COMMENT '记录ID',`name` varchar(20) NOT NULL COMMENT '活动名称',`comm` varchar(60) NOT NULL COMMENT '活动概述',`detail` varchar(256) NOT NULL COMMENT '活动详情',`ask` varchar(125) NOT NULL COMMENT '活动要求',`total` int NOT NULL COMMENT '报名人数',`active_time` char(19) NOT NULL COMMENT '活动时间',`team_id` char(13) NOT NULL COMMENT '发布社团',PRIMARY KEY(`id`),FOREIGN KEY(team_id) REFERENCES teams(id))ENGINE=INNODB DEFAULT CHARSET=UTF8 COMMENT '活动信息';CREATE TABLE `active_logs` (`id` char(13) NOT NULL COMMENT '记录ID',`create_time` char(19) NOT NULL COMMENT '报名时间',`active_id` char(13) NOT NULL COMMENT '活动编号',`user_id` char(13) NOT NULL COMMENT '报名用户',PRIMARY KEY(`id`),FOREIGN KEY(active_id) REFERENCES activities(id),FOREIGN KEY(user_id) REFERENCES users(id))ENGINE=INNODB DEFAULT CHARSET=UTF8 COMMENT '报名记录';CREATE TABLE `apply_logs` (`id` char(13) NOT NULL COMMENT '记录ID',`status` int NOT NULL COMMENT '处理状态',`create_time` char(19) NOT NULL COMMENT '申请时间',`team_id` char(13) NOT NULL COMMENT '申请社团',`user_id` char(13) NOT NULL COMMENT '申请用户',PRIMARY KEY(`id`),FOREIGN KEY(team_id) REFERENCES teams(id),FOREIGN KEY(user_id) REFERENCES users(id))ENGINE=INNODB DEFAULT CHARSET=UTF8 COMMENT '申请记录';CREATE TABLE `members` (`id` char(13) NOT NULL COMMENT '记录ID',`create_time` char(19) NOT NULL COMMENT '入团时间',`team_id` char(13) NOT NULL COMMENT '加入社团',`user_id` char(13) NOT NULL COMMENT '申请用户',PRIMARY KEY(`id`),FOREIGN KEY(team_id) REFERENCES teams(id),FOREIGN KEY(user_id) REFERENCES users(id))ENGINE=INNODB DEFAULT CHARSET=UTF8 COMMENT '成员信息';CREATE TABLE `pay_logs` (`id` char(13) NOT NULL COMMENT '记录ID',`create_time` char(19) NOT NULL COMMENT '缴费时间',`total` double NOT NULL COMMENT '缴纳费用',`team_id` char(13) NOT NULL COMMENT '收费社团',`user_id` char(13) NOT NULL COMMENT '缴费用户',PRIMARY KEY(`id`),FOREIGN KEY(team_id) REFERENCES teams(id),FOREIGN KEY(user_id) REFERENCES users(id))ENGINE=INNODB DEFAULT CHARSET=UTF8 COMMENT '缴费记录';-- 插入测试数据INSERT INTO users (id, user_name, pass_word, name, gender, age, phone, address, create_time, type) VALUES ('1642422100000', 'admin', 'admin', '张三丰', '男', 45, '90989192', '武当十八号', '2022-01-17 20:00:00', 0);INSERT INTO users (id, user_name, pass_word, name, gender, age, phone, address, create_time, type) VALUES ('1642422100001', 'fater', 'fater', '张翠山', '男', 28, '90989193', '武当十九号', '2022-01-17 20:00:00', 1);INSERT INTO team_types (id, name, create_time) VALUES ('1642422100000', '科技创新', '2022-01-17 20:00:00');INSERT INTO team_types (id, name, create_time) VALUES ('1642422100001', '户外运动', '2022-01-17 20:00:00');INSERT INTO team_types (id, name, create_time) VALUES ('1642422100002', '语言文学', '2022-01-17 20:00:00');INSERT INTO team_types (id, name, create_time) VALUES ('1642422100003', '志愿服务', '2022-01-17 20:00:00');INSERT INTO teams (id, name, create_time, total, manager, type_id) VALUES ('1642422100000', '网络攻防', '2022-01-17', 1, '1642422100001', '1642422100000');INSERT INTO members (id, create_time, team_id, user_id) VALUES ('1642422100000', '2022-01-17 20:00:00', '1642422100000', '1642422100001');





