39 lines
821 B
Go
39 lines
821 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 NotifyGrantLogic struct {
|
|
logx.Logger
|
|
ctx context.Context
|
|
svcCtx *svc.ServiceContext
|
|
}
|
|
|
|
// 荣数回调
|
|
func NewNotifyGrantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *NotifyGrantLogic {
|
|
return &NotifyGrantLogic{
|
|
Logger: logx.WithContext(ctx),
|
|
ctx: ctx,
|
|
svcCtx: svcCtx,
|
|
}
|
|
}
|
|
|
|
func (l *NotifyGrantLogic) NotifyGrant(req *types.NotifyGrantReq) (resp string, err error) {
|
|
notify, requestBody, err := do.NotifyInfo(req, req.SipOrderNo, l.svcCtx, l.ctx)
|
|
_req := request.Request{
|
|
Method: "POST",
|
|
Url: notify.Grant,
|
|
Json: requestBody,
|
|
}
|
|
_resp, _ := _req.Send()
|
|
return _resp.Text, nil
|
|
}
|