63 lines
1.2 KiB
Go
63 lines
1.2 KiB
Go
package task
|
|
|
|
import (
|
|
"q5"
|
|
"f5"
|
|
"time"
|
|
"fmt"
|
|
"mt"
|
|
"jccommon"
|
|
"main/constant"
|
|
)
|
|
|
|
type specTransfer721 struct {
|
|
|
|
}
|
|
|
|
func (this* specTransfer721) init() {
|
|
go this.process()
|
|
}
|
|
|
|
func (this* specTransfer721) unInit() {
|
|
}
|
|
|
|
func (this* specTransfer721) process() {
|
|
f5.GetGoStyleDb().LoopLoad(
|
|
constant.BCEVENT_DB,
|
|
func (lastIdx int64) string {
|
|
nowTime := f5.GetApp().GetRealSeconds()
|
|
expiredTime := nowTime - 3600 * 24 * 7
|
|
sql := fmt.Sprintf(`
|
|
SELECT * FROM t_721nft_spec_transfer WHERE idx > %d AND status = 0 AND createtime > %d LIMIT 1000
|
|
`,
|
|
lastIdx,
|
|
expiredTime)
|
|
return sql
|
|
},
|
|
[]string{
|
|
},
|
|
func () time.Duration {
|
|
return time.Second * 10
|
|
},
|
|
func () time.Duration {
|
|
return time.Second * 60 * 1
|
|
},
|
|
this.process1)
|
|
}
|
|
|
|
func (this* specTransfer721) process1(ds *f5.DataSet) bool {
|
|
netId := q5.ToInt32(ds.GetByName("net_id"))
|
|
contractAddress := ds.GetByName("contract_address")
|
|
//tokenId := ds.GetByName("token_id")
|
|
contractMeta := mt.Table.Contract.GetByNetIdAddress(netId, contractAddress)
|
|
if contractMeta != nil {
|
|
switch contractMeta.GetName() {
|
|
case jccommon.CONTRACT_NAME_CFHero: {
|
|
}
|
|
case jccommon.CONTRACT_NAME_GoldBrick: {
|
|
}
|
|
}
|
|
}
|
|
return true
|
|
}
|