Skip to content

Commit e33601c

Browse files
committed
格式化新提交的不规范代码
1 parent 2899978 commit e33601c

File tree

5 files changed

+175
-176
lines changed

5 files changed

+175
-176
lines changed

spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,44 @@
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

12-
<artifactId>wx-java-open-spring-boot-starter</artifactId>
13-
<name>WxJava - Spring Boot Starter for WxOpen</name>
14-
<description>微信开放平台开发的 Spring Boot Starter</description>
12+
<artifactId>wx-java-open-spring-boot-starter</artifactId>
13+
<name>WxJava - Spring Boot Starter for WxOpen</name>
14+
<description>微信开放平台开发的 Spring Boot Starter</description>
1515

16-
<dependencies>
16+
<dependencies>
17+
<dependency>
18+
<groupId>com.github.binarywang</groupId>
19+
<artifactId>weixin-java-open</artifactId>
20+
<version>${project.version}</version>
21+
</dependency>
22+
<dependency>
23+
<groupId>redis.clients</groupId>
24+
<artifactId>jedis</artifactId>
25+
<scope>compile</scope>
26+
</dependency>
27+
</dependencies>
1728

18-
<dependency>
19-
<groupId>com.github.binarywang</groupId>
20-
<artifactId>weixin-java-open</artifactId>
21-
<version>${project.version}</version>
22-
</dependency>
23-
<dependency>
24-
<groupId>redis.clients</groupId>
25-
<artifactId>jedis</artifactId>
26-
<scope>compile</scope>
27-
</dependency>
28-
</dependencies>
29-
30-
<build>
31-
<plugins>
32-
<plugin>
33-
<groupId>org.springframework.boot</groupId>
34-
<artifactId>spring-boot-maven-plugin</artifactId>
35-
<version>${spring.boot.version}</version>
36-
</plugin>
37-
<plugin>
38-
<groupId>org.apache.maven.plugins</groupId>
39-
<artifactId>maven-source-plugin</artifactId>
40-
<version>2.2.1</version>
41-
<executions>
42-
<execution>
43-
<id>attach-sources</id>
44-
<goals>
45-
<goal>jar-no-fork</goal>
46-
</goals>
47-
</execution>
48-
</executions>
49-
</plugin>
50-
</plugins>
51-
</build>
29+
<build>
30+
<plugins>
31+
<plugin>
32+
<groupId>org.springframework.boot</groupId>
33+
<artifactId>spring-boot-maven-plugin</artifactId>
34+
<version>${spring.boot.version}</version>
35+
</plugin>
36+
<plugin>
37+
<groupId>org.apache.maven.plugins</groupId>
38+
<artifactId>maven-source-plugin</artifactId>
39+
<version>2.2.1</version>
40+
<executions>
41+
<execution>
42+
<id>attach-sources</id>
43+
<goals>
44+
<goal>jar-no-fork</goal>
45+
</goals>
46+
</execution>
47+
</executions>
48+
</plugin>
49+
</plugins>
50+
</build>
5251

5352
</project>

spring-boot-starters/wx-java-open-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/config/WxOpenServiceAutoConfiguration.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@
1717
@Configuration
1818
public class WxOpenServiceAutoConfiguration {
1919

20-
@Bean
21-
@ConditionalOnMissingBean
22-
public WxOpenService wxOpenService(WxOpenConfigStorage configStorage) {
23-
WxOpenService wxOpenService = new WxOpenServiceImpl();
24-
wxOpenService.setWxOpenConfigStorage(configStorage);
25-
return wxOpenService;
26-
}
20+
@Bean
21+
@ConditionalOnMissingBean
22+
public WxOpenService wxOpenService(WxOpenConfigStorage configStorage) {
23+
WxOpenService wxOpenService = new WxOpenServiceImpl();
24+
wxOpenService.setWxOpenConfigStorage(configStorage);
25+
return wxOpenService;
26+
}
2727

28-
@Bean
29-
public WxOpenMessageRouter wxOpenMessageRouter(WxOpenService wxOpenService) {
30-
return new WxOpenMessageRouter(wxOpenService);
31-
}
28+
@Bean
29+
public WxOpenMessageRouter wxOpenMessageRouter(WxOpenService wxOpenService) {
30+
return new WxOpenMessageRouter(wxOpenService);
31+
}
3232

33-
@Bean
34-
public WxOpenComponentService wxOpenComponentService(WxOpenService wxOpenService) {
35-
return wxOpenService.getWxOpenComponentService();
36-
}
33+
@Bean
34+
public WxOpenComponentService wxOpenComponentService(WxOpenService wxOpenService) {
35+
return wxOpenService.getWxOpenComponentService();
36+
}
3737

3838

3939
}

spring-boot-starters/wx-java-open-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/config/WxOpenStorageAutoConfiguration.java

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -23,71 +23,71 @@
2323
@Configuration
2424
@RequiredArgsConstructor
2525
public class WxOpenStorageAutoConfiguration {
26-
private final WxOpenProperties properties;
26+
private final WxOpenProperties properties;
2727

28-
@Autowired(required = false)
29-
private JedisPool jedisPool;
28+
@Autowired(required = false)
29+
private JedisPool jedisPool;
3030

31-
@Value("${wx.open.config-storage.redis.host:}")
32-
private String redisHost;
31+
@Value("${wx.open.config-storage.redis.host:}")
32+
private String redisHost;
3333

34-
@Bean
35-
@ConditionalOnMissingBean(WxOpenConfigStorage.class)
36-
public WxOpenConfigStorage wxOpenConfigStorage() {
37-
WxOpenProperties.ConfigStorage storage = properties.getConfigStorage();
38-
WxOpenProperties.StorageType type = storage.getType();
34+
@Bean
35+
@ConditionalOnMissingBean(WxOpenConfigStorage.class)
36+
public WxOpenConfigStorage wxOpenConfigStorage() {
37+
WxOpenProperties.ConfigStorage storage = properties.getConfigStorage();
38+
WxOpenProperties.StorageType type = storage.getType();
3939

40-
if (type == WxOpenProperties.StorageType.redis) {
41-
return getWxOpenInRedisConfigStorage();
42-
}
43-
return getWxOpenInMemoryConfigStorage();
40+
if (type == WxOpenProperties.StorageType.redis) {
41+
return getWxOpenInRedisConfigStorage();
4442
}
43+
return getWxOpenInMemoryConfigStorage();
44+
}
4545

46-
private WxOpenInMemoryConfigStorage getWxOpenInMemoryConfigStorage() {
47-
WxOpenInMemoryConfigStorage config = new WxOpenInMemoryConfigStorage();
48-
setWxOpenInfo(config);
49-
return config;
50-
}
51-
52-
private WxOpenInRedisConfigStorage getWxOpenInRedisConfigStorage() {
53-
JedisPool poolToUse = jedisPool;
54-
if (jedisPool == null || StringUtils.isNotEmpty(redisHost)) {
55-
poolToUse = getJedisPool();
56-
}
57-
WxOpenInRedisConfigStorage config = new WxOpenInRedisConfigStorage(poolToUse);
58-
setWxOpenInfo(config);
59-
return config;
60-
}
46+
private WxOpenInMemoryConfigStorage getWxOpenInMemoryConfigStorage() {
47+
WxOpenInMemoryConfigStorage config = new WxOpenInMemoryConfigStorage();
48+
setWxOpenInfo(config);
49+
return config;
50+
}
6151

62-
private void setWxOpenInfo(WxOpenConfigStorage config) {
63-
config.setComponentAppId(properties.getAppId());
64-
config.setComponentAppSecret(properties.getSecret());
65-
config.setComponentToken(properties.getToken());
66-
config.setComponentAesKey(properties.getAesKey());
52+
private WxOpenInRedisConfigStorage getWxOpenInRedisConfigStorage() {
53+
JedisPool poolToUse = jedisPool;
54+
if (jedisPool == null || StringUtils.isNotEmpty(redisHost)) {
55+
poolToUse = getJedisPool();
6756
}
57+
WxOpenInRedisConfigStorage config = new WxOpenInRedisConfigStorage(poolToUse);
58+
setWxOpenInfo(config);
59+
return config;
60+
}
6861

69-
private JedisPool getJedisPool() {
70-
WxOpenProperties.ConfigStorage storage = properties.getConfigStorage();
71-
RedisProperties redis = storage.getRedis();
62+
private void setWxOpenInfo(WxOpenConfigStorage config) {
63+
config.setComponentAppId(properties.getAppId());
64+
config.setComponentAppSecret(properties.getSecret());
65+
config.setComponentToken(properties.getToken());
66+
config.setComponentAesKey(properties.getAesKey());
67+
}
7268

73-
JedisPoolConfig config = new JedisPoolConfig();
74-
if (redis.getMaxActive() != null) {
75-
config.setMaxTotal(redis.getMaxActive());
76-
}
77-
if (redis.getMaxIdle() != null) {
78-
config.setMaxIdle(redis.getMaxIdle());
79-
}
80-
if (redis.getMaxWaitMillis() != null) {
81-
config.setMaxWaitMillis(redis.getMaxWaitMillis());
82-
}
83-
if (redis.getMinIdle() != null) {
84-
config.setMinIdle(redis.getMinIdle());
85-
}
86-
config.setTestOnBorrow(true);
87-
config.setTestWhileIdle(true);
69+
private JedisPool getJedisPool() {
70+
WxOpenProperties.ConfigStorage storage = properties.getConfigStorage();
71+
RedisProperties redis = storage.getRedis();
8872

89-
JedisPool pool = new JedisPool(config, redis.getHost(), redis.getPort(),
90-
redis.getTimeout(), redis.getPassword(), redis.getDatabase());
91-
return pool;
73+
JedisPoolConfig config = new JedisPoolConfig();
74+
if (redis.getMaxActive() != null) {
75+
config.setMaxTotal(redis.getMaxActive());
76+
}
77+
if (redis.getMaxIdle() != null) {
78+
config.setMaxIdle(redis.getMaxIdle());
9279
}
80+
if (redis.getMaxWaitMillis() != null) {
81+
config.setMaxWaitMillis(redis.getMaxWaitMillis());
82+
}
83+
if (redis.getMinIdle() != null) {
84+
config.setMinIdle(redis.getMinIdle());
85+
}
86+
config.setTestOnBorrow(true);
87+
config.setTestWhileIdle(true);
88+
89+
JedisPool pool = new JedisPool(config, redis.getHost(), redis.getPort(),
90+
redis.getTimeout(), redis.getPassword(), redis.getDatabase());
91+
return pool;
92+
}
9393
}

spring-boot-starters/wx-java-open-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/properties/RedisProperties.java

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,35 @@
1111
*/
1212
@Data
1313
public class RedisProperties implements Serializable {
14-
private static final long serialVersionUID = -5924815351660074401L;
15-
16-
/**
17-
* 主机地址.
18-
*/
19-
private String host = "127.0.0.1";
20-
21-
/**
22-
* 端口号.
23-
*/
24-
private int port = 6379;
25-
26-
/**
27-
* 密码.
28-
*/
29-
private String password;
30-
31-
/**
32-
* 超时.
33-
*/
34-
private int timeout = 2000;
35-
36-
/**
37-
* 数据库.
38-
*/
39-
private int database = 0;
40-
41-
private Integer maxActive;
42-
private Integer maxIdle;
43-
private Integer maxWaitMillis;
44-
private Integer minIdle;
14+
private static final long serialVersionUID = -5924815351660074401L;
15+
16+
/**
17+
* 主机地址.
18+
*/
19+
private String host = "127.0.0.1";
20+
21+
/**
22+
* 端口号.
23+
*/
24+
private int port = 6379;
25+
26+
/**
27+
* 密码.
28+
*/
29+
private String password;
30+
31+
/**
32+
* 超时.
33+
*/
34+
private int timeout = 2000;
35+
36+
/**
37+
* 数据库.
38+
*/
39+
private int database = 0;
40+
41+
private Integer maxActive;
42+
private Integer maxIdle;
43+
private Integer maxWaitMillis;
44+
private Integer minIdle;
4545
}

0 commit comments

Comments
 (0)