Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobeyw committed Dec 19, 2023
1 parent 75e5df3 commit 5b00550
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion neo3fura_http/biz/api/src.GetNFTRecordByContractHashTokenId.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
"neo3fura_http/lib/log"
"neo3fura_http/lib/type/h160"
"neo3fura_http/lib/type/strval"
"neo3fura_http/var/stderr"
Expand Down Expand Up @@ -45,6 +46,7 @@ func (me *T) GetNFTRecordByContractHashTokenId(args struct {
Query: []string{},
}, ret)
if err != nil {
log.Info("1", err)
return err
}

Expand All @@ -59,6 +61,7 @@ func (me *T) GetNFTRecordByContractHashTokenId(args struct {
Raw *[]map[string]interface{}
}{ContractHash: args.ContractHash, TokenId: args.TokenId, Raw: &raw2}, ret)
if err3 != nil {
log.Info("2", err)
return err3
}

Expand All @@ -67,7 +70,7 @@ func (me *T) GetNFTRecordByContractHashTokenId(args struct {

var raw3 map[string]interface{}
err2 := getNFTProperties(strval.T(tokenid), h160.T(asset), me, ret, args.Filter, &raw3)

log.Info("3", err2)
for _, item := range raw2 {
tobanlance := item["tobalance"].(primitive.Decimal128).String()

Expand Down Expand Up @@ -96,6 +99,7 @@ func (me *T) GetNFTRecordByContractHashTokenId(args struct {
if eventname == "Claim" {
bidAmount, err1 := strconv.ParseInt(dat["bidAmount"].(string), 10, 64)
if err1 != nil {
log.Info("4", err)
return err1
}
rr["from"] = item["from"]
Expand All @@ -107,6 +111,7 @@ func (me *T) GetNFTRecordByContractHashTokenId(args struct {
} else if eventname == "CompleteOffer" || eventname == "CompleteOfferCollection" {
offerAmount, err1 := strconv.ParseInt(dat["offerAmount"].(string), 10, 64)
if err1 != nil {
log.Info("5", err)
return err1
}
rr["offerAsset"] = dat["offerAsset"]
Expand All @@ -117,6 +122,7 @@ func (me *T) GetNFTRecordByContractHashTokenId(args struct {
}

} else {
log.Info("6", err)
return err2
}

Expand Down Expand Up @@ -156,12 +162,14 @@ func (me *T) GetNFTRecordByContractHashTokenId(args struct {
if fromAddress != "" {
fromNNS, fromUserName, err = GetNNSByAddress(fromAddress)
if err != nil {
log.Info("7", err)
return err
}
}
if toAddress != "" {
toNNS, toUserName, err = GetNNSByAddress(toAddress)
if err != nil {
log.Info("8", err)
return err
}
}
Expand Down

0 comments on commit 5b00550

Please sign in to comment.