浏览代码

feat:默认信息

wangshan 3 年之前
父节点
当前提交
97e8d6ba51
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      api/internal/logic/supplysearchlogic.go

+ 8 - 0
api/internal/logic/supplysearchlogic.go

@@ -27,6 +27,14 @@ func NewSupplySearchLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Supp
 }
 
 func (l *SupplySearchLogic) SupplySearch(req *types.PubSupplyInfoReq) (resp *types.CommonRes, err error) {
+	//默认每页五十条
+	if req.PageSize == 0 {
+		req.PageSize = 50
+	}
+	//默认第一页
+	if req.PageIndex == 0 {
+		req.PageIndex = 1
+	}
 	supplySearch, err0 := l.svcCtx.Consumer.SupplyInfoSearch(l.ctx, &consumer.SupplyInfoSearchReq{
 		Keywords:   req.Keywords,
 		SearchType: req.SearchType,