Commit 78d9c246 authored by shiyu's avatar shiyu

查询可寄售的商品列表,返回对象修改

parent a9b906a9
......@@ -17,6 +17,8 @@ public class PageSearchResult<T> implements Entity {
private List<T> dataList;
private List<T> list;
private Object appendObject;
private Boolean isHasNextPage;
......@@ -41,6 +43,14 @@ public class PageSearchResult<T> implements Entity {
}
private PageSearchResult(PageInfo pageInfo, List<T> list, boolean isConvert) {
this.total = pageInfo.getTotal();
this.pageSize = pageInfo.getPageSize();
this.pageIndex = pageInfo.getPageNum();
this.isHasNextPage = pageInfo.isHasNextPage();
this.list = list;
}
public static <T> PageSearchResult of(PageInfo pageInfo) {
return new PageSearchResult(pageInfo);
}
......@@ -54,6 +64,17 @@ public class PageSearchResult<T> implements Entity {
return new PageSearchResult(pageInfo, list);
}
/**
* dataList 转 list字段
* @param pageInfo
* @param list
* @return
* @param <T>
*/
public static <T> PageSearchResult ofSetList(PageInfo pageInfo, List<T> list) {
return new PageSearchResult(pageInfo, list, true);
}
public Long getTotal() {
return total;
}
......
......@@ -513,7 +513,7 @@ public class ItemServiceImpl implements ItemService {
agentTranceResponseVo.setDetail(itemResponseVo);
resultList.add(agentTranceResponseVo);
}
PageSearchResult pageSearchResult = PageSearchResult.of(pageInfo, resultList);
PageSearchResult pageSearchResult = PageSearchResult.ofSetList(pageInfo, resultList);
return Result.success(pageSearchResult);
} catch (Exception e) {
logger.error("查询可寄售商品列表失败:{}", e);
......
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