transfer_rs/cmd/api/internal/logic/transfer/notifyCouponLogic.go

39 lines
829 B
Go

package transfer
import (
"context"
"rs/cmd/api/internal/logic/do"
"rs/untils/request"
"rs/cmd/api/internal/svc"
"rs/cmd/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type NotifyCouponLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
// 荣数回调
func NewNotifyCouponLogic(ctx context.Context, svcCtx *svc.ServiceContext) *NotifyCouponLogic {
return &NotifyCouponLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *NotifyCouponLogic) NotifyCoupon(req *types.NotifyCouponReq) (resp string, err error) {
notify, requestBody, err := do.NotifyInfo(req, req.SipOrderNo, l.svcCtx, l.ctx)
_req := request.Request{
Method: "POST",
Url: notify.Coupon,
Json: requestBody,
}
_resp, _ := _req.Send()
return _resp.Text, nil
}