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

30 lines
664 B
Go

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 NotifyGrantHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.NotifyGrantReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := transfer.NewNotifyGrantLogic(r.Context(), svcCtx)
resp, err := l.NotifyGrant(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}