This commit is contained in:
aozhiwei 2024-06-23 13:29:04 +08:00
parent 48e8bbefd9
commit 15752e0317
4 changed files with 19 additions and 18 deletions

View File

@ -6,10 +6,3 @@ type App interface {
type TaskMgr 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

@ -1,4 +1,4 @@
package task package spec_transfer721
import ( import (
"q5" "q5"
@ -8,24 +8,23 @@ import (
//"mt" //"mt"
//"jccommon" //"jccommon"
"main/constant" "main/constant"
"main/common"
) )
type specTransfer721 struct { type SpecTransfer721 struct {
handleHash *q5.ConcurrentMap[string, common.SpecTransfer721Handle] handleHash *q5.ConcurrentMap[string, specTransfer721Handle]
} }
func (this* specTransfer721) init() { func (this* SpecTransfer721) Init() {
this.handleHash = new(q5.ConcurrentMap[string, common.SpecTransfer721Handle]) this.handleHash = new(q5.ConcurrentMap[string, specTransfer721Handle])
//this.handleHash.Store(jccommon.CONTRACT_NAME_CFHero, this.procHero) //this.handleHash.Store(jccommon.CONTRACT_NAME_CFHero, this.procHero)
//this.handleHash.Store(jccommon.CONTRACT_NAME_GoldBrick, this.procGoldBullion) //this.handleHash.Store(jccommon.CONTRACT_NAME_GoldBrick, this.procGoldBullion)
go this.process() go this.process()
} }
func (this* specTransfer721) unInit() { func (this* SpecTransfer721) UnInit() {
} }
func (this* specTransfer721) process() { func (this* SpecTransfer721) process() {
f5.GetGoStyleDb().LoopLoad( f5.GetGoStyleDb().LoopLoad(
constant.BCEVENT_DB, constant.BCEVENT_DB,
func (lastIdx int64) string { func (lastIdx int64) string {

View File

@ -0,0 +1,8 @@
package spec_transfer721
type specTransfer721Handle interface {
onMint(dbIdx int64, netId int32, contractAddress string, tokenId string,
from string, to string) bool
onLock() bool
onUnlock() bool
}

View File

@ -2,6 +2,7 @@ package task
import ( import (
//"fmt" //"fmt"
"main/task/spec_transfer721"
) )
type taskMgr struct { type taskMgr struct {
@ -9,7 +10,7 @@ type taskMgr struct {
//DailyTaskMgr //DailyTaskMgr
webHook webHook
goldBullionReturn goldBullionReturn
specTransfer721 spec_transfer721.SpecTransfer721
repairNft repairNft
} }
@ -18,13 +19,13 @@ func (this *taskMgr) Init() {
//t.DailyTaskMgr.Init() //t.DailyTaskMgr.Init()
this.webHook.init() this.webHook.init()
this.goldBullionReturn.init() this.goldBullionReturn.init()
this.specTransfer721.init() this.SpecTransfer721.Init()
this.repairNft.init() this.repairNft.init()
} }
func (this *taskMgr) UnInit() { func (this *taskMgr) UnInit() {
this.repairNft.unInit() this.repairNft.unInit()
this.specTransfer721.unInit() this.SpecTransfer721.UnInit()
this.goldBullionReturn.unInit() this.goldBullionReturn.unInit()
this.webHook.unInit() this.webHook.unInit()
} }