修复分页的包版本以及redis的配置,部署时,配置文件可以放外面,便于测试修改
This commit is contained in:
parent
a401b05ad8
commit
883963dbe6
70
pom.xml
70
pom.xml
|
|
@ -164,41 +164,41 @@
|
|||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>1.4.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis.spring</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>log4j-slf4j-impl</groupId>
|
||||
<artifactId>org.apache.logging.log4j</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>log4j-over-slf4j</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
<version>2.1.0</version>
|
||||
<!-- <exclusions>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <groupId>org.mybatis</groupId>-->
|
||||
<!-- <artifactId>mybatis</artifactId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <groupId>org.mybatis</groupId>-->
|
||||
<!-- <artifactId>mybatis.spring</artifactId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <groupId>log4j-slf4j-impl</groupId>-->
|
||||
<!-- <artifactId>org.apache.logging.log4j</artifactId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <groupId>org.slf4j</groupId>-->
|
||||
<!-- <artifactId>slf4j-api</artifactId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <groupId>ch.qos.logback</groupId>-->
|
||||
<!-- <artifactId>logback-classic</artifactId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <groupId>org.slf4j</groupId>-->
|
||||
<!-- <artifactId>log4j-over-slf4j</artifactId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <groupId>org.slf4j</groupId>-->
|
||||
<!-- <artifactId>jul-to-slf4j</artifactId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-logging</artifactId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- </exclusions>-->
|
||||
</dependency>
|
||||
|
||||
<!-- Sa-Token 核心依赖 -->
|
||||
|
|
|
|||
|
|
@ -16,16 +16,16 @@ import org.springframework.context.annotation.Configuration;
|
|||
@Configuration
|
||||
public class RedissonConfig {
|
||||
|
||||
@Value("${common.redis.host}")
|
||||
@Value("${spring.redis.host}")
|
||||
private String host;
|
||||
|
||||
@Value("${common.redis.port}")
|
||||
@Value("${spring.redis.port}")
|
||||
private int port;
|
||||
|
||||
@Value("${common.redis.password}")
|
||||
@Value("${spring.redis.password}")
|
||||
private String password;
|
||||
|
||||
@Value("${common.redis.database}")
|
||||
@Value("${spring.redis.database}")
|
||||
private int database;
|
||||
|
||||
@Bean(destroyMethod = "shutdown")
|
||||
|
|
@ -35,12 +35,16 @@ public class RedissonConfig {
|
|||
// 单节点模式
|
||||
config.useSingleServer()
|
||||
.setAddress("redis://" + host + ":" + port)
|
||||
.setPassword(password)
|
||||
//.setPassword(password)
|
||||
.setDatabase(database)
|
||||
.setConnectionMinimumIdleSize(5)
|
||||
.setConnectionPoolSize(20)
|
||||
.setTimeout(10000);
|
||||
|
||||
|
||||
// 处理密码:如果有密码则设置,否则不设置
|
||||
if (password != null && !password.isEmpty()) {
|
||||
config.useSingleServer().setPassword(password);
|
||||
}
|
||||
return Redisson.create(config);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.kexue.skills.service.impl;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.kexue.skills.entity.CmsContent;
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ spring:
|
|||
maximum-pool-size: 30
|
||||
# Redis配置,引用公共配置
|
||||
redis:
|
||||
host: ${common.redis.host}
|
||||
port: ${common.redis.port}
|
||||
password: ${common.redis.password}
|
||||
database: ${common.redis.database}
|
||||
host: 192.168.153.100
|
||||
port: 6379
|
||||
password:
|
||||
database: 1
|
||||
timeout: 10000
|
||||
lettuce:
|
||||
pool:
|
||||
|
|
|
|||
Loading…
Reference in New Issue