Skip to content

Commit 1cc4e36

Browse files
committed
SpringBoot初始化模板v2.1.3 集成vue-admin-template开源前端框架。
1 parent 0c15f42 commit 1cc4e36

File tree

21 files changed

+514
-347
lines changed

21 files changed

+514
-347
lines changed

README.md

+73-22
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<p align="center">
22
<a href="https://github.com/AntonyCheng">
3-
<img alt="spring-boot-init-template logo" src="logo/logo.png" title="logo"/>
3+
<img alt="spring-boot-init-template logo" src="picture/logo/logo.png" title="logo"/>
44
</a>
55
</p>
66

77
> **作者:[AntonyCheng](https://github.com/AntonyCheng)**
88
>
9-
> **版本号:v2.1.2**
9+
> **版本号:v2.1.3**
1010
>
1111
> **开源协议:[Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0.html)**
1212
1313
# SpringBoot初始化模板
1414

15-
**基于 Java Web 项目的 SpringBoot 框架初始化模板**,该模板整合了常用的框架,保证大家在此基础上能够快速开发自己的项目,该模板针对于后端启动开发小而精,本项目会由作者持续更新。
15+
**基于 Java Web 项目的 SpringBoot 框架初始化模板**,该模板整合了常用的框架,该模板适用于前后端分离项目启动开发,保证大家在此基础上能够快速开发自己的项目,同时也适合入门学习,本项目会由作者持续更新。
1616

1717
* [SpringBoot初始化模板](#springboot初始化模板)
1818
* [模板特点](#模板特点)
@@ -24,6 +24,7 @@
2424
* [快速上手](#快速上手)
2525
* [必须执行](#必须执行)
2626
* [可选执行](#可选执行)
27+
* [启动前端项目](#启动前端项目)
2728
* [整合缓存服务](#整合缓存服务)
2829
* [整合系统缓存(Redis)](#整合系统缓存redis)
2930
* [整合业务缓存(Redisson)](#整合业务缓存redisson)
@@ -48,6 +49,7 @@
4849
* [开启JWT](#开启jwt)
4950
* [整合Redis](#整合redis)
5051
* [整合JWT](#整合jwt)
52+
* [确认鉴权模式](#确认鉴权模式)
5153
* [配置定时任务](#配置定时任务)
5254
* [SpringBoot任务调度](#springboot任务调度)
5355
* [XxlJob任务调度](#xxljob任务调度)
@@ -60,14 +62,15 @@
6062
* [搭建Deployer&Client系统](#搭建deployerclient系统)
6163
* [兼容Java8](#兼容java8)
6264
* [申明&联系我](#申明联系我)
65+
* [模板预览](#模板预览)
6366
* [下一步开发计划](#下一步开发计划)
6467

6568
## 模板特点
6669

6770
### 主流框架
6871

6972
- **Java 11**
70-
- 兼容性,详情见[兼容Java8](#兼容Java8)
73+
- 兼容性,详情见[兼容Java8](#兼容java8)
7174
- **SpringBoot 2.7.18**
7275
- spring-boot-starter-web == 基于 Spring MVC 的 Web 应用依赖
7376
- spring-boot-starter-undertow == 轻量级、高性能 Servlet 容器
@@ -78,24 +81,28 @@
7881
- spring-boot-starter-freemaker == 模板引擎依赖
7982
- spring-boot-starter-test == Spring Boot Test 依赖
8083
- spring-boot-configuration-processor == 生成配置元数据信息,辅助开发工具
84+
- **UI**
85+
- vue-admin-template 4.4.0 == 这是一个极简的 vue admin 管理后台,只包含了 Vue 2 & Element UI & axios & iconfont & permission control & lint
86+
8187
- **Netty**
82-
- netty-all 4.1.107.Final == Netty 框架
88+
- netty-all 4.1.108.Final == Netty 框架
8389
- **MySQL**
8490
- mysql-connector-j 8.0.33 == Java 连接 MySQL 依赖
91+
- druid-spring-boot-starter 1.2.22 == Druid 连接池
8592
- mybatis-plus-boot-starter 3.5.5 == MySQL 操作框架
8693
- shardingsphere-jdbc-core 5.3.2 == 分布式数据库解决方案
87-
- druid-spring-boot-starter 1.2.21 == Druid 连接池
8894
- **工具类**
89-
- lombok 1.18.30 == POJO 简化工具
90-
- hutool-all 5.8.26 == Hutool 工具类
95+
- lombok 1.18.32 == POJO 简化工具
96+
- hutool-all 5.8.27 == Hutool 工具类
9197
- commons-lang3 3.14.0 == Apache Commons Lang 工具类
92-
- commons-io 2.15.1 == Apache Commons IO 工具类
93-
- commons-codec 1.16.0 == Apache Commons Codec 工具类
98+
- commons-io 2.16.0 == Apache Commons IO 工具类
99+
- commons-codec 1.16.1 == Apache Commons Codec 工具类
94100
- commons-pool2 2.12.0 == Apache Commons Pool 工具类
95101
- commons-collections4 4.4 == Apache Commons Collections 工具类
96102
- commons-math3 3.6.1 == Apache Commons Math 工具类
97-
- ok-http 4.12.0 == Ok Http 工具类
98-
- fastjson2 2.0.47 == Fast JSON 工具类
103+
- okhttp 4.12.0 == OK Http 工具类
104+
- okio 3.9.0 == OK IO 工具类
105+
- fastjson2 2.0.48 == Fast JSON 工具类
99106
- ip2region 2.7.0 == 离线 IP 地址定位库
100107
- **权限校验**
101108
- sa-token-spring-boot-starter == SaToken 认证鉴权框架
@@ -105,28 +112,27 @@
105112
- **缓存服务**
106113
- spring-boot-starter-data-redis == Spring Data Redis 依赖
107114
- spring-boot-starter-cache == Spring Cache 依赖
108-
- redisson 3.27.1 == Redis 的基础上实现的 Java 驻内存数据网格
115+
- redisson 3.27.2 == Redis 的基础上实现的 Java 驻内存数据网格
109116
- **本地缓存服务**
110117
- caffeine 3.1.8 == Caffeine 本地缓存依赖
111118
- **消息队列**
112119
- spring-boot-starter-amqp == 支持 AMQP (高级消息队列协议)消息代理
113120
- spring-rabbit-test == Spring 支持对 RabbitMQ 消息队列的单元测试
114121
- **搜索引擎**
115-
- easy-es-boot-starter 2.0.0-bata5 == 简化 Elasticsearch 搜索引擎,可以像 Mybatis-Plus 操作 MySQL 一样操作 Elasticsearch 的开源框架
122+
- easy-es-boot-starter 2.0.0-bata7 == 简化 Elasticsearch 搜索引擎,可以像 Mybatis-Plus 操作 MySQL 一样操作 Elasticsearch 的开源框架
116123
- elasticsearch 7.14.0 == Elasticsearch 依赖
117124
- elasticsearch-rest-high-level-client 7.14.0 == ES 高级别客户端依赖
118125
- logstash-logback-encoder 7.3 == Logstash 依赖
119126
- **对象存储(OSS)**
120-
- cos_api 5.6.205 == 腾讯云 COS
127+
- cos_api 5.6.208 == 腾讯云 COS
121128
- aliyun-sdk-oss 3.17.4 == 阿里云 OSS
122-
- minio 8.5.8 == Minio 对象存储
129+
- minio 8.5.9 == Minio 对象存储
123130
- **文件操作**
124131
- poi 5.2.5 == 操作 Word
125132
- easyexcel 3.3.4 == 操作 Excel
126133
- itext-core 8.0.3 == 操作 PDF
127134
- **接口文档 & API调试**
128-
- knife4j-openapi3-spring-boot-starter 4.4.0 == Knife4j 依赖
129-
135+
- knife4j-openapi3-spring-boot-starter 4.5.0 == Knife4j 依赖
130136
- **外接平台(建议生产环境上使用 Docker 容器化技术自行部署一套平台,不要通过模板中的模块代码直接进行编译部署,主要原因是为了适配模板,外接平台中的某些代码被作者修改过)**
131137
- xxl-job-core 2.4.0 == 分布式定时任务管理平台
132138
- powerjob-worker-spring-boot-starter 4.3.9 == 更强劲的分布式定时任务管理平台(个人认为,针对于中小型项目而言,PowerJob 并不适用,可以对比一下 XxlJob ,就能发现 PowerJob 很多功能用不上,当然这得让开发者自己考虑,所以模板依然保留了 XxlJob 的集成模块)
@@ -136,6 +142,7 @@
136142
### 业务特性
137143

138144
- 使用 Undertow 服务器替换掉 Tomcat 服务器,无阻塞更适合高并发
145+
- Web UI 选用 vue-admin-template 前端模板,基于 Vue 2 和 Element UI ,极易上手开发调试
139146
- SaToken 可配置分布式登录 & 认证 & 鉴权
140147
- AOP 逻辑处理示例
141148
- 自定义注解处理示例
@@ -154,14 +161,14 @@
154161
- JSON 长整型精度处理
155162
- 自动字段填充器
156163
- 基于 Netty 的 WebSocket 全双工通信设计示例
157-
- 对象存储、消息队列、缓存、分布式锁、限流、国际化、网络、Excel等工具类
164+
- 对象存储、消息队列、缓存、分布式锁、限流、国际化、网络、Excel 等工具类
158165

159166
## 业务功能
160167

161168
### 示例业务
162169

163170
- 提供模板 SQL 示例文件(业务数据库 & XxlJob 数据库 & PowerJob 数据库)
164-
- 用户登录、注册、注销、信息获取
171+
- 用户登录、注册、注销、信息获取、添加、查询、删除以及修改等后端接口及前端页面
165172
- Spring Scheduler 单机版定时任务示例
166173
- XxlJob & PowerJob 使用逻辑代码示例
167174
- RabbitMQ 多类型消息队列逻辑代码示例
@@ -183,7 +190,7 @@
183190
184191
### 必须执行
185192

186-
1. 执行 `sql/init_db.sql``sql/init_xxl_job.sql` 以及 ` sql/init_power_job.sql` 文件;
193+
1. 执行 `sql/init_db.sql``sql/init_xxl_job.sql` 以及 ` sql/init_power_job.sql` 文件,模板默认管理员账号:admin,默认用户账号:user,密码均为123456
187194

188195
2. 修改 `src/main/resources/mysql/mysql.yaml` 文件:
189196

@@ -204,12 +211,16 @@
204211
205212
> 在这个文件中还能看到很多其他的配置,如有需要,请开发者自行学习 ShardingSphere 框架,理解相关配置;
206213
207-
3. 直到这一步之后,模板就已经可以直接启动了,访问 `http://localhost:38080/api/doc.html` 即可打开接口文档
214+
3. 直到这一步之后,模板后端代码就已经可以直接启动了,访问 `http://localhost:38080/api/doc.html` 即可打开接口文档
208215

209216
### 可选执行
210217

211218
> 为了方便开发者快速找到配置文件需要修改的位置,一律使用 todo 待办进行标识,请务必“**必须执行**”。
212219

220+
#### 启动前端项目
221+
222+
如果需要启动前端进行开发或者调试,开发者需要前往 `ui` 文件夹,打开 `vue-admin-template` 项目,参考其 `README.md` 文件启动即可。
223+
213224
#### 整合缓存服务
214225

215226
**说明**:该模板中存在两种 Redis 服务,第一种是系统缓存服务( **对应整合系统缓存** ),第二种是业务缓存服务( **对应整合业务缓存** )。前者承担系统框架本身的缓存服务,例如用户分布式登录信息的缓存;后者承担开发者业务逻辑所需的缓存操作,例如分布式锁、限流工具等。除了 Redis 服务,还有 Caffeine 本地缓存服务,详情请查看以下内容。
@@ -1387,6 +1398,46 @@ Deployer 只能监听一个 MySQL 的增量日志。
13871398
<caffeine.version>2.9.3</caffeine.version>
13881399
```
13891400

1401+
## 前端预览
1402+
1403+
**注意**:作者前端开发水平较为有限,整合前端模板为项目完整性做保障。
1404+
1405+
**登陆界面**
1406+
1407+
![loginPage.png](picture/project/loginPage.png)
1408+
1409+
**首页界面**
1410+
1411+
![indexPage.png](picture/project/indexPage.png)
1412+
1413+
**用户管理界面**
1414+
1415+
首页:
1416+
1417+
![userManage-index.png](picture/project/userManage-index.png)
1418+
1419+
查询:
1420+
1421+
![userManage-query.png](picture/project/userManage-query.png)
1422+
1423+
添加:
1424+
1425+
![userManage-add.png](picture/project/userManage-add.png)
1426+
1427+
更新:
1428+
1429+
![userManage-updateInfo.png](picture/project/userManage-updateInfo.png)
1430+
1431+
![userManage-updatePassword.png](picture/project/userManage-updatePassword.png)
1432+
1433+
删除:
1434+
1435+
![userManage-delete.png](picture/project/userManage-delete.png)
1436+
1437+
导出:
1438+
1439+
![userManage-export.png](picture/project/userManage-export.png)
1440+
13901441
## 申明&联系我
13911442

13921443
作者能力有限,暂时还不能精通使用本模板中所整合的所有框架,若在使用当中遇到问题或者确定 BUG ,请发布 ISSUES 或者直接提交 PR ,作者定会逐一查看,采纳意见并且做出修改。
File renamed without changes.

picture/project/indexPage.png

71.2 KB
Loading

picture/project/loginPage.png

46.2 KB
Loading

picture/project/userManage-add.png

115 KB
Loading

picture/project/userManage-delete.png

120 KB
Loading

picture/project/userManage-export.png

76.7 KB
Loading

picture/project/userManage-index.png

117 KB
Loading

picture/project/userManage-query.png

77.3 KB
Loading
114 KB
Loading
114 KB
Loading

pom.xml

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</parent>
1313
<groupId>top.sharehome</groupId>
1414
<artifactId>spring-boot-init-template</artifactId>
15-
<version>2.1.2</version>
15+
<version>2.1.3</version>
1616
<name>spring-boot-init-template</name>
1717
<description>spring-boot-init-template</description>
1818
<url>https://github.com/AntonyCheng/spring-boot-init-template</url>
@@ -62,16 +62,16 @@
6262
<mybatis.plus.starter.version>3.5.5</mybatis.plus.starter.version>
6363
<shardingsphere.version>5.3.2</shardingsphere.version>
6464
<!-- 工具类相关 -->
65-
<lombok.version>1.18.30</lombok.version>
65+
<lombok.version>1.18.32</lombok.version>
6666
<hutool.version>5.8.27</hutool.version>
6767
<commons.lang3.version>3.14.0</commons.lang3.version>
68-
<commons.io.version>2.15.1</commons.io.version>
69-
<commons.codec.version>1.16.0</commons.codec.version>
68+
<commons.io.version>2.16.0</commons.io.version>
69+
<commons.codec.version>1.16.1</commons.codec.version>
7070
<commons.pool2.version>2.12.0</commons.pool2.version>
7171
<commons.collections4.version>4.4</commons.collections4.version>
7272
<commons.math3.version>3.6.1</commons.math3.version>
7373
<ok.http3.version>4.12.0</ok.http3.version>
74-
<ok.io.version>3.7.0</ok.io.version>
74+
<ok.io.version>3.9.0</ok.io.version>
7575
<ip2region.version>2.7.0</ip2region.version>
7676
<knife4j.openapi3.starter.version>4.5.0</knife4j.openapi3.starter.version>
7777
<fastjson2.version>2.0.48</fastjson2.version>
@@ -83,9 +83,9 @@
8383
<!-- ElasticSearch相关 -->
8484
<elasticsearch.version>7.14.0</elasticsearch.version>
8585
<logstash.logback.version>7.3</logstash.logback.version>
86-
<easy.es.starter.version>2.0.0-beta6</easy.es.starter.version>
86+
<easy.es.starter.version>2.0.0-beta7</easy.es.starter.version>
8787
<!-- 对象存储相关 -->
88-
<tencent.cos.version>5.6.205</tencent.cos.version>
88+
<tencent.cos.version>5.6.208</tencent.cos.version>
8989
<ali.oss.version>3.17.4</ali.oss.version>
9090
<ali.jaxb.version>2.3.1</ali.jaxb.version>
9191
<ali.activation.version>1.1.1</ali.activation.version>

sql/init_db.sql

+32-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,37 @@ CREATE TABLE `t_user` (
2626
-- ----------------------------
2727
-- Records of t_user
2828
-- ----------------------------
29-
INSERT INTO `t_user` VALUES (1900, 'admin', '207acd61a3c1bd506d7e9a4535359f8a', 'AntonyCheng', NULL, 'admin', 0, '2024-03-27 22:01:16', '2024-03-30 11:32:49', 0);
30-
INSERT INTO `t_user` VALUES (1901, 'user', '207acd61a3c1bd506d7e9a4535359f8a', 'AntonyCoding', NULL, 'user', 0, '2024-03-27 22:01:17', '2024-04-01 22:02:17', 0);
29+
INSERT INTO `t_user` VALUES (1900, 'admin', '207acd61a3c1bd506d7e9a4535359f8a', 'AntonyCheng', NULL, 'admin', 0, '2024-03-27 22:01:16', '2024-04-02 21:20:26', 0);
30+
INSERT INTO `t_user` VALUES (1901, 'user', '207acd61a3c1bd506d7e9a4535359f8a', 'AntonyCoding', NULL, 'user', 0, '2024-03-27 22:01:17', '2024-04-03 13:54:37', 0);
31+
INSERT INTO `t_user` VALUES (1902, 'user1', '6c8cc4d828425167278e9fe37789fd46', 'Antony1', NULL, 'user', 0, '2024-04-01 23:40:55', '2024-04-03 13:27:53', 0);
32+
INSERT INTO `t_user` VALUES (1903, 'user2', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony2', NULL, 'user', 0, '2024-04-01 23:40:55', '2024-04-03 13:27:55', 0);
33+
INSERT INTO `t_user` VALUES (1904, 'user3', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony3', NULL, 'user', 0, '2024-04-01 23:40:55', '2024-04-03 13:27:55', 0);
34+
INSERT INTO `t_user` VALUES (1905, 'user4', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony4', NULL, 'user', 0, '2024-04-01 23:40:55', '2024-04-02 20:36:07', 0);
35+
INSERT INTO `t_user` VALUES (1906, 'user5', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony5', NULL, 'user', 0, '2024-04-01 23:40:55', '2024-04-03 13:22:11', 0);
36+
INSERT INTO `t_user` VALUES (1907, 'user6', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony6', NULL, 'user', 0, '2024-04-01 23:40:55', '2024-04-02 20:36:07', 0);
37+
INSERT INTO `t_user` VALUES (1908, 'user7', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony7', NULL, 'user', 0, '2024-04-01 23:40:55', '2024-04-02 20:36:07', 0);
38+
INSERT INTO `t_user` VALUES (1909, 'user8', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony8', NULL, 'user', 0, '2024-04-01 23:40:55', '2024-04-02 20:36:07', 0);
39+
INSERT INTO `t_user` VALUES (1910, 'user9', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony9', NULL, 'user', 0, '2024-04-01 23:40:55', '2024-04-02 20:36:07', 0);
40+
INSERT INTO `t_user` VALUES (1775113809426817025, 'user10', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony10', NULL, 'user', 0, '2024-04-02 18:51:27', '2024-04-02 20:36:07', 0);
41+
INSERT INTO `t_user` VALUES (1775115510955286530, 'user11', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony11', NULL, 'user', 0, '2024-04-02 18:58:13', '2024-04-02 20:36:07', 0);
42+
INSERT INTO `t_user` VALUES (1775135430363455490, 'user12', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony12', NULL, 'user', 0, '2024-04-02 20:17:22', '2024-04-02 20:36:07', 0);
43+
INSERT INTO `t_user` VALUES (1775144682826113025, 'user13', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony13', NULL, 'user', 0, '2024-04-02 20:54:08', '2024-04-02 20:54:08', 0);
44+
INSERT INTO `t_user` VALUES (1775145271509262337, 'user14', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony14', NULL, 'user', 0, '2024-04-02 20:56:28', '2024-04-02 20:56:28', 0);
45+
INSERT INTO `t_user` VALUES (1775146054472572929, 'user15', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony15', NULL, 'user', 0, '2024-04-02 20:59:35', '2024-04-02 20:59:35', 0);
46+
INSERT INTO `t_user` VALUES (1775146105840214017, 'user16', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony16', NULL, 'user', 0, '2024-04-02 20:59:47', '2024-04-02 20:59:47', 0);
47+
INSERT INTO `t_user` VALUES (1775146158390648834, 'user17', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony17', NULL, 'user', 0, '2024-04-02 20:59:59', '2024-04-02 20:59:59', 0);
48+
INSERT INTO `t_user` VALUES (1775146210676842498, 'user18', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony18', NULL, 'user', 0, '2024-04-02 21:00:12', '2024-04-02 21:00:12', 0);
49+
INSERT INTO `t_user` VALUES (1775146297222111233, 'user19', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony19', NULL, 'user', 0, '2024-04-02 21:00:33', '2024-04-02 21:00:33', 0);
50+
INSERT INTO `t_user` VALUES (1775365730125459458, 'user20', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony20', NULL, 'user', 0, '2024-04-03 11:32:29', '2024-04-03 11:38:28', 0);
51+
INSERT INTO `t_user` VALUES (1775365807405510658, 'user21', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony21', NULL, 'user', 0, '2024-04-03 11:32:48', '2024-04-03 11:38:31', 0);
52+
INSERT INTO `t_user` VALUES (1775366194225197057, 'user22', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony22', NULL, 'user', 0, '2024-04-03 11:34:20', '2024-04-03 11:38:32', 0);
53+
INSERT INTO `t_user` VALUES (1775366255906631682, 'user23', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony23', NULL, 'user', 0, '2024-04-03 11:34:35', '2024-04-03 11:38:34', 0);
54+
INSERT INTO `t_user` VALUES (1775366338987405314, 'user24', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony24', NULL, 'user', 0, '2024-04-03 11:34:55', '2024-04-03 13:22:21', 0);
55+
INSERT INTO `t_user` VALUES (1775366388358557698, 'user25', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony25', NULL, 'user', 0, '2024-04-03 11:35:06', '2024-04-03 11:38:39', 0);
56+
INSERT INTO `t_user` VALUES (1775366594307272705, 'user26', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony26', NULL, 'user', 0, '2024-04-03 11:35:55', '2024-04-03 11:38:41', 0);
57+
INSERT INTO `t_user` VALUES (1775366755221745665, 'user27', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony27', NULL, 'user', 0, '2024-04-03 11:36:34', '2024-04-03 11:38:45', 0);
58+
INSERT INTO `t_user` VALUES (1775366808783007746, 'user28', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony28', NULL, 'user', 0, '2024-04-03 11:36:47', '2024-04-03 11:38:47', 0);
59+
INSERT INTO `t_user` VALUES (1775366952316284930, 'user29', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony29', NULL, 'user', 0, '2024-04-03 11:37:21', '2024-04-03 11:38:49', 0);
60+
INSERT INTO `t_user` VALUES (1775393764199084033, 'user30', '207acd61a3c1bd506d7e9a4535359f8a', 'Antony30', NULL, 'user', 0, '2024-04-03 13:23:53', '2024-04-03 13:23:53', 0);
3161

3262
SET FOREIGN_KEY_CHECKS = 1;

src/main/java/top/sharehome/springbootinittemplate/elasticsearch/mapper/UserEsMapper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package top.sharehome.springbootinittemplate.elasticsearch.mapper;
22

3-
import org.dromara.easyes.core.core.BaseEsMapper;
3+
import org.dromara.easyes.core.kernel.BaseEsMapper;
44
import top.sharehome.springbootinittemplate.elasticsearch.entity.UserEs;
55

66
/**

src/main/java/top/sharehome/springbootinittemplate/model/vo/admin/AdminPageUserVo.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ public class AdminPageUserVo {
5252
/**
5353
* 创建时间
5454
*/
55-
private LocalDateTime createTime;
55+
private String createTime;
5656

5757
}

src/main/java/top/sharehome/springbootinittemplate/service/impl/AdminServiceImpl.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import top.sharehome.springbootinittemplate.utils.satoken.LoginUtils;
2626

2727
import javax.annotation.Resource;
28+
import java.time.format.DateTimeFormatter;
2829
import java.util.List;
2930
import java.util.Objects;
3031
import java.util.stream.Collectors;
@@ -62,7 +63,13 @@ public Page<AdminPageUserVo> pageUser(AdminPageUserDto adminPageUserDto, PageMod
6263
// 返回值处理(Entity ==> Vo)
6364
List<AdminPageUserVo> newRecords = page.getRecords().stream().map(user -> {
6465
AdminPageUserVo adminPageUserVo = new AdminPageUserVo();
65-
BeanUtils.copyProperties(user, adminPageUserVo);
66+
adminPageUserVo.setId(user.getId());
67+
adminPageUserVo.setAccount(user.getAccount());
68+
adminPageUserVo.setName(user.getName());
69+
adminPageUserVo.setAvatar(user.getAvatar());
70+
adminPageUserVo.setRole(user.getRole());
71+
adminPageUserVo.setState(user.getState());
72+
adminPageUserVo.setCreateTime(user.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
6673
return adminPageUserVo;
6774
}).collect(Collectors.toList());
6875
BeanUtils.copyProperties(page, res, "records");

0 commit comments

Comments
 (0)