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.
48 lines
1.3 KiB
48 lines
1.3 KiB
package optionData
|
|
|
|
import (
|
|
"matchmaking-system/internal/data/socket/publicData"
|
|
"matchmaking-system/internal/data/tradedeal/option"
|
|
"matchmaking-system/internal/pkg/logging/applogger"
|
|
"matchmaking-system/internal/pkg/logging/common"
|
|
"matchmaking-system/internal/pkg/setting"
|
|
"matchmaking-system/internal/pkg/utils"
|
|
)
|
|
|
|
// OptionInrOrderProcessing
|
|
//
|
|
// @Description: 股票-印度期权股订阅处理
|
|
// @param topIc
|
|
// @param msg
|
|
// @return *public.OrderSub
|
|
func OptionInrOrderProcessing(check int, msg option.OptionInrTallyCache) *publicData.OrderSub {
|
|
var top string
|
|
switch check {
|
|
case 0:
|
|
top = setting.SubscribeOptionInr
|
|
case 1:
|
|
top = setting.SubscribeAdminOptionInr
|
|
}
|
|
|
|
price, err := publicData.CheckSymbolOption(msg)
|
|
if err != nil {
|
|
applogger.Warn("%v OptionInrOrderProcessing.CheckSymbol.err:%v--%v", common.ErrOptionInr, msg.Symbol, err)
|
|
}
|
|
|
|
orderM := &publicData.OrderSub{
|
|
OrderId: msg.OrderId,
|
|
Price: utils.DecimalsPrice(price),
|
|
Status: msg.Status,
|
|
Symbol: top,
|
|
Count: 0,
|
|
OpenPrice: msg.OpenPrice,
|
|
Market: msg.Symbol,
|
|
OrderNumber: msg.Order.OrderNumber,
|
|
TradeType: msg.Order.TradeType,
|
|
TradingType: msg.Order.TradingType,
|
|
ServiceCost: msg.Order.ServiceCost,
|
|
UserId: msg.UserId,
|
|
}
|
|
|
|
return orderM
|
|
}
|
|
|