forked from rzdata/demo-empty
Compare commits
5 Commits
59e430eacb
...
d09638dd96
Author | SHA1 | Date | |
---|---|---|---|
d09638dd96 | |||
74d7283679 | |||
8d8d1386a5 | |||
b8953ee3d3 | |||
83d52fdc37 |
18
common/src/main/java/net/rzdata/demo/config/DemoConfig.java
Normal file
18
common/src/main/java/net/rzdata/demo/config/DemoConfig.java
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
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 {
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
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 +1,3 @@
|
|||||||
net.rzdata.demo.exception.GlobalExceptionHandler
|
net.rzdata.demo.exception.GlobalExceptionHandler
|
||||||
|
net.rzdata.demo.config.DemoConfig
|
||||||
|
net.rzdata.demo.config.MybatisPlusConfig
|
||||||
|
@ -54,6 +54,10 @@
|
|||||||
<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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user