34 lines
799 B
Go
34 lines
799 B
Go
|
package logic
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"trasfer_middleware/pkg/common"
|
||
|
|
||
|
"trasfer_middleware/cmd/rpc/internal/svc"
|
||
|
"trasfer_middleware/cmd/rpc/pb/transfer"
|
||
|
|
||
|
"github.com/zeromicro/go-zero/core/logx"
|
||
|
)
|
||
|
|
||
|
type ZltxOrderRechargeLogic struct {
|
||
|
ctx context.Context
|
||
|
svcCtx *svc.ServiceContext
|
||
|
logx.Logger
|
||
|
}
|
||
|
|
||
|
func NewZltxOrderRechargeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ZltxOrderRechargeLogic {
|
||
|
return &ZltxOrderRechargeLogic{
|
||
|
ctx: ctx,
|
||
|
svcCtx: svcCtx,
|
||
|
Logger: logx.WithContext(ctx),
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (l *ZltxOrderRechargeLogic) ZltxOrderRecharge(in *transfer.ZltxOrderRechargeReq) (*transfer.DefaultRes, error) {
|
||
|
res, err := l.svcCtx.ZltxOrder.SetData(common.StructToMap(in)).RechargeOrder()
|
||
|
return &transfer.DefaultRes{
|
||
|
Code: res.Code,
|
||
|
Message: res.Message,
|
||
|
}, err
|
||
|
}
|