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.

43 lines
1.1 KiB

2 months ago
package forexData
import (
"matchmaking-system/internal/data/socket/publicData"
"matchmaking-system/internal/data/tradedeal/forex"
"matchmaking-system/internal/pkg/logging/applogger"
"matchmaking-system/internal/pkg/logging/common"
)
// ForexOrderProcessing
//
// @Description: 外汇订单订阅处理
// @param topIc
// @param msg
// @return *public.OrderSub
func ForexOrderProcessing(topIc string, msg forex.ForexTallyCache) *publicData.OrderSub {
price, err := publicData.CheckForexImmediateSymbol(topIc, msg.Symbol, msg.Order.TradeType)
if err != nil {
applogger.Warn("%v ForexOrderProcessing.CheckSymbol.err:%v--%v", common.ErrForex, 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
}