This commit is contained in:
aozhiwei 2024-06-16 18:36:45 +08:00
parent 4e9f35300c
commit 7ee0e131a0

View File

@ -65,11 +65,9 @@ func (this *cacheMgr) internalGetNft(dto *common.NftDto) {
},
func (rsp f5.HttpCliResponse) {
if rsp.GetErr() == nil {
p := new(nft)
jsonRsp := map[string]interface{}{}
q5.DecodeJson(rsp.GetRawData(), &jsonRsp)
p.jsonData = jsonRsp
dto.NftCache = p
dto.NftCache = this.addNft(dto.NetId, dto.ContractAddress, dto.TokenId, jsonRsp)
}
})
}
@ -146,7 +144,7 @@ func (this *cacheMgr) batchGetNfts(nfts []*common.NftDto) {
}
func (this *cacheMgr) addNft(netId int32, contractAddress string, tokenId string,
data map[string]interface{}) {
data map[string]interface{}) *nft {
dto := new(common.NftDto)
dto.NetId = netId
dto.ContractAddress = contractAddress
@ -154,4 +152,5 @@ func (this *cacheMgr) addNft(netId int32, contractAddress string, tokenId string
p := newNft()
p.jsonData = data
this.nftHash.Store(dto.GetKey(), p)
return p
}