Commit 9f325860 authored by renjie's avatar renjie

shop接口修改

parent 9728c965
...@@ -3,7 +3,7 @@ package com.edgec.browserbackend.browser.dto; ...@@ -3,7 +3,7 @@ package com.edgec.browserbackend.browser.dto;
public class ShopPageInfo { public class ShopPageInfo {
int currentPage; int currentPage;
int totalPage; int totalPage;
int totalShops; long totalShops;
public int getCurrentPage() { public int getCurrentPage() {
return currentPage; return currentPage;
...@@ -21,11 +21,11 @@ public class ShopPageInfo { ...@@ -21,11 +21,11 @@ public class ShopPageInfo {
this.totalPage = totalPage; this.totalPage = totalPage;
} }
public int getTotalShops() { public long getTotalShops() {
return totalShops; return totalShops;
} }
public void setTotalShops(int totalShops) { public void setTotalShops(long totalShops) {
this.totalShops = totalShops; this.totalShops = totalShops;
} }
} }
...@@ -312,13 +312,14 @@ public class ShopServiceImpl implements ShopService { ...@@ -312,13 +312,14 @@ public class ShopServiceImpl implements ShopService {
String group1 = userShopRepository.findByUsernameAndShopId(username, x.getShopId()).getGroupId(); String group1 = userShopRepository.findByUsernameAndShopId(username, x.getShopId()).getGroupId();
shopDtos.add(ShopDto.of(x, group1, ipResource)); shopDtos.add(ShopDto.of(x, group1, ipResource));
}); });
logger.error(shopDtos.size() + "!!");
Page<ShopDto> shopDtoPage = new PageImpl<>(shopDtos, pageable, shopDtos.size()); Page<ShopDto> shopDtoPage = new PageImpl<>(shopDtos, pageable, shopDtos.size());
ShopPageResultDto shopPageResultDto = new ShopPageResultDto(); ShopPageResultDto shopPageResultDto = new ShopPageResultDto();
shopPageResultDto.setShopList(shopDtoPage.getContent()); shopPageResultDto.setShopList(shopDtoPage.getContent());
ShopPageInfo shopPageInfo = new ShopPageInfo(); ShopPageInfo shopPageInfo = new ShopPageInfo();
shopPageInfo.setCurrentPage(shopDtoPage.getPageable().getPageNumber()); shopPageInfo.setCurrentPage(shopDtoPage.getPageable().getPageNumber() + 1);
shopPageInfo.setTotalPage(shopDtoPage.getTotalPages()); shopPageInfo.setTotalPage(shopDtoPage.getTotalPages());
shopPageInfo.setTotalShops(shopDtos.size()); shopPageInfo.setTotalShops(shopDtoPage.getTotalElements());
shopPageResultDto.setShopPage(shopPageInfo); shopPageResultDto.setShopPage(shopPageInfo);
return shopPageResultDto; return shopPageResultDto;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment