package logic import ( "context" "github.com/jinzhu/copier" "trasfer_middleware/until/common" "trasfer_middleware/cmd/rpc/internal/svc" "trasfer_middleware/cmd/rpc/pb/transfer" "github.com/zeromicro/go-zero/core/logx" ) type ZltxRechargeProductLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } func NewZltxRechargeProductLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ZltxRechargeProductLogic { return &ZltxRechargeProductLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } func (l *ZltxRechargeProductLogic) ZltxRechargeProduct(in *transfer.DefaultReq) (*transfer.ZltxRechargeProductRes, error) { var result = &transfer.ZltxRechargeProductRes{} res, err := l.svcCtx.ZltxOrder.SetData(l.ctx, common.StructToMap(in), &l.svcCtx.Config.Mq).RechargeProduct() _ = copier.Copy(result, &res) return result, err }