2024-06-07 11:51:19 +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:51:19 +08:00
|
|
|
|
|
|
|
"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) {
|
2024-06-12 13:46:14 +08:00
|
|
|
res, err := l.svcCtx.Market.SetData(common.StructToMap(in), &l.svcCtx.Config.Mq).Query()
|
2024-06-07 14:28:29 +08:00
|
|
|
return res, err
|
2024-06-07 11:51:19 +08:00
|
|
|
}
|