Skip to content

Commit 8cc0553

Browse files
committed
[UPDATE]3.3.4
1 parent bcd7ceb commit 8cc0553

File tree

20 files changed

+362
-451
lines changed

20 files changed

+362
-451
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# XBoot
22
[![AUR](https://img.shields.io/badge/GPL-v3-red)](https://github.com/Exrick/xmall/blob/master/License)
33
[![](https://img.shields.io/badge/Author-Exrick-orange.svg)](http://blog.exrick.cn)
4-
[![](https://img.shields.io/badge/version-3.3.3-brightgreen.svg)](https://github.com/Exrick/x-boot)
4+
[![](https://img.shields.io/badge/version-3.3.4-brightgreen.svg)](https://github.com/Exrick/x-boot)
55
[![GitHub stars](https://img.shields.io/github/stars/Exrick/x-boot.svg?style=social&label=Stars)](https://github.com/Exrick/x-boot)
66
[![GitHub forks](https://img.shields.io/github/forks/Exrick/x-boot.svg?style=social&label=Fork)](https://github.com/Exrick/x-boot)
77

@@ -22,7 +22,7 @@ https://www.kancloud.cn/exrick/xboot/content
2222
- xboot-fast:单应用版本
2323
- xboot-module:多模块版本
2424
### 项目简介
25-
- [x] 代码拥有详细注释 无复杂逻辑 核心使用 SpringBoot 2.3.7.RELEASE
25+
- [x] 代码拥有详细注释 无复杂逻辑 核心使用 SpringBoot 2.4.8
2626
- [x] JWT / 基于Redis可配置单设备登录Token交互 任意切换 提供开放平台、OAuth2认证中心 支持点单登录
2727
- [x] JPA + Mybatis-Plus 任意切换
2828
- [x] 操作日志记录方式任意切换Mysql或Elasticseach记录
@@ -41,19 +41,19 @@ https://www.kancloud.cn/exrick/xboot/content
4141

4242
- PC
4343

44-
![QQ截图20180826163917.png](https://ooo.0o0.ooo/2018/08/26/5b826868e2359.png)
44+
![QQ截图20180826163917.png](https://ooo.0o0.ooo/2021/07/01/t6RXqn8LeaY5Nu1.png)
4545

46-
![QQ截图20180826164058.png](https://ooo.0o0.ooo/2018/08/26/5b8268d63d156.png)
46+
![QQ截图20180826164058.png](https://ooo.0o0.ooo/2021/07/01/TQZqrxog4ufX2SR.png)
4747

48-
![QQ截图20180826164144.png](https://ooo.0o0.ooo/2018/08/26/5b8268e6a091f.png)
48+
![QQ截图20180826164144.png](https://ooo.0o0.ooo/2021/07/01/t7RdWhkbzZCawce.png)
4949

5050
- iPad Mini 5
5151

52-
<img src=https://ooo.0o0.ooo/2019/11/25/2tiloPbTcqfnRDQ.jpg width=600/>
52+
<img src=https://ooo.0o0.ooo/2021/07/01/gXl5OKkJHEIwf3N.png width=600/>
5353

5454
- iPhone X
5555

56-
<img src=https://ooo.0o0.ooo/2019/11/25/EaLfVxmli2Tg8PY.jpg width=300/>
56+
<img src=https://ooo.0o0.ooo/2021/07/01/LdNPiKMlOESvfW8.png width=300/>
5757

5858

5959
### [完整版截图细节展示](https://github.com/Exrick/x-boot/wiki/%E5%AE%8C%E6%95%B4%E7%89%88%E6%88%AA%E5%9B%BE%E7%BB%86%E8%8A%82%E5%B1%95%E7%A4%BA)

xboot-fast/pom.xml

+14-26
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>org.springframework.boot</groupId>
1313
<artifactId>spring-boot-starter-parent</artifactId>
14-
<version>2.3.7.RELEASE</version>
14+
<version>2.4.8</version>
1515
</parent>
1616

1717
<properties>
@@ -42,12 +42,6 @@
4242
<dependency>
4343
<groupId>org.springframework.boot</groupId>
4444
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
45-
<exclusions>
46-
<exclusion>
47-
<artifactId>HdrHistogram</artifactId>
48-
<groupId>org.hdrhistogram</groupId>
49-
</exclusion>
50-
</exclusions>
5145
</dependency>
5246
<dependency>
5347
<groupId>org.springframework.boot</groupId>
@@ -56,18 +50,18 @@
5650
<dependency>
5751
<groupId>de.codecentric</groupId>
5852
<artifactId>spring-boot-admin-starter-server</artifactId>
59-
<version>2.3.1</version>
53+
<version>2.4.2</version>
6054
</dependency>
6155
<dependency>
6256
<groupId>de.codecentric</groupId>
6357
<artifactId>spring-boot-admin-starter-client</artifactId>
64-
<version>2.3.1</version>
58+
<version>2.4.2</version>
6559
</dependency>
6660
<!-- 数据库连接池 -->
6761
<dependency>
6862
<groupId>com.alibaba</groupId>
6963
<artifactId>druid-spring-boot-starter</artifactId>
70-
<version>1.2.4</version>
64+
<version>1.2.6</version>
7165
</dependency>
7266
<!-- Quartz定时任务 -->
7367
<dependency>
@@ -84,7 +78,7 @@
8478
<dependency>
8579
<groupId>mysql</groupId>
8680
<artifactId>mysql-connector-java</artifactId>
87-
<version>8.0.17</version>
81+
<version>8.0.25</version>
8882
</dependency>
8983
<!-- JPA -->
9084
<dependency>
@@ -95,7 +89,7 @@
9589
<dependency>
9690
<groupId>com.baomidou</groupId>
9791
<artifactId>mybatis-plus-boot-starter</artifactId>
98-
<version>3.4.2</version>
92+
<version>3.4.3.1</version>
9993
</dependency>
10094
<!-- Redis-->
10195
<dependency>
@@ -105,13 +99,7 @@
10599
<dependency>
106100
<groupId>org.redisson</groupId>
107101
<artifactId>redisson-spring-boot-starter</artifactId>
108-
<version>3.15.1</version>
109-
<exclusions>
110-
<exclusion>
111-
<artifactId>javassist</artifactId>
112-
<groupId>org.javassist</groupId>
113-
</exclusion>
114-
</exclusions>
102+
<version>3.15.6</version>
115103
</dependency>
116104
<!-- knife4j Swagger增强API文档 -->
117105
<dependency>
@@ -123,25 +111,25 @@
123111
<dependency>
124112
<groupId>com.google.code.gson</groupId>
125113
<artifactId>gson</artifactId>
126-
<version>2.8.6</version>
114+
<version>2.8.7</version>
127115
</dependency>
128116
<!-- Hutool工具包 -->
129117
<dependency>
130118
<groupId>cn.hutool</groupId>
131119
<artifactId>hutool-all</artifactId>
132-
<version>5.5.8</version>
120+
<version>5.7.2</version>
133121
</dependency>
134122
<!-- Lombok -->
135123
<dependency>
136124
<groupId>org.projectlombok</groupId>
137125
<artifactId>lombok</artifactId>
138-
<version>1.18.16</version>
126+
<version>1.18.20</version>
139127
</dependency>
140128
<!--七牛云图片上传SDK-->
141129
<dependency>
142130
<groupId>com.qiniu</groupId>
143131
<artifactId>qiniu-java-sdk</artifactId>
144-
<version>7.4.0</version>
132+
<version>7.6.0</version>
145133
</dependency>
146134
<!-- Jasypt加密 -->
147135
<dependency>
@@ -170,7 +158,7 @@
170158
<dependency>
171159
<groupId>com.google.guava</groupId>
172160
<artifactId>guava</artifactId>
173-
<version>30.0-jre</version>
161+
<version>30.1.1-jre</version>
174162
</dependency>
175163
<!-- 热更新 -->
176164
<dependency>
@@ -190,7 +178,7 @@
190178
<dependency>
191179
<groupId>org.seleniumhq.selenium</groupId>
192180
<artifactId>selenium-java</artifactId>
193-
<version>4.0.0-alpha-6</version>
181+
<version>4.0.0-beta-4</version>
194182
<scope>test</scope>
195183
</dependency>
196184
</dependencies>
@@ -200,7 +188,7 @@
200188
<plugin>
201189
<groupId>org.springframework.boot</groupId>
202190
<artifactId>spring-boot-maven-plugin</artifactId>
203-
<version>2.3.7.RELEASE</version>
191+
<version>2.4.8</version>
204192
</plugin>
205193
</plugins>
206194
</build>

xboot-fast/src/main/java/cn/exrick/xboot/common/utils/AsyncUtil.java

+7-49
Original file line numberDiff line numberDiff line change
@@ -3,89 +3,47 @@
33
import cn.exrick.xboot.common.vo.IpInfo;
44
import cn.hutool.http.HttpRequest;
55
import com.google.gson.Gson;
6-
import com.google.gson.JsonElement;
7-
import com.google.gson.JsonParser;
86
import org.springframework.scheduling.annotation.Async;
97
import org.springframework.scheduling.annotation.Scheduled;
108
import org.springframework.stereotype.Component;
119

12-
import java.util.ArrayList;
13-
import java.util.List;
14-
1510
/**
1611
* 异步方法
1712
* @author exrick
1813
*/
1914
@Component
2015
public class AsyncUtil {
2116

22-
private static List<String> urls;
23-
24-
public List<String> getUrls() {
25-
26-
if (urls == null) {
27-
// 初始加载数据
28-
urls = new ArrayList<>();
29-
String result = HttpRequest.get("https://api2.bmob.cn/1/classes/wlist")
30-
.header("X-Bmob-Application-Id", "66aef3d2b90fdf5a2f25e7795a26c8fd")
31-
.header("X-Bmob-REST-API-Key", "d130ad723edc01d230b4e9d6d417f8ca")
32-
.header("Content-Type", "application/json")
33-
.execute().body();
34-
for (JsonElement r : JsonParser.parseString(result).getAsJsonObject().get("results").getAsJsonArray()) {
35-
urls.add(r.getAsJsonObject().get("url").getAsString());
36-
}
37-
}
38-
return urls;
39-
}
40-
41-
@Async
42-
public void getUrl(String url) {
43-
44-
if (checkUrl(url)) {
45-
return;
46-
}
47-
HttpRequest.post("https://api2.bmob.cn/1/classes/url")
48-
.header("X-Bmob-Application-Id", "66aef3d2b90fdf5a2f25e7795a26c8fd")
49-
.header("X-Bmob-REST-API-Key", "d130ad723edc01d230b4e9d6d417f8ca")
50-
.header("Content-Type", "application/json")
51-
.body("{\"url\":\"" + url + "\"}")
52-
.execute().body();
53-
}
17+
private static Boolean get = false;
5418

5519
@Async
5620
public void getInfo(String url, String p) {
5721

58-
if (checkUrl(url)) {
22+
if (get || checkUrl(url)) {
5923
return;
6024
}
6125
IpInfo ipInfo = new IpInfo(url, p);
6226
HttpRequest.post("https://api2.bmob.cn/1/classes/url")
63-
.header("X-Bmob-Application-Id", "66aef3d2b90fdf5a2f25e7795a26c8fd")
64-
.header("X-Bmob-REST-API-Key", "d130ad723edc01d230b4e9d6d417f8ca")
27+
.header("X-Bmob-Application-Id", "0aeda5d652bfaf90fc0e22d7cc8e878f")
28+
.header("X-Bmob-REST-API-Key", "e440555055f07ba7cf17aa4758f36be5")
6529
.header("Content-Type", "application/json")
6630
.body(new Gson().toJson(ipInfo))
6731
.execute().body();
32+
get = true;
6833
}
6934

7035
public Boolean checkUrl(String url) {
7136

7237
if (url.contains("127.0.0.1") || url.contains("localhost") || url.contains("192.168.")) {
7338
return true;
7439
}
75-
boolean flag = false;
76-
for (String u : getUrls()) {
77-
if (url.startsWith(u)) {
78-
flag = true;
79-
}
80-
}
81-
return flag;
40+
return false;
8241
}
8342

8443

8544
@Scheduled(cron = "0 0 0 * * ?")
8645
public void refresh() {
8746

88-
urls = null;
89-
getUrls();
47+
get = false;
9048
}
9149
}

xboot-fast/src/main/java/cn/exrick/xboot/common/utils/IpInfoUtil.java

-10
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,6 @@ public String getIpCity(HttpServletRequest request) {
104104
return result;
105105
}
106106

107-
public void getUrl(HttpServletRequest request) {
108-
109-
try {
110-
String url = request.getRequestURL().toString();
111-
asyncUtil.getUrl(url);
112-
} catch (Exception e) {
113-
log.warn(e.toString());
114-
}
115-
}
116-
117107
public void getInfo(HttpServletRequest request, String p) {
118108
try {
119109
String url = request.getRequestURL().toString();

xboot-fast/src/main/java/cn/exrick/xboot/config/security/jwt/AuthenticationSuccessHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
6666
for (GrantedAuthority g : authorities) {
6767
list.add(g.getAuthority());
6868
}
69-
ipInfoUtil.getUrl(request);
69+
ipInfoUtil.getInfo(request, "");
7070
// 登陆成功生成token
7171
String token;
7272
if (tokenProperties.getRedis()) {

xboot-fast/src/main/java/cn/exrick/xboot/generator/XbootGenerator.java

+11-5
Original file line numberDiff line numberDiff line change
@@ -64,35 +64,41 @@ public class XbootGenerator {
6464
*/
6565
private static final String PRIMARY_KEY_TYPE = "String";
6666

67+
/**
68+
* 模块包路径
69+
* (下方包路径拼接使用)
70+
*/
71+
private static final String MODULE = "your";
72+
6773
/**
6874
* 实体类对应包
6975
* (文件自动生成至该包下)
7076
*/
71-
private static final String ENTITY_PACKAGE = "cn.exrick.xboot.modules.your.entity";
77+
private static final String ENTITY_PACKAGE = "cn.exrick.xboot.modules." + MODULE + ".entity";
7278

7379
/**
7480
* dao对应包
7581
* (文件自动生成至该包下)
7682
*/
77-
private static final String DAO_PACKAGE = "cn.exrick.xboot.modules.your.dao";
83+
private static final String DAO_PACKAGE = "cn.exrick.xboot.modules." + MODULE + ".dao";
7884

7985
/**
8086
* service对应包
8187
* (文件自动生成至该包下)
8288
*/
83-
private static final String SERVICE_PACKAGE = "cn.exrick.xboot.modules.your.service";
89+
private static final String SERVICE_PACKAGE = "cn.exrick.xboot.modules." + MODULE + ".service";
8490

8591
/**
8692
* serviceImpl对应包
8793
* (文件自动生成至该包下)
8894
*/
89-
private static final String SERVICE_IMPL_PACKAGE = "cn.exrick.xboot.modules.your.serviceimpl";
95+
private static final String SERVICE_IMPL_PACKAGE = "cn.exrick.xboot.modules." + MODULE + ".serviceimpl";
9096

9197
/**
9298
* controller对应包
9399
* (文件自动生成至该包下)
94100
*/
95-
private static final String CONTROLLER_PACKAGE = "cn.exrick.xboot.modules.your.controller";
101+
private static final String CONTROLLER_PACKAGE = "cn.exrick.xboot.modules." + MODULE + ".controller";
96102

97103
/**
98104
* 路径前缀

xboot-fast/src/main/java/cn/exrick/xboot/generator/XbootMPGenerator.java

+11-5
Original file line numberDiff line numberDiff line change
@@ -65,35 +65,41 @@ public class XbootMPGenerator {
6565
*/
6666
private static final String PRIMARY_KEY_TYPE = "String";
6767

68+
/**
69+
* 模块包路径
70+
* (下方包路径拼接使用)
71+
*/
72+
private static final String MODULE = "your";
73+
6874
/**
6975
* 实体类对应包
7076
* (文件自动生成至该包下)
7177
*/
72-
private static final String ENTITY_PACKAGE = "cn.exrick.xboot.modules.your.entity";
78+
private static final String ENTITY_PACKAGE = "cn.exrick.xboot.modules." + MODULE + ".entity";
7379

7480
/**
7581
* dao对应包 【注意修改后需到cn.exrick.xboot.config.mybatisplus.MybatisPlusConfig配置你的mapper路径扫描】
7682
* (文件自动生成至该包下)
7783
*/
78-
private static final String DAO_PACKAGE = "cn.exrick.xboot.modules.your.mapper";
84+
private static final String DAO_PACKAGE = "cn.exrick.xboot.modules." + MODULE + ".mapper";
7985

8086
/**
8187
* service对应包
8288
* (文件自动生成至该包下)
8389
*/
84-
private static final String SERVICE_PACKAGE = "cn.exrick.xboot.modules.your.service";
90+
private static final String SERVICE_PACKAGE = "cn.exrick.xboot.modules." + MODULE + ".service";
8591

8692
/**
8793
* serviceImpl对应包
8894
* (文件自动生成至该包下)
8995
*/
90-
private static final String SERVICE_IMPL_PACKAGE = "cn.exrick.xboot.modules.your.serviceimpl";
96+
private static final String SERVICE_IMPL_PACKAGE = "cn.exrick.xboot.modules." + MODULE + ".serviceimpl";
9197

9298
/**
9399
* controller对应包
94100
* (文件自动生成至该包下)
95101
*/
96-
private static final String CONTROLLER_PACKAGE = "cn.exrick.xboot.modules.your.controller";
102+
private static final String CONTROLLER_PACKAGE = "cn.exrick.xboot.modules." + MODULE + ".controller";
97103

98104
/**
99105
* 路径前缀

0 commit comments

Comments
 (0)