healthapp
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 lines
636 B

package handler
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"healthapi/internal/logic"
"healthapi/internal/svc"
"healthapi/internal/types"
)
func PreviewOrderHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.OrderPreviewReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := logic.NewPreviewOrderLogic(r.Context(), svcCtx)
resp, err := l.PreviewOrder(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}