Compare commits
No commits in common. "42b6c95ac2c69e0cd654dcde3c2aab4b1942408d" and "95ca20b2a04f30184dd77c85239147fef967fc81" have entirely different histories.
42b6c95ac2
...
95ca20b2a0
@ -1,18 +0,0 @@
|
|||||||
package net.rzdata.demo.config;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.ToString;
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 全局配置
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
@ConfigurationProperties(prefix = "demo")
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@ToString
|
|
||||||
public class DemoConfig {
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
package net.rzdata.demo.config;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
public class MybatisPlusConfig {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加插件
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
|
||||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
|
||||||
// 分页插件
|
|
||||||
interceptor.addInnerInterceptor(paginationInnerInterceptor());
|
|
||||||
return interceptor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PaginationInnerInterceptor paginationInnerInterceptor() {
|
|
||||||
return new PaginationInnerInterceptor();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
package net.rzdata.demo.trait;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@ToString
|
|
||||||
public class GetReq<T> {
|
|
||||||
|
|
||||||
private Integer pageSize = 15;
|
|
||||||
private Integer pageNum = 1;
|
|
||||||
private String orderBy;
|
|
||||||
private Boolean asc = true;
|
|
||||||
|
|
||||||
public IPage<T> into() {
|
|
||||||
Page<T> page = new Page<>();
|
|
||||||
page.setSize(pageSize);
|
|
||||||
page.setCurrent(pageNum);
|
|
||||||
if (orderBy != null) {
|
|
||||||
page.addOrder(this.asc ? OrderItem.asc(orderBy) : OrderItem.desc(orderBy));
|
|
||||||
}
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +1 @@
|
|||||||
net.rzdata.demo.exception.GlobalExceptionHandler
|
net.rzdata.demo.exception.GlobalExceptionHandler
|
||||||
net.rzdata.demo.config.DemoConfig
|
|
||||||
net.rzdata.demo.config.MybatisPlusConfig
|
|
||||||
|
@ -54,10 +54,6 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springdoc</groupId>
|
|
||||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mysql</groupId>
|
<groupId>com.mysql</groupId>
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
@ -19,11 +19,3 @@ spring:
|
|||||||
maximum-pool-size: 20
|
maximum-pool-size: 20
|
||||||
idle-timeout: 30000
|
idle-timeout: 30000
|
||||||
max-lifetime: 1800000
|
max-lifetime: 1800000
|
||||||
mybatis-plus:
|
|
||||||
configuration:
|
|
||||||
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
|
|
||||||
logging:
|
|
||||||
level:
|
|
||||||
root: info
|
|
||||||
net.rzdata: debug
|
|
||||||
com.baomidou.example.mapper: debug
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user