package handler import ( "log" "net/http" "app.yhyue.com/moapp/jyInfo/api/internal/logic" "app.yhyue.com/moapp/jyInfo/api/internal/svc" "app.yhyue.com/moapp/jyInfo/api/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) func supplySearchHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var req types.PubSupplyInfoReq if err := httpx.Parse(r, &req); err != nil { httpx.Error(w, err) return } l := logic.NewSupplySearchLogic(r.Context(), svcCtx) resp, err := l.SupplySearch(&req) log.Println("resp:", resp) if err != nil { httpx.Error(w, err) } else { httpx.OkJson(w, resp) } } }