transfer_rs/cmd/api/internal/handler/transfer/notifyCouponHandler.go

29 lines
667 B
Go
Raw Normal View History

2024-07-09 18:19:52 +08:00
package transfer
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"rs/cmd/api/internal/logic/transfer"
"rs/cmd/api/internal/svc"
"rs/cmd/api/internal/types"
)
// 荣数回调
func NotifyCouponHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.NotifyCouponReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := transfer.NewNotifyCouponLogic(r.Context(), svcCtx)
resp, err := l.NotifyCoupon(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}