2024-08-08 11:12:49 +08:00
|
|
|
|
|
|
|
## 7. 项目实践
|
|
|
|
|
2024-11-15 12:36:48 +08:00
|
|
|
基于开源项目 https://github.com/rocboss/paopao-ce , 使用spring boot完成后端服务程序。
|
|
|
|
|
|
|
|
### 7.1 项目准备
|
|
|
|
|
|
|
|
#### 7.1.1 Git仓库
|
|
|
|
|
2024-11-18 07:25:42 +08:00
|
|
|
在http://123.249.84.124:8066/ 注册账号
|
|
|
|
|
|
|
|
创建仓库 paopao
|
2024-11-15 12:36:48 +08:00
|
|
|
|
|
|
|
#### 7.1.2 初始化spring boot项目
|
|
|
|
|
2024-11-18 07:25:42 +08:00
|
|
|
https://start.spring.io/ 创建项目
|
2024-11-15 12:36:48 +08:00
|
|
|
|
|
|
|
#### 7.1.3 gradle配置
|
|
|
|
|
2024-11-18 07:25:42 +08:00
|
|
|
国内源配置
|
|
|
|
```groovy
|
|
|
|
repositories {
|
|
|
|
mavenLocal()
|
|
|
|
maven { url 'https://mirrors.cloud.tencent.com/nexus/repository/maven-public/' }
|
|
|
|
maven { url 'https://maven.aliyun.com/repository/central' }
|
|
|
|
maven { url 'https://maven.aliyun.com/repository/public' }
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
```
|
2024-11-15 12:36:48 +08:00
|
|
|
|
|
|
|
#### 7.1.4 ui部署
|
|
|
|
|
2024-11-18 07:25:42 +08:00
|
|
|
nginx中部署 [paopao-web-ui.zip](../examples/chapter07/paopao-web-ui.zip)
|
2024-11-15 12:36:48 +08:00
|
|
|
|
|
|
|
### 7.2 用户注册功能开发
|
|
|
|
|
|
|
|
#### 7.2.1 API设计
|
|
|
|
|
|
|
|
#### 7.2.2 spring boot配置文件修改
|
|
|
|
|
|
|
|
#### 7.2.3 实体类和Repository接口
|
|
|
|
|
|
|
|
#### 7.2.3 Controller和service
|
|
|
|
|
|
|
|
#### 7.2.4 测试
|
|
|
|
|
|
|
|
### 7.3 发布文章功能开发
|
|
|
|
|
|
|
|
#### 7.3.1 API
|
|
|
|
|
|
|
|
#### 7.3.2 实体类和Repository接口
|
|
|
|
|
|
|
|
#### 7.3.3 Controller和service
|
|
|
|
|
|
|
|
#### 7.3.4 实现统一包装回应数据
|
|
|
|
|
|
|
|
|
|
|
|
### 7.3 附件上传功能开发
|
|
|
|
|
|
|
|
#### 7.3.1 API
|
|
|
|
|
|
|
|
#### 7.3.2 实体类和Repository接口
|
|
|
|
|
|
|
|
#### 7.3.3 Controller和service
|
|
|
|
|
|
|
|
|
2024-11-16 11:13:31 +08:00
|
|
|
### 7.4 文章相关功能开发
|
2024-11-15 12:36:48 +08:00
|
|
|
|
|
|
|
#### 7.4.1 API设计
|
|
|
|
|
|
|
|
|
|
|
|
#### 7.4.2 功能实现
|
|
|
|
|
2024-11-15 12:44:53 +08:00
|
|
|
文章查询、评论功能、点赞、收藏
|
2024-11-15 12:36:48 +08:00
|
|
|
|
|
|
|
|
2024-11-15 12:44:53 +08:00
|
|
|
#### 7.4.3 DTO
|
2024-11-15 12:36:48 +08:00
|
|
|
|
2024-11-15 12:44:53 +08:00
|
|
|
|
|
|
|
#### 7.4.4 lombok和mapstruct
|
2024-11-15 12:36:48 +08:00
|
|
|
|
|
|
|
|
|
|
|
### 7.5 部署
|
|
|
|
|
|
|
|
|