You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

package moneyData
import (
"matchmaking-system/internal/data/socket/publicData"
"matchmaking-system/internal/data/tradedeal/money"
"matchmaking-system/internal/pkg/logging/applogger"
"matchmaking-system/internal/pkg/logging/common"
)
// MoneyOrderProcessing
//
// @Description: 综合订单订阅处理
// @param topIc
// @param msg
// @return *public.OrderSub
func MoneyOrderProcessing(topIc string, msg money.MoneyTallyCache) *publicData.OrderSub {
price, err := publicData.CheckMoneyImmediateSymbol(topIc, msg.Symbol, msg.Order.Type)
if err != nil {
applogger.Warn("%v MoneyOrderProcessing.CheckSymbol.err:%v--%v", common.ErrMoney, msg.Symbol, err)
}
var faceValue string
if msg.Order.System != nil {
faceValue = msg.Order.System.FaceValue.String()
}
orderM := &publicData.OrderSub{
OrderId: msg.OrderId,
Price: price,
Status: msg.Status,
Symbol: topIc,
Count: 0,
OpenPrice: msg.OpenPrice,
Market: msg.Symbol,
OrderNumber: msg.Order.OrderNumber,
TradeType: msg.Order.TradeType,
FaceValue: faceValue,
UserId: msg.UserId,
}
return orderM
}