ApplicationContext applicationContext = ContextLoader.getCurrentWebApplicationContext();
applicationContext.getBean(Service.class);
// 这个是在 WebMvcConfigrer 中
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(mybatisPlugin());
}
@Bean
public MybatisPlugin mybatisPlugin() {
return new MybatisPlugin();
}