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