Carp后端开发文档
一、准备工作
(1)JDK8安装
下载地址及教程:https://mp.weixin.qq.com/s/j77xZTFLLR1_D23-T6c-JA
(2)数据库及服务器安装
MySQL8.0:https://mp.weixin.qq.com/s/eGtXyipJFyOWUxGTL5FQxg
MySQL教程:https://www.runoob.com/mysql/mysql-tutorial.html
Redis:https://www.runoob.com/redis/redis-install.html
Tomcat:http://tomcat.apache.org/
(3)开发工具安装
集成开发环境
IDEA2019:https://mp.weixin.qq.com/s/vTralVDHU1iNvPVpoy2b1Q
数据库管理软件
SQLyog:https://mp.weixin.qq.com/s/pYuAGRHdtcd7yw00LW6mvw
Linux远程连接工具
xshell:https://mp.weixin.qq.com/s/2ih8DTQp3Tryb3bNodyTYQ
其他开发辅助工具(可选)
RedisDesktopManager、Postman
(4)云服务器购买与配置
腾讯云学生优惠:https://cloud.tencent.com/act/campus?utm_source=qcloud&utm_medium=head&utm_campaign=campus
域名注册(不必立即完成):https://cloud.tencent.com/act/domainsales?from=dnspodqcloud
网站备案(不必立即完成):https://cloud.tencent.com/product/ba
腾讯云服务器在购买完成后需设置安全组、开放端口,具体可查阅CSDN相关博客;
(5)腾讯云服务器项目环境配置
须在腾讯云中安装Linux版本jdk8、Tomcat、mysql、redis并完成环境配置;
(6)代码版本管理仓库Git及Gitee(建议使用)
Git
官方下载地址:https://git-scm.com/download/win
安装教程:https://blog.csdn.net/monica1_1/article/details/80886048
命令:https://blog.csdn.net/halaoda/article/details/78661334
Gitee
官方网址:https://gitee.com/
二、SpringBoot开发框架
(1)新建SpringBoot项目
1.选择Spring初始化
2.点击next
3.点击next,初始化依赖,可暂时先选Web
4.点击next
5.点击Finish,等待Maven项目创建完成,初次创建时间可能会较长;
6.创建成功后打开项目目录
7.项目目录介绍
(2)SpringBoot依赖
依赖导入到pom.xml文件
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--持久层相关依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.1</version>
</dependency>
<!--引入swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<!-- 引入swagger-bootstrap-ui包 /doc.html-->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<version>1.9.1</version>
</dependency>
<!--lombok-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
<version>1.18.2</version>
</dependency>
<!--字符串工具类-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.11</version>
</dependency>
<!--redis-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!--测试包-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- http请求工具包依赖 -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<!--jsonObject需要的jar包-->
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<!--工具类wxutils所需-->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.59</version>
</dependency>
<!--工具类wxutils的JSONObject.parseObject需要-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.56</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
(3)项目目录下包分类
(4)SpringBoot全局配置
在resources目录下创建文件application.yml
三、数据库连接
未完…