fix:分页查询

上级 8b7bc713
2023-07-15 12:46:06 [restartedMain] INFO c.k.s.SpringBootKwanApplication - Starting SpringBootKwanApplication using Java 1.8.0_321 on qinyingjiedeMacBook-Pro.local with PID 28497 (/Users/qinyingjie/Documents/idea-workspace/SpringBoot-kwan/target/classes started by qinyingjie in /Users/qinyingjie/Documents/idea-workspace/SpringBoot-kwan)
2023-07-15 12:46:06 [restartedMain] INFO c.k.s.SpringBootKwanApplication - No active profile set, falling back to 1 default profile: "default"
2023-07-15 12:46:06 [background-preinit] INFO o.h.validator.internal.util.Version - HV000001: Hibernate Validator 6.2.3.Final
2023-07-15 12:46:06 [restartedMain] INFO o.s.b.d.e.DevToolsPropertyDefaultsPostProcessor - Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2023-07-15 12:46:06 [restartedMain] INFO o.s.b.d.e.DevToolsPropertyDefaultsPostProcessor - For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2023-07-15 12:46:07 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode!
2023-07-15 12:46:07 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2023-07-15 12:46:07 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 34 ms. Found 0 Redis repository interfaces.
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'io.seata.spring.boot.autoconfigure.SeataAutoConfiguration$SeataDataSourceConfiguration' of type [io.seata.spring.boot.autoconfigure.SeataAutoConfiguration$SeataDataSourceConfiguration$$EnhancerBySpringCGLIB$$6c31cc4d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'spring.cloud.alibaba.seata-io.seata.spring.boot.autoconfigure.properties.SpringCloudAlibabaConfiguration' of type [io.seata.spring.boot.autoconfigure.properties.SpringCloudAlibabaConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'seata-io.seata.spring.boot.autoconfigure.properties.SeataProperties' of type [io.seata.spring.boot.autoconfigure.properties.SeataProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'io.seata.spring.boot.autoconfigure.SeataAutoConfiguration' of type [io.seata.spring.boot.autoconfigure.SeataAutoConfiguration$$EnhancerBySpringCGLIB$$7677ac82] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'springApplicationContextProvider' of type [io.seata.spring.boot.autoconfigure.provider.SpringApplicationContextProvider] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'failureHandler' of type [io.seata.tm.api.DefaultFailureHandlerImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO i.s.s.b.a.SeataAutoConfiguration - Automatically configure Seata
2023-07-15 12:46:08 [restartedMain] INFO io.seata.config.FileConfiguration - The file name of the operation is registry
2023-07-15 12:46:08 [restartedMain] INFO io.seata.config.ConfigurationFactory - load Configuration:FileConfiguration$$EnhancerByCGLIB$$862af1eb
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'configProperties' of type [io.seata.spring.boot.autoconfigure.properties.config.ConfigProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'configFileProperties' of type [io.seata.spring.boot.autoconfigure.properties.config.ConfigFileProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO io.seata.config.FileConfiguration - The file name of the operation is file.conf
2023-07-15 12:46:08 [restartedMain] INFO io.seata.config.ConfigurationFactory - load Configuration:FileConfiguration$$EnhancerByCGLIB$$862af1eb
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'serviceProperties' of type [io.seata.spring.boot.autoconfigure.properties.client.ServiceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO i.s.s.a.GlobalTransactionScanner - Initializing Global Transaction Clients ...
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'threadFactoryProperties' of type [io.seata.spring.boot.autoconfigure.properties.client.ThreadFactoryProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'transportProperties' of type [io.seata.spring.boot.autoconfigure.properties.client.TransportProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO i.s.c.rpc.netty.NettyClientBootstrap - NettyClientBootstrap has started
2023-07-15 12:46:08 [restartedMain] INFO i.s.s.a.GlobalTransactionScanner - Transaction Manager Client is initialized. applicationId[spring-boot-name] txServiceGroup[default_tx_group]
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'rmProperties' of type [io.seata.spring.boot.autoconfigure.properties.client.RmProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO io.seata.rm.datasource.AsyncWorker - Async Commit Buffer Limit: 10000
2023-07-15 12:46:08 [restartedMain] INFO i.s.r.d.xa.ResourceManagerXA - ResourceManagerXA init ...
2023-07-15 12:46:08 [restartedMain] INFO i.s.c.rpc.netty.NettyClientBootstrap - NettyClientBootstrap has started
2023-07-15 12:46:08 [restartedMain] INFO i.s.s.a.GlobalTransactionScanner - Resource Manager is initialized. applicationId[spring-boot-name] txServiceGroup[default_tx_group]
2023-07-15 12:46:08 [restartedMain] INFO i.s.s.a.GlobalTransactionScanner - Global Transaction Clients are initialized.
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'spring.datasource.dynamic-com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties' of type [com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration' of type [com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration$$EnhancerBySpringCGLIB$$164c1ef7] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'dsProcessor' of type [com.baomidou.dynamic.datasource.processor.DsHeaderProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:09 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8888 (http)
2023-07-15 12:46:09 [restartedMain] INFO o.a.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8888"]
2023-07-15 12:46:09 [restartedMain] INFO o.a.catalina.core.StandardService - Starting service [Tomcat]
2023-07-15 12:46:09 [restartedMain] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.60]
2023-07-15 12:46:09 [restartedMain] INFO o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2023-07-15 12:46:09 [restartedMain] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 3067 ms
2023-07-15 12:46:10 [restartedMain] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource detect ALIBABA SEATA and enabled it
2023-07-15 12:46:10 [restartedMain] INFO c.alibaba.druid.pool.DruidDataSource - {dataSource-1,kwan-ds} inited
2023-07-15 12:46:10 [restartedMain] ERROR i.s.c.r.n.NettyClientChannelManager - can not get cluster name in registry config 'service.vgroupMapping.default_tx_group', please make sure registry config correct
2023-07-15 12:46:10 [restartedMain] INFO c.alibaba.druid.pool.DruidDataSource - {dataSource-2,ali-ds} inited
2023-07-15 12:46:10 [restartedMain] ERROR i.s.c.r.n.NettyClientChannelManager - can not get cluster name in registry config 'service.vgroupMapping.default_tx_group', please make sure registry config correct
2023-07-15 12:46:10 [restartedMain] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource - add a datasource named [kwan-ds] success
2023-07-15 12:46:10 [restartedMain] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource - add a datasource named [ali-ds] success
2023-07-15 12:46:10 [restartedMain] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource initial loaded [2] datasource,primary datasource named [kwan-ds]
2023-07-15 12:46:10 [restartedMain] INFO i.s.s.a.d.SeataAutoDataSourceProxyCreator - Auto proxy of [dataSource]
2023-07-15 12:46:10 [restartedMain] ERROR i.s.c.r.n.NettyClientChannelManager - can not get cluster name in registry config 'service.vgroupMapping.default_tx_group', please make sure registry config correct
2023-07-15 12:46:11 [restartedMain] INFO c.k.s.config.RedisConfig - ==================自定义的redisTemplate实例化了===================
2023-07-15 12:46:11 [restartedMain] INFO i.s.s.a.GlobalTransactionScanner - Bean[com.kwan.springbootkwan.service.impl.UserServiceImpl$$EnhancerBySpringCGLIB$$80a9d5be] with name [userServiceImpl] would use interceptor [io.seata.spring.annotation.GlobalTransactionalInterceptor]
2023-07-15 12:46:12 [restartedMain] INFO o.s.b.d.a.OptionalLiveReloadServer - LiveReload server is running on port 35729
2023-07-15 12:46:13 [restartedMain] INFO o.s.b.c.r.s.JobRepositoryFactoryBean - No database type set, using meta data indicating: MYSQL
2023-07-15 12:46:13 [restartedMain] INFO o.s.b.c.l.support.SimpleJobLauncher - No TaskExecutor has been set, defaulting to synchronous executor.
2023-07-15 12:46:14 [restartedMain] INFO o.a.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8888"]
2023-07-15 12:46:14 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8888 (http) with context path ''
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.p.DocumentationPluginsBootstrapper - Context refreshed
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.p.DocumentationPluginsBootstrapper - Found 1 custom documentation plugin(s)
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.s.ApiListingReferenceScanner - Scanning for api listing references
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.r.o.CachingOperationNameGenerator - Generating unique operation named: selectAllUsingGET_1
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.r.o.CachingOperationNameGenerator - Generating unique operation named: selectOneUsingGET_1
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.r.o.CachingOperationNameGenerator - Generating unique operation named: deleteUsingDELETE_1
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.r.o.CachingOperationNameGenerator - Generating unique operation named: insertUsingPOST_1
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.r.o.CachingOperationNameGenerator - Generating unique operation named: selectAllUsingGET_2
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.r.o.CachingOperationNameGenerator - Generating unique operation named: selectOneUsingGET_2
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.r.o.CachingOperationNameGenerator - Generating unique operation named: updateUsingPUT_1
2023-07-15 12:46:14 [restartedMain] INFO c.k.s.SpringBootKwanApplication - Started SpringBootKwanApplication in 8.976 seconds (JVM running for 11.581)
此差异已折叠。
......@@ -63,16 +63,16 @@ public class ChatbotController {
public Result selectAll(@RequestParam Integer page
, @RequestParam Integer pageSize
, @RequestParam String question) {
Page<Chatbot> page1 = new Page<>();
page1.setCurrent(page);
page1.setSize(pageSize);
Page<Chatbot> pageParm = new Page<>();
pageParm.setCurrent(page);
pageParm.setSize(pageSize);
QueryWrapper<Chatbot> wrapper = new QueryWrapper<>();
wrapper.orderByDesc("id"); // 按照 id 字段降序排列
wrapper.eq("is_delete", 0); // 按照 id 字段降序排列
if (StringUtils.isNotEmpty(question)) {
wrapper.like("question", question);
}
return Result.ok(this.chatbotService.page(page1, wrapper));
return Result.ok(this.chatbotService.page(pageParm, wrapper));
}
/**
......
......@@ -40,6 +40,23 @@ public class PicInfoController {
return Result.ok(this.picInfoService.list());
}
/**
* 分页查询所有数据
*
* @return 所有数据
*/
@GetMapping("/page")
public Result selectAll(@RequestParam Integer page, @RequestParam Integer pageSize) {
Page<PicInfo> pageParm = new Page<>();
pageParm.setCurrent(page);
pageParm.setSize(pageSize);
QueryWrapper<PicInfo> wrapper = new QueryWrapper<>();
wrapper.orderByDesc("id"); // 按照 id 字段降序排列
wrapper.eq("is_delete", 0); // 按照 id 字段降序排列
return Result.ok(this.picInfoService.page(pageParm, wrapper));
}
/**
* 分页查询所有数据
*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册