muyu-apiserver/gateway/internal/handler/purchase/payment/listpurchasepaymenthandler.go

29 lines
722 B
Go
Raw Normal View History

package payment
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"muyu-apiserver/gateway/internal/logic/purchase/payment"
"muyu-apiserver/gateway/internal/svc"
"muyu-apiserver/gateway/internal/types"
)
func ListPurchasePaymentHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.ListPurchasePaymentReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := payment.NewListPurchasePaymentLogic(r.Context(), svcCtx)
resp, err := l.ListPurchasePayment(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}