SpringBoot+MyBaitsPlus+Lombok 的初次尝试
前言
跟着B站【实战】基于SpringBoot+Vue开发的前后端分离博客项目完整教学(MarkerHub)
学会了用MyBaitsPlus的代码生成器,但是在进行测试的时候出现了错误,原来是因为没有进行MyBatisPlus的配置,具体如下:
代码如下:
@Configuration
@EnableTransactionManagement
@MapperScan("com.lin.mapper")
public class MybatisPlusConfig {
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
return paginationInterceptor;
}
}