feat:分页查询

This commit is contained in:
xiang
2025-09-23 22:41:27 +08:00
parent 8d31023505
commit 33c7e5fc5a
3 changed files with 13 additions and 1 deletions

View File

@@ -82,6 +82,11 @@
<artifactId>xservice-message-starter</artifactId> <artifactId>xservice-message-starter</artifactId>
<version>2.0</version> <version>2.0</version>
</dependency> </dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -16,4 +16,9 @@ mybatis:
mapper-locations: mapper-locations:
- classpath*:mapper/*/*.xml - classpath*:mapper/*/*.xml
configuration: configuration:
map-underscore-to-camel-case: true map-underscore-to-camel-case: true
pagehelper:
helperDialect: mysql
reasonable: true
support-methods-arguments: true
params: count=countSql

View File

@@ -1,5 +1,6 @@
package com.xiang.xservice.auth.service.service.impl; package com.xiang.xservice.auth.service.service.impl;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.xiang.xservice.auth.api.code.Code01UserErrorCode; import com.xiang.xservice.auth.api.code.Code01UserErrorCode;
import com.xiang.xservice.auth.api.code.Code02RoleErrorCode; import com.xiang.xservice.auth.api.code.Code02RoleErrorCode;
@@ -181,6 +182,7 @@ public class XUserServiceImpl implements XUserService {
@Override @Override
public List<UserResp> getUserList(UserQueryRequest request) { public List<UserResp> getUserList(UserQueryRequest request) {
PageHelper.startPage(request.getCurrent(), request.getPageSize());
List<XUser> userList = userMapper.getUserList(userConvert.toDO(request)); List<XUser> userList = userMapper.getUserList(userConvert.toDO(request));
if (CollectionUtils.isEmpty(userList)) { if (CollectionUtils.isEmpty(userList)) {
return Lists.newArrayList(); return Lists.newArrayList();