This commit is contained in:
aozhiwei 2024-07-23 11:46:47 +08:00
parent 6823662718
commit 4ee6513d2b
4 changed files with 57 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package jccommon package jccommon
import ( import (
"f5"
"strconv" "strconv"
) )
@ -84,3 +85,7 @@ func CalcContributionScore(nfts []*NftStacking) float64 {
score = baseScore * (1 + rate) score = baseScore * (1 + rate)
return score return score
} }
func Test() {
f5.GetApp().GetRealMills()
}

View File

@ -1,14 +1,63 @@
package task package task
import ( import (
"f5"
"main/constant"
"jccommon"
"fmt"
) )
type chainActivity struct { type chainActivity struct {
} }
type lockReturnValues struct {
Nft string `json:"nft"`
Sender string `json:"sender"`
To string `json:"to"`
TokenIds []string `json:"tokenIds"`
}
type unLockReturnValues struct {
Nft string `json:"nft"`
User string `json:"user"`
NftList []interface{} `json:"nftList"`
}
func (this* chainActivity) init() { func (this* chainActivity) init() {
go this.process()
} }
func (this* chainActivity) unInit() { func (this* chainActivity) unInit() {
} }
func (this* chainActivity) process() {
f5.GetGoStyleDb().LoopLoad(
constant.BCNFT_DB,
"chainActivity",
"t_blockchain_event",
func () int64 {
return 60 * 1
},
func (lastIdx int64) string {
sql := fmt.Sprintf(`
SELECT * FROM t_blockchain_event WHERE idx > %d AND item_id = 0 AND token_type <> %d ORDER BY idx LIMIT 1000`,
lastIdx,
jccommon.NFT_TYPE_FOUNDER_TAG,
)
return sql
},
[]string{
},
func () int64 {
return 10
},
func () int64 {
return 60 * 5
},
this.repairNft)
}
func (this* chainActivity) repairNft(ds *f5.DataSet) bool {
return true
}

View File

@ -19,13 +19,13 @@ func (this *taskMgr) Init() {
this.sysMail.init() this.sysMail.init()
this.repairOrder.init() this.repairOrder.init()
//this.refreshMeta.init() //this.refreshMeta.init()
//this.contribution.init() this.contribution.init()
this.chainActivity.init() this.chainActivity.init()
} }
func (this *taskMgr) UnInit() { func (this *taskMgr) UnInit() {
this.chainActivity.unInit() this.chainActivity.unInit()
//this.contribution.unInit() this.contribution.unInit()
//this.refreshMeta.unInit() //this.refreshMeta.unInit()
this.repairOrder.unInit() this.repairOrder.unInit()
this.sysMail.unInit() this.sysMail.unInit()

2
third_party/q5 vendored

@ -1 +1 @@
Subproject commit db5e6157047ccd3782d5b00013fe0ee660feddb0 Subproject commit ccfa6c4f99237a18799b65f9d19686be8342bbe0