クラスを追加します。このクラスは PageInterceptor クラスの初期化に使用されます。今回は試行が成功し、ページ化されたデータが正しく返されます。コードは以下のように表示されます。
インポート com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; インポート com.github.pagehelper.PageInterceptor; インポート org.springframework.context.annotation.Bean; インポート org.springframework.context.annotation.Configuration; インポート java.util .Properties; @Configuration public class MyBatisPlusConfig { /* * ページネーションプラグイン、データベースタイプを自動識別 * マルチテナント、公式サイトを参照【プラグイン拡張機能】 */ @Bean public PaginationInnerInterceptor paginationInterceptor() { return new PaginationInnerInterceptor(); } @Bean PageInterceptor pageInterceptor() { PageInterceptor pageInterceptor = new PageInterceptor(); プロパティproperties = new Properties(); property.setProperty("helperDialect", "mysql"); pageInterceptor.setProperties(properties); // ここにソース コードを入力でき、 return pageInterceptor; } }