1
This commit is contained in:
parent
323ba7ec9c
commit
dcdccd9ac6
@ -136,6 +136,10 @@ func (this* webHook) orderUpdatedCb(ds *f5.DataSet) bool {
|
||||
endTime := q5.SmartParseTimeToMills(q5.SafeToString(p.Data.EndAt))
|
||||
createdAt := q5.SmartParseTimeToMills(q5.SafeToString(p.Data.CreatedAt))
|
||||
updatedAt := q5.SmartParseTimeToMills(q5.SafeToString(p.Data.UpdatedAt))
|
||||
srcPriceAmount := p.Data.Buy[0].Amount
|
||||
srcPriceContractAddress := p.Data.Buy[0].ContractAddress
|
||||
srcPriceItemType := p.Data.Buy[0].ItemType
|
||||
currentPrice, price := service.BcCurrency.ExchangeUSD(srcPriceAmount, srcPriceContractAddress, srcPriceItemType)
|
||||
commonFields := [][]string{
|
||||
{"order_id", p.Data.Id},
|
||||
{"chain", p.Chain},
|
||||
@ -149,6 +153,11 @@ func (this* webHook) orderUpdatedCb(ds *f5.DataSet) bool {
|
||||
{"event_id", p.EventId},
|
||||
{"event_data", rawData},
|
||||
{"modifytime", q5.ToString(nowTime)},
|
||||
{"src_price_amount", srcPriceAmount},
|
||||
{"src_price_contract_address", srcPriceContractAddress},
|
||||
{"src_price_item_type", srcPriceItemType},
|
||||
{"price", price},
|
||||
{"current_price", q5.ToString(currentPrice)},
|
||||
}
|
||||
updateFields := commonFields[0:]
|
||||
insertFields := commonFields[0:]
|
||||
|
@ -25,6 +25,11 @@ type OrderUpdatedEvent struct {
|
||||
Chain string `json:"chain"`
|
||||
Data struct {
|
||||
Id string `json:"id"`
|
||||
Buy [] struct {
|
||||
Amount string `json:"amount"`
|
||||
ContractAddress string `json:"contract_address"`
|
||||
ItemType string `json:"item_type"`
|
||||
} `json:"buy"`
|
||||
Sell [] struct {
|
||||
TokenId string `json:"token_id"`
|
||||
ItemType string `json:"item_type"`
|
||||
|
Loading…
x
Reference in New Issue
Block a user