30 lines
677 B
Go
30 lines
677 B
Go
package logic
|
|
|
|
import (
|
|
"context"
|
|
"trasfer_middleware/cmd/rpc/internal/svc"
|
|
"trasfer_middleware/cmd/rpc/pb/transfer"
|
|
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
)
|
|
|
|
type RsCouponGrantLogic struct {
|
|
ctx context.Context
|
|
svcCtx *svc.ServiceContext
|
|
logx.Logger
|
|
}
|
|
|
|
func NewRsCouponGrantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RsCouponGrantLogic {
|
|
return &RsCouponGrantLogic{
|
|
ctx: ctx,
|
|
svcCtx: svcCtx,
|
|
Logger: logx.WithContext(ctx),
|
|
}
|
|
}
|
|
|
|
func (l *RsCouponGrantLogic) RsCouponGrant(in *transfer.RsCouponGrantReq) (*transfer.RsCouponGrantRes, error) {
|
|
res, err := l.svcCtx.RS.SetData(l.ctx, in, &l.svcCtx.Config.Mq).CouponGrant()
|
|
return res, err
|
|
|
|
}
|