1
This commit is contained in:
parent
974125e220
commit
a06f8cf8d5
@ -11,10 +11,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type specTransfer721 struct {
|
type specTransfer721 struct {
|
||||||
|
handleHash *q5.ConcurrentMap[string, func(*f5.DataSet) bool]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this* specTransfer721) init() {
|
func (this* specTransfer721) init() {
|
||||||
|
this.handleHash = new(q5.ConcurrentMap[string, func(*f5.DataSet)bool])
|
||||||
|
this.handleHash.Store(jccommon.CONTRACT_NAME_CFHero, this.procHero)
|
||||||
|
this.handleHash.Store(jccommon.CONTRACT_NAME_GoldBrick, this.procGoldBullion)
|
||||||
go this.process()
|
go this.process()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,21 +45,23 @@ SELECT * FROM t_721nft_spec_transfer WHERE idx > %d AND status = 0 AND createtim
|
|||||||
func () time.Duration {
|
func () time.Duration {
|
||||||
return time.Second * 60 * 1
|
return time.Second * 60 * 1
|
||||||
},
|
},
|
||||||
this.process1)
|
func (ds *f5.DataSet) bool {
|
||||||
|
netId := q5.ToInt32(ds.GetByName("net_id"))
|
||||||
|
contractAddress := ds.GetByName("contract_address")
|
||||||
|
contractMeta := mt.Table.Contract.GetByNetIdAddress(netId, contractAddress)
|
||||||
|
if contractMeta != nil {
|
||||||
|
if p, ok := this.handleHash.Load(contractMeta.GetName()); ok {
|
||||||
|
return (*p)(ds)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this* specTransfer721) process1(ds *f5.DataSet) bool {
|
func (this* specTransfer721) procHero(ds *f5.DataSet) bool {
|
||||||
netId := q5.ToInt32(ds.GetByName("net_id"))
|
return true
|
||||||
contractAddress := ds.GetByName("contract_address")
|
}
|
||||||
//tokenId := ds.GetByName("token_id")
|
|
||||||
contractMeta := mt.Table.Contract.GetByNetIdAddress(netId, contractAddress)
|
func (this* specTransfer721) procGoldBullion(ds *f5.DataSet) bool {
|
||||||
if contractMeta != nil {
|
|
||||||
switch contractMeta.GetName() {
|
|
||||||
case jccommon.CONTRACT_NAME_CFHero: {
|
|
||||||
}
|
|
||||||
case jccommon.CONTRACT_NAME_GoldBrick: {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user