1
This commit is contained in:
parent
c847948f99
commit
f082131188
@ -115,6 +115,10 @@ func (this* webHook) orderUpdatedCb(ds *f5.DataSet) bool {
|
||||
err := q5.DecodeJson(rawData, &p)
|
||||
netId := mt.Table.Config.GetById(0).GetNetId()
|
||||
if err == nil {
|
||||
var itemId int32
|
||||
var heroQuality int32
|
||||
this.getItemIdHeroQuality(netId, p.Data.Sell[0].ContractAddress, p.Data.Sell[0].TokenId,
|
||||
&itemId, &heroQuality)
|
||||
startTime := q5.SmartParseTimeToMills(q5.SafeToString(p.Data.StartAt))
|
||||
endTime := q5.SmartParseTimeToMills(q5.SafeToString(p.Data.EndAt))
|
||||
createdAt := q5.SmartParseTimeToMills(q5.SafeToString(p.Data.CreatedAt))
|
||||
@ -123,6 +127,8 @@ func (this* webHook) orderUpdatedCb(ds *f5.DataSet) bool {
|
||||
{"order_id", p.Data.Id},
|
||||
{"chain", p.Chain},
|
||||
{"status", p.Data.Status.Name},
|
||||
{"item_id", q5.ToString(itemId)},
|
||||
{"hero_quality", q5.ToString(heroQuality)},
|
||||
{"start_time", q5.ToString(startTime)},
|
||||
{"end_time", q5.ToString(endTime)},
|
||||
{"created_at", q5.ToString(createdAt)},
|
||||
@ -167,6 +173,12 @@ func (this* webHook) activitySaleCb(ds *f5.DataSet) bool {
|
||||
err := q5.DecodeJson(rawData, &p)
|
||||
netId := mt.Table.Config.GetById(0).GetNetId()
|
||||
if err == nil {
|
||||
var itemId int32
|
||||
var heroQuality int32
|
||||
this.getItemIdHeroQuality(netId,
|
||||
p.Data.Details.Asset[0].ContractAddress,
|
||||
p.Data.Details.Asset[0].TokenId,
|
||||
&itemId, &heroQuality)
|
||||
indexedAt := q5.SmartParseTimeToMills(q5.SafeToString(p.Data.IndexedAt))
|
||||
updateFields := [][]string{
|
||||
}
|
||||
@ -176,6 +188,8 @@ func (this* webHook) activitySaleCb(ds *f5.DataSet) bool {
|
||||
{"net_id", q5.ToString(netId)},
|
||||
{"token_id", p.Data.Details.Asset[0].TokenId},
|
||||
{"contract_address", strings.ToLower(p.Data.Details.Asset[0].ContractAddress)},
|
||||
{"item_id", q5.ToString(itemId)},
|
||||
{"hero_quality", q5.ToString(heroQuality)},
|
||||
{"buyer", p.Data.Details.From},
|
||||
{"seller", p.Data.Details.To},
|
||||
{"indexed_at", q5.ToString(indexedAt)},
|
||||
@ -203,3 +217,7 @@ func (this* webHook) activitySaleCb(ds *f5.DataSet) bool {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (this* webHook) getItemIdHeroQuality(netId int32, contractAddress string, tokenId string,
|
||||
itemId *int32, heroQuality *int32) {
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user