Kaynağa Gözat

feat:默认信息

wangshan 3 yıl önce
ebeveyn
işleme
97e8d6ba51
1 değiştirilmiş dosya ile 8 ekleme ve 0 silme
  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,