This commit is contained in:
aozhiwei 2024-07-20 21:26:29 +08:00
parent 6947326c51
commit 3ac85e6688
2 changed files with 18 additions and 18 deletions

View File

@ -67,3 +67,12 @@ type MailEvent struct {
func (MailEvent) TableName() string {
return "t_event"
}
type NftStacking struct {
NetId int32
ContractAddress string
TokenType int32
TokenId string
ItemId int32
Quality int32
}

View File

@ -14,18 +14,9 @@ type contribution struct {
lockMetas []*mt.Contract
}
type nftStacking struct {
netId int32
contractAddress string
tokenType int32
tokenId string
itemId int32
quality int32
}
type accountStacking struct {
accountAddress string
nfts []*nftStacking
nfts []*jccommon.NftStacking
}
func (this* contribution) init() {
@ -117,19 +108,19 @@ func (this* contribution) loadFromDb(addressHash *q5.ConcurrentMap[string, *acco
if accountAddress == "" {
return true
}
p := new(nftStacking)
p.netId = q5.ToInt32(ds.GetByName("net_id"))
p.contractAddress = ds.GetByName("contract_address")
p.tokenType = q5.ToInt32(ds.GetByName("token_type"))
p.tokenId = ds.GetByName("token_id")
p.itemId = q5.ToInt32(ds.GetByName("item_id"))
p.quality = q5.ToInt32(ds.GetByName("quality"))
p := new(jccommon.NftStacking)
p.NetId = q5.ToInt32(ds.GetByName("net_id"))
p.ContractAddress = ds.GetByName("contract_address")
p.TokenType = q5.ToInt32(ds.GetByName("token_type"))
p.TokenId = ds.GetByName("token_id")
p.ItemId = q5.ToInt32(ds.GetByName("item_id"))
p.Quality = q5.ToInt32(ds.GetByName("quality"))
if a, ok := addressHash.Load(accountAddress); ok {
q5.AppendSlice(&(*a).nfts, p)
} else {
a := new(accountStacking)
a.accountAddress = accountAddress
a.nfts = []*nftStacking{}
a.nfts = []*jccommon.NftStacking{}
q5.AppendSlice(&a.nfts, p)
}
return true