作者 王勇

将所有的分页查询,查询出0条,也是查询成功

@@ -47,7 +47,7 @@ public class BusExchangeController { @@ -47,7 +47,7 @@ public class BusExchangeController {
47 BusExchange busExchange = BusExchange.builder().exchangeName(exchangeName).virtualHostId(virtualHostId).build(); 47 BusExchange busExchange = BusExchange.builder().exchangeName(exchangeName).virtualHostId(virtualHostId).build();
48 // 分页查询 48 // 分页查询
49 PageInfo pageInfo = busExchangeService.selectBusExchangeList(busExchange, pageNum, pageSize); 49 PageInfo pageInfo = busExchangeService.selectBusExchangeList(busExchange, pageNum, pageSize);
50 - return pageInfo.getTotal() > 0 50 + return pageInfo.getTotal() >= 0
51 ? new ResultJson<>("200", "查询MQ交换机列表,成功!", pageInfo) 51 ? new ResultJson<>("200", "查询MQ交换机列表,成功!", pageInfo)
52 : new ResultJson<>("500", "查询MQ交换机列表,失败!"); 52 : new ResultJson<>("500", "查询MQ交换机列表,失败!");
53 } 53 }
@@ -55,7 +55,7 @@ public class BusQueueController { @@ -55,7 +55,7 @@ public class BusQueueController {
55 .build(); 55 .build();
56 // 分页查询 56 // 分页查询
57 PageInfo pageInfo = busQueueService.selectBusQueueList(busQueue, pageNum, pageSize); 57 PageInfo pageInfo = busQueueService.selectBusQueueList(busQueue, pageNum, pageSize);
58 - return pageInfo.getTotal() > 0 58 + return pageInfo.getTotal() >= 0
59 ? new ResultJson<>("200", "查询-消息队列-列表,成功!", pageInfo) 59 ? new ResultJson<>("200", "查询-消息队列-列表,成功!", pageInfo)
60 : new ResultJson<>("500", "查询-消息队列-列表,失败!"); 60 : new ResultJson<>("500", "查询-消息队列-列表,失败!");
61 } 61 }
@@ -46,7 +46,7 @@ public class BusServerController { @@ -46,7 +46,7 @@ public class BusServerController {
46 BusServer busServer = BusServer.builder().serverName(serverName).build(); 46 BusServer busServer = BusServer.builder().serverName(serverName).build();
47 // 分页查询 47 // 分页查询
48 PageInfo pageInfo = busServerService.selectBusServerList(busServer, pageNum, pageSize); 48 PageInfo pageInfo = busServerService.selectBusServerList(busServer, pageNum, pageSize);
49 - return pageInfo.getTotal() > 0 49 + return pageInfo.getTotal() >= 0
50 ? new ResultJson<>("200", "查询MQ服务器列表,成功!", pageInfo) 50 ? new ResultJson<>("200", "查询MQ服务器列表,成功!", pageInfo)
51 : new ResultJson<>("500", "查询MQ服务器列表,失败!"); 51 : new ResultJson<>("500", "查询MQ服务器列表,失败!");
52 } 52 }
@@ -47,7 +47,7 @@ public class RoutingKeyController { @@ -47,7 +47,7 @@ public class RoutingKeyController {
47 RoutingKey routingKey = RoutingKey.builder().routingKeyName(routingKeyName).exchangeId(exchangeId).build(); 47 RoutingKey routingKey = RoutingKey.builder().routingKeyName(routingKeyName).exchangeId(exchangeId).build();
48 // 分页查询 48 // 分页查询
49 PageInfo pageInfo = routingKeyService.selectRoutingKeyList(routingKey, pageNum, pageSize); 49 PageInfo pageInfo = routingKeyService.selectRoutingKeyList(routingKey, pageNum, pageSize);
50 - return pageInfo.getTotal() > 0 50 + return pageInfo.getTotal() >= 0
51 ? new ResultJson<>("200", "查询路由键列表,成功!", pageInfo) 51 ? new ResultJson<>("200", "查询路由键列表,成功!", pageInfo)
52 : new ResultJson<>("500", "查询路由键列表,失败!"); 52 : new ResultJson<>("500", "查询路由键列表,失败!");
53 } 53 }
@@ -62,7 +62,7 @@ public class UserMessageBindingController { @@ -62,7 +62,7 @@ public class UserMessageBindingController {
62 .routingKeyName(routingKeyName) 62 .routingKeyName(routingKeyName)
63 .build(); 63 .build();
64 PageInfo pageInfo = userMessageBindingService.selectUserMessageBindingList(userMessageBinding, pageNum, pageSize); 64 PageInfo pageInfo = userMessageBindingService.selectUserMessageBindingList(userMessageBinding, pageNum, pageSize);
65 - return pageInfo.getTotal() > 0 65 + return pageInfo.getTotal() >= 0
66 ? new ResultJson<>("200", "查询-账户消息绑定配置列表,成功!", pageInfo) 66 ? new ResultJson<>("200", "查询-账户消息绑定配置列表,成功!", pageInfo)
67 : new ResultJson<>("500", "查询-账户消息绑定配置列表,失败!"); 67 : new ResultJson<>("500", "查询-账户消息绑定配置列表,失败!");
68 } 68 }
@@ -49,7 +49,7 @@ public class VirtualHostController { @@ -49,7 +49,7 @@ public class VirtualHostController {
49 VirtualHost virtualHost = VirtualHost.builder().virtualHostName(virtualHostName).serverId(serverId).build(); 49 VirtualHost virtualHost = VirtualHost.builder().virtualHostName(virtualHostName).serverId(serverId).build();
50 // 分页查询 50 // 分页查询
51 PageInfo pageInfo = virtualHostService.selectVirtualHostList(virtualHost, pageNum, pageSize); 51 PageInfo pageInfo = virtualHostService.selectVirtualHostList(virtualHost, pageNum, pageSize);
52 - return pageInfo.getTotal() > 0 52 + return pageInfo.getTotal() >= 0
53 ? new ResultJson<>("200", "查询虚拟主机列表,成功!", pageInfo) 53 ? new ResultJson<>("200", "查询虚拟主机列表,成功!", pageInfo)
54 : new ResultJson<>("500", "查询虚拟主机列表,失败!"); 54 : new ResultJson<>("500", "查询虚拟主机列表,失败!");
55 } 55 }
@@ -106,7 +106,7 @@ public class ElasticSearchInfoServiceImpl implements ElasticSearchInfoService { @@ -106,7 +106,7 @@ public class ElasticSearchInfoServiceImpl implements ElasticSearchInfoService {
106 PageHelper.startPage(pageNum, pageSize); 106 PageHelper.startPage(pageNum, pageSize);
107 List<ElasticSearchInfo> elasticSearchInfos = elasticSearchInfoMapper.selectListByPage(elasticSearchInfo); 107 List<ElasticSearchInfo> elasticSearchInfos = elasticSearchInfoMapper.selectListByPage(elasticSearchInfo);
108 PageInfo<ElasticSearchInfo> pageInfo = new PageInfo<>(elasticSearchInfos); 108 PageInfo<ElasticSearchInfo> pageInfo = new PageInfo<>(elasticSearchInfos);
109 - return pageInfo.getTotal() > 0 109 + return pageInfo.getTotal() >= 0
110 ? new ResultJson<>("200", "查询ES服务器列表,成功!", pageInfo) 110 ? new ResultJson<>("200", "查询ES服务器列表,成功!", pageInfo)
111 : new ResultJson<>("500", "查询ES服务器列表,失败!"); 111 : new ResultJson<>("500", "查询ES服务器列表,失败!");
112 } 112 }
@@ -403,7 +403,7 @@ public class UserInfoServiceImpl implements UserInfoService { @@ -403,7 +403,7 @@ public class UserInfoServiceImpl implements UserInfoService {
403 PageHelper.startPage(pageNum, pageSize); 403 PageHelper.startPage(pageNum, pageSize);
404 List<UserInfo> userInfoList = userInfoMapper.selectUserInfoList(userInfo); 404 List<UserInfo> userInfoList = userInfoMapper.selectUserInfoList(userInfo);
405 PageInfo<UserInfo> pageInfo = new PageInfo<>(userInfoList); 405 PageInfo<UserInfo> pageInfo = new PageInfo<>(userInfoList);
406 - return pageInfo.getTotal() > 0 406 + return pageInfo.getTotal() >= 0
407 ? new ResultJson<>("200", "查询用户信息列表,成功!", pageInfo) 407 ? new ResultJson<>("200", "查询用户信息列表,成功!", pageInfo)
408 : new ResultJson<>("500", "查询用户信息列表,失败!"); 408 : new ResultJson<>("500", "查询用户信息列表,失败!");
409 } 409 }
@@ -85,7 +85,7 @@ public class ExchangeFactory { @@ -85,7 +85,7 @@ public class ExchangeFactory {
85 85
86 Integer total = list.size(); 86 Integer total = list.size();
87 List<ViewExchangeInfo> resultList = subAndSortList(pageNum, pageSize, list); 87 List<ViewExchangeInfo> resultList = subAndSortList(pageNum, pageSize, list);
88 - return resultList.size() > 0 88 + return resultList.size() >= 0
89 ? new ResultJson<>("200", "查询交换机监控,成功!", resultList, total) 89 ? new ResultJson<>("200", "查询交换机监控,成功!", resultList, total)
90 : new ResultJson<>("500", "查询交换机监控,失败!"); 90 : new ResultJson<>("500", "查询交换机监控,失败!");
91 } 91 }
@@ -86,7 +86,7 @@ public class ViewQueueFactory { @@ -86,7 +86,7 @@ public class ViewQueueFactory {
86 86
87 // 达到分页与排序效果 87 // 达到分页与排序效果
88 List<ViewQueueInfo> resultList = subAndSortList(pageNum, pageSize, list); 88 List<ViewQueueInfo> resultList = subAndSortList(pageNum, pageSize, list);
89 - return resultList.size() > 0 89 + return resultList.size() >= 0
90 ? new ResultJson<>("200", "查询队列监控,成功!", resultList, total) 90 ? new ResultJson<>("200", "查询队列监控,成功!", resultList, total)
91 : new ResultJson<>("500", "查询队列监控,失败!"); 91 : new ResultJson<>("500", "查询队列监控,失败!");
92 } 92 }