transfer_middleware/cmd/rpc/internal/logic/zltxOrderRechargeQueryLogic.go

35 lines
927 B
Go
Raw Normal View History

2024-06-07 11:11:04 +08:00
package logic
import (
"context"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
2024-06-12 13:46:14 +08:00
"trasfer_middleware/until/common"
2024-06-07 11:11:04 +08:00
"github.com/zeromicro/go-zero/core/logx"
)
type ZltxOrderRechargeQueryLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewZltxOrderRechargeQueryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ZltxOrderRechargeQueryLogic {
return &ZltxOrderRechargeQueryLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *ZltxOrderRechargeQueryLogic) ZltxOrderRechargeQuery(in *transfer.ZltxOrderRechargeQueryReq) (*transfer.ZltxOrderRechargeQueryRes, error) {
res, err := l.svcCtx.ZltxOrder.SetData(common.StructToMap(in)).RechargeQuery()
return &transfer.ZltxOrderRechargeQueryRes{
Code: res.Code,
Message: res.Message,
Status: res.Status,
OutTradeNo: res.OutTradeNo,
}, err
}