From 9279e85de00096e16815fe9fbf5c5ffeb0934181 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sun, 23 Jun 2024 12:46:16 +0800 Subject: [PATCH] 1 --- server/backtask/task/spec_transfer721.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/server/backtask/task/spec_transfer721.go b/server/backtask/task/spec_transfer721.go index d57555ba..ac161b38 100644 --- a/server/backtask/task/spec_transfer721.go +++ b/server/backtask/task/spec_transfer721.go @@ -10,12 +10,14 @@ import ( "main/constant" ) +type handleFunc func(int64, int32, string, string, string, string) bool + type specTransfer721 struct { - handleHash *q5.ConcurrentMap[string, func(*f5.DataSet) bool] + handleHash *q5.ConcurrentMap[string, handleFunc] } func (this* specTransfer721) init() { - this.handleHash = new(q5.ConcurrentMap[string, func(*f5.DataSet)bool]) + this.handleHash = new(q5.ConcurrentMap[string, handleFunc]) this.handleHash.Store(jccommon.CONTRACT_NAME_CFHero, this.procHero) this.handleHash.Store(jccommon.CONTRACT_NAME_GoldBrick, this.procGoldBullion) go this.process() @@ -46,22 +48,28 @@ SELECT * FROM t_721nft_spec_transfer WHERE idx > %d AND status = 0 AND createtim return time.Second * 60 * 1 }, func (ds *f5.DataSet) bool { + idx := q5.ToInt64(ds.GetByName("idx")) netId := q5.ToInt32(ds.GetByName("net_id")) contractAddress := ds.GetByName("contract_address") + tokenId := ds.GetByName("token_id") + fromAddress := ds.GetByName("from_address") + toAddress := ds.GetByName("toaddress") contractMeta := mt.Table.Contract.GetByNetIdAddress(netId, contractAddress) if contractMeta != nil { if p, ok := this.handleHash.Load(contractMeta.GetName()); ok { - return (*p)(ds) + return (*p)(idx, netId, contractAddress, tokenId, fromAddress, toAddress) } } return true }) } -func (this* specTransfer721) procHero(ds *f5.DataSet) bool { +func (this* specTransfer721) procHero(dbIdx int64, netId int32, contractAddress string, tokenId string, + from string, to string) bool { return true } -func (this* specTransfer721) procGoldBullion(ds *f5.DataSet) bool { +func (this* specTransfer721) procGoldBullion(dbIdx int64, netId int32, contractAddress string, tokenId string, + from string, to string) bool { return true }