30 lines
713 B
Go
30 lines
713 B
Go
package logic
|
|
|
|
import (
|
|
"context"
|
|
"trasfer_middleware/cmd/rpc/internal/svc"
|
|
"trasfer_middleware/cmd/rpc/pb/transfer"
|
|
"trasfer_middleware/until/common"
|
|
|
|
"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(l.ctx, common.StructToMap(in), &l.svcCtx.Config.Mq).Query()
|
|
return res, err
|
|
}
|