This commit is contained in:
aozhiwei 2024-06-23 13:18:08 +08:00
parent 9279e85de0
commit 94b84e7765
3 changed files with 16 additions and 19 deletions

View File

@ -6,3 +6,10 @@ type App interface {
type TaskMgr interface {
}
type SpecTransfer721Handle interface {
OnMint(dbIdx int64, netId int32, contractAddress string, tokenId string,
from string, to string) bool
OnLock() bool
OnUnlock() bool
}

View File

@ -5,21 +5,20 @@ import (
"f5"
"time"
"fmt"
"mt"
"jccommon"
//"mt"
//"jccommon"
"main/constant"
"main/common"
)
type handleFunc func(int64, int32, string, string, string, string) bool
type specTransfer721 struct {
handleHash *q5.ConcurrentMap[string, handleFunc]
handleHash *q5.ConcurrentMap[string, common.SpecTransfer721Handle]
}
func (this* specTransfer721) init() {
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)
this.handleHash = new(q5.ConcurrentMap[string, common.SpecTransfer721Handle])
//this.handleHash.Store(jccommon.CONTRACT_NAME_CFHero, this.procHero)
//this.handleHash.Store(jccommon.CONTRACT_NAME_GoldBrick, this.procGoldBullion)
go this.process()
}
@ -48,6 +47,7 @@ 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")
@ -59,17 +59,7 @@ SELECT * FROM t_721nft_spec_transfer WHERE idx > %d AND status = 0 AND createtim
if p, ok := this.handleHash.Load(contractMeta.GetName()); ok {
return (*p)(idx, netId, contractAddress, tokenId, fromAddress, toAddress)
}
}
}*/
return true
})
}
func (this* specTransfer721) procHero(dbIdx int64, netId int32, contractAddress string, tokenId string,
from string, to string) bool {
return true
}
func (this* specTransfer721) procGoldBullion(dbIdx int64, netId int32, contractAddress string, tokenId string,
from string, to string) bool {
return true
}