修复分页的包版本以及redis的配置,部署时,配置文件可以放外面,便于测试修改

This commit is contained in:
zxh_gs_lenovo 2026-02-04 13:52:44 +08:00
parent a401b05ad8
commit 883963dbe6
4 changed files with 50 additions and 45 deletions

70
pom.xml
View File

@ -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 核心依赖 -->

View File

@ -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);
}

View File

@ -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;

View File

@ -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: