From 4ee6513d2bd88c45da28262bb24fdc9a81619839 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 23 Jul 2024 11:46:47 +0800 Subject: [PATCH] 1 --- server/jccommon/utils.go | 5 ++ server/light_backtask/task/chain_activity.go | 49 ++++++++++++++++++++ server/light_backtask/task/taskmgr.go | 4 +- third_party/q5 | 2 +- 4 files changed, 57 insertions(+), 3 deletions(-) diff --git a/server/jccommon/utils.go b/server/jccommon/utils.go index c7052a51..6f252eee 100644 --- a/server/jccommon/utils.go +++ b/server/jccommon/utils.go @@ -1,6 +1,7 @@ package jccommon import ( + "f5" "strconv" ) @@ -84,3 +85,7 @@ func CalcContributionScore(nfts []*NftStacking) float64 { score = baseScore * (1 + rate) return score } + +func Test() { + f5.GetApp().GetRealMills() +} diff --git a/server/light_backtask/task/chain_activity.go b/server/light_backtask/task/chain_activity.go index 8a3221ca..395f4d08 100644 --- a/server/light_backtask/task/chain_activity.go +++ b/server/light_backtask/task/chain_activity.go @@ -1,14 +1,63 @@ package task import ( + "f5" + "main/constant" + "jccommon" + "fmt" ) 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() { + go this.process() } 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 +} diff --git a/server/light_backtask/task/taskmgr.go b/server/light_backtask/task/taskmgr.go index d359400c..ec15dcea 100644 --- a/server/light_backtask/task/taskmgr.go +++ b/server/light_backtask/task/taskmgr.go @@ -19,13 +19,13 @@ func (this *taskMgr) Init() { this.sysMail.init() this.repairOrder.init() //this.refreshMeta.init() - //this.contribution.init() + this.contribution.init() this.chainActivity.init() } func (this *taskMgr) UnInit() { this.chainActivity.unInit() - //this.contribution.unInit() + this.contribution.unInit() //this.refreshMeta.unInit() this.repairOrder.unInit() this.sysMail.unInit() diff --git a/third_party/q5 b/third_party/q5 index db5e6157..ccfa6c4f 160000 --- a/third_party/q5 +++ b/third_party/q5 @@ -1 +1 @@ -Subproject commit db5e6157047ccd3782d5b00013fe0ee660feddb0 +Subproject commit ccfa6c4f99237a18799b65f9d19686be8342bbe0