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

31 lines
684 B
Go
Raw Normal View History

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 MarketQueryLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewMarketQueryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MarketQueryLogic {
return &MarketQueryLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *MarketQueryLogic) MarketQuery(in *transfer.MarketQueryReq) (*transfer.MarketQueryRes, error) {
res, err := l.svcCtx.Market.SetData(common.StructToMap(in)).Query()
return res, err
}