Skip to content

Commit 063fbb7

Browse files
authored
🎨 升级部分依赖版本,优化代码,部分代码增加泛型参数
1 parent a7b007f commit 063fbb7

File tree

263 files changed

+559
-607
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+559
-607
lines changed

pom.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,17 +196,19 @@
196196
<dependency>
197197
<groupId>com.google.guava</groupId>
198198
<artifactId>guava</artifactId>
199-
<version>32.1.2-jre</version>
199+
<version>33.3.1-jre</version>
200200
</dependency>
201201
<dependency>
202202
<groupId>com.google.code.gson</groupId>
203203
<artifactId>gson</artifactId>
204-
<version>2.10.1</version>
204+
<version>2.13.1</version>
205205
</dependency>
206206
<dependency>
207-
<groupId>com.fasterxml.jackson.dataformat</groupId>
208-
<artifactId>jackson-dataformat-xml</artifactId>
209-
<version>2.15.2</version>
207+
<groupId>com.fasterxml.jackson</groupId>
208+
<artifactId>jackson-bom</artifactId>
209+
<version>2.18.1</version>
210+
<type>pom</type>
211+
<scope>import</scope>
210212
</dependency>
211213

212214
<!-- 测试所用依赖 -->

solon-plugins/wx-java-qidian-solon-plugin/src/main/java/com/binarywang/solon/wxjava/qidian/config/WxQidianStorageAutoConfiguration.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
import org.noear.solon.annotation.Configuration;
1919
import org.noear.solon.annotation.Inject;
2020
import org.noear.solon.core.AppContext;
21+
import redis.clients.jedis.Jedis;
2122
import redis.clients.jedis.JedisPool;
2223
import redis.clients.jedis.JedisPoolConfig;
2324
import redis.clients.jedis.JedisSentinelPool;
2425
import redis.clients.jedis.util.Pool;
2526

27+
import java.time.Duration;
2628
import java.util.Set;
2729

2830
/**
@@ -75,7 +77,7 @@ private WxQidianConfigStorage defaultConfigStorage() {
7577
}
7678

7779
private WxQidianConfigStorage jedisConfigStorage() {
78-
Pool jedisPool;
80+
Pool<Jedis> jedisPool;
7981
if (StringUtils.isNotEmpty(redisHost) || StringUtils.isNotEmpty(redisHost2)) {
8082
jedisPool = getJedisPool();
8183
} else {
@@ -104,7 +106,7 @@ private void setWxMpInfo(WxQidianDefaultConfigImpl config) {
104106
}
105107
}
106108

107-
private Pool getJedisPool() {
109+
private Pool<Jedis> getJedisPool() {
108110
WxQidianProperties.ConfigStorage storage = wxQidianProperties.getConfigStorage();
109111
RedisProperties redis = storage.getRedis();
110112

@@ -116,7 +118,7 @@ private Pool getJedisPool() {
116118
config.setMaxIdle(redis.getMaxIdle());
117119
}
118120
if (redis.getMaxWaitMillis() != null) {
119-
config.setMaxWaitMillis(redis.getMaxWaitMillis());
121+
config.setMaxWait(Duration.ofMillis(redis.getMaxWaitMillis()));
120122
}
121123
if (redis.getMinIdle() != null) {
122124
config.setMinIdle(redis.getMinIdle());

spring-boot-starters/wx-java-qidian-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/qidian/config/WxQidianStorageAutoConfiguration.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.springframework.context.annotation.Bean;
2121
import org.springframework.context.annotation.Configuration;
2222
import org.springframework.data.redis.core.StringRedisTemplate;
23+
import redis.clients.jedis.Jedis;
2324
import redis.clients.jedis.JedisPool;
2425
import redis.clients.jedis.JedisPoolConfig;
2526
import redis.clients.jedis.JedisSentinelPool;
@@ -80,7 +81,7 @@ private WxQidianConfigStorage defaultConfigStorage() {
8081
}
8182

8283
private WxQidianConfigStorage jedisConfigStorage() {
83-
Pool jedisPool;
84+
Pool<Jedis> jedisPool;
8485
if (StringUtils.isNotEmpty(redisHost) || StringUtils.isNotEmpty(redisHost2)) {
8586
jedisPool = getJedisPool();
8687
} else {
@@ -136,7 +137,7 @@ private void setWxMpInfo(WxQidianDefaultConfigImpl config) {
136137
}
137138
}
138139

139-
private Pool getJedisPool() {
140+
private Pool<Jedis> getJedisPool() {
140141
WxQidianProperties.ConfigStorage storage = wxQidianProperties.getConfigStorage();
141142
RedisProperties redis = storage.getRedis();
142143

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,5 @@ public interface BaseWxChannelService extends WxService {
131131
*
132132
* @return . request http
133133
*/
134-
RequestHttp getRequestHttp();
134+
RequestHttp<?, ?> getRequestHttp();
135135
}

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelServiceImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public abstract class BaseWxChannelServiceImpl<H, P> implements WxChannelService
6666
private int maxRetryTimes = 5;
6767

6868
@Override
69-
public RequestHttp getRequestHttp() {
69+
public RequestHttp<H, P> getRequestHttp() {
7070
return this;
7171
}
7272

@@ -75,7 +75,7 @@ public boolean checkSignature(String timestamp, String nonce, String signature)
7575
try {
7676
return SHA1.gen(this.getConfig().getToken(), timestamp, nonce).equals(signature);
7777
} catch (Exception e) {
78-
log.error("Checking signature failed, and the reason is :" + e.getMessage());
78+
log.error("Checking signature failed, and the reason is :{}", e.getMessage());
7979
return false;
8080
}
8181
}
@@ -276,7 +276,7 @@ protected <T, E> T executeInternal(RequestExecutor<T, E> executor, String uri, E
276276
* @throws WxErrorException 异常
277277
*/
278278
protected String extractAccessToken(String resultContent) throws WxErrorException {
279-
log.debug("access-token response: " + resultContent);
279+
log.debug("access-token response: {}", resultContent);
280280
WxChannelConfig config = this.getConfig();
281281
WxError error = WxError.fromJson(resultContent, WxType.Channel);
282282
if (error.getErrorCode() != 0) {

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxAssistantServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
public class WxAssistantServiceImpl implements WxAssistantService {
2929

3030
/** 微信商店服务 */
31-
private final BaseWxChannelServiceImpl shopService;
31+
private final BaseWxChannelServiceImpl<?, ?> shopService;
3232
@Override
3333
public WxChannelBaseResponse addWindowProduct(AddWindowProductRequest req) throws WxErrorException {
3434
String resJson = shopService.post(ADD_WINDOW_PRODUCT_URL, "{}");

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelAddressServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
public class WxChannelAddressServiceImpl implements WxChannelAddressService {
3030

3131
/** 微信商店服务 */
32-
private final BaseWxChannelServiceImpl shopService;
32+
private final BaseWxChannelServiceImpl<?, ?> shopService;
3333

34-
public WxChannelAddressServiceImpl(BaseWxChannelServiceImpl shopService) {
34+
public WxChannelAddressServiceImpl(BaseWxChannelServiceImpl<?, ?> shopService) {
3535
this.shopService = shopService;
3636
}
3737

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelAfterSaleServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
public class WxChannelAfterSaleServiceImpl implements WxChannelAfterSaleService {
2424

2525
/** 微信商店服务 */
26-
private final BaseWxChannelServiceImpl shopService;
26+
private final BaseWxChannelServiceImpl<?, ?> shopService;
2727

28-
public WxChannelAfterSaleServiceImpl(BaseWxChannelServiceImpl shopService) {
28+
public WxChannelAfterSaleServiceImpl(BaseWxChannelServiceImpl<?, ?> shopService) {
2929
this.shopService = shopService;
3030
}
3131

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelBasicServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
public class WxChannelBasicServiceImpl implements WxChannelBasicService {
3232

3333
/** 微信商店服务 */
34-
private final BaseWxChannelServiceImpl shopService;
34+
private final BaseWxChannelServiceImpl<?, ?> shopService;
3535

36-
public WxChannelBasicServiceImpl(BaseWxChannelServiceImpl shopService) {
36+
public WxChannelBasicServiceImpl(BaseWxChannelServiceImpl<?, ?> shopService) {
3737
this.shopService = shopService;
3838
}
3939

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelBrandServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
public class WxChannelBrandServiceImpl implements WxChannelBrandService {
3434

3535
/** 微信商店服务 */
36-
private final BaseWxChannelServiceImpl shopService;
36+
private final BaseWxChannelServiceImpl<?, ?> shopService;
3737

38-
public WxChannelBrandServiceImpl(BaseWxChannelServiceImpl shopService) {
38+
public WxChannelBrandServiceImpl(BaseWxChannelServiceImpl<?, ?> shopService) {
3939
this.shopService = shopService;
4040
}
4141

0 commit comments

Comments
 (0)