wangshan 3 жил өмнө
parent
commit
8de7c8bba6

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

@@ -3,7 +3,6 @@ package logic
 import (
 	"context"
 	"jyInfo/rpc/consumer/consumer"
-	"strings"
 
 	"app.yhyue.com/moapp/jybase/common"
 
@@ -28,18 +27,6 @@ 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
-	}
-	//空格多个关键词
-	if strings.Contains(req.Keywords, "+") {
-		req.Keywords = strings.ReplaceAll(req.Keywords, " ", "+")
-	}
 	supplySearch, err0 := l.svcCtx.Consumer.SupplyInfoSearch(l.ctx, &consumer.SupplyInfoSearchReq{
 		Keywords:   req.Keywords,
 		SearchType: req.SearchType,

+ 0 - 1
rpc/consumer/consumer.go

@@ -6,7 +6,6 @@ import (
 	"jyInfo/rpc/consumer/internal/server"
 	"jyInfo/rpc/consumer/internal/svc"
 	"jyInfo/rpc/consumer/type/consumer"
-	"jyInfo/rpc/util"
 	"log"
 
 	mc "app.yhyue.com/moapp/jybase/common"

+ 15 - 1
rpc/consumer/internal/logic/supplyinfosearchlogic.go

@@ -1,10 +1,12 @@
 package logic
 
 import (
-	se "app.yhyue.com/moapp/jybase/encrypt"
 	"context"
 	"jyInfo/rpc/model/es"
 	"log"
+	"strings"
+
+	se "app.yhyue.com/moapp/jybase/encrypt"
 
 	"jyInfo/rpc/consumer/consumer"
 	"jyInfo/rpc/consumer/internal/svc"
@@ -29,6 +31,18 @@ func NewSupplyInfoSearchLogic(ctx context.Context, svcCtx *svc.ServiceContext) *
 
 // 供应信息查询
 func (l *SupplyInfoSearchLogic) SupplyInfoSearch(in *consumer.SupplyInfoSearchReq) (*consumer.SupplyInfoSearchResp, error) {
+	//默认每页五十条
+	if in.PageSize == 0 {
+		in.PageSize = 50
+	}
+	//默认第一页
+	if in.PageIndex == 0 {
+		in.PageIndex = 1
+	}
+	//空格多个关键词
+	if strings.Contains(in.Keywords, "+") {
+		in.Keywords = strings.ReplaceAll(in.Keywords, " ", "+")
+	}
 	list, total := model.GetSupplyInfoList(in)
 	var infos []*consumer.SupplyList
 	if len(*list) > 0 {