提交 143b5cb1 编写于 作者: W weixin_43814374

Mon Aug 28 15:07:00 CST 2023 inscode

上级 276e418a
env: "开发环境"
\ No newline at end of file
env: "生产环境"
\ No newline at end of file
env: "验收环境"
\ No newline at end of file
server:
port: 8081
servlet:
context-path: /springboot-template
spring:
# swagger配置
mvc:
pathmatch:
matching-strategy: ant_path_matcher
profiles:
active: dev
\ No newline at end of file
package com.template.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
// 注意启动该配置项需要在pom中取消mybatisplusdruid等依赖的注释,同时必须配置数据源否则启动报错
// @Configuration
// @MapperScan(basePackages = "com.template.*.mapper")
public class MybatisPlusConfig {
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor(){
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册