This commit is contained in:
aozhiwei 2024-07-10 14:30:36 +08:00
parent d92d39e216
commit 675eb5c7be

View File

@ -63,7 +63,6 @@ func (this* goldBullionReturn) returnGold(ds *f5.DataSet) bool {
} }
contractAddress := contractMeta.GetAddress() contractAddress := contractMeta.GetAddress()
tokenId := ds.GetByName("token_id") tokenId := ds.GetByName("token_id")
tokenId = "1076969088010093"
f5.GetSysLog().Info("returnGold net:%d accountId:%s contract_address:%s tokenId: %s", f5.GetSysLog().Info("returnGold net:%d accountId:%s contract_address:%s tokenId: %s",
netId, accountId, contractAddress, tokenId) netId, accountId, contractAddress, tokenId)
{ {
@ -77,26 +76,25 @@ func (this* goldBullionReturn) returnGold(ds *f5.DataSet) bool {
mt.Table.Config.GetById(0).GetChainName(), mt.Table.Config.GetById(0).GetChainName(),
contractAddress, contractAddress,
tokenId) tokenId)
var httpErr error rsp, data, err := q5.HttpGetEx2(url, map[string]string{})
f5.GetHttpCliMgr().SendGoStyleRequest( if err != nil {
url,
map[string]string{},
func (rsp f5.HttpCliResponse) {
httpErr = rsp.GetErr()
if rsp.GetErr() != nil {
f5.GetSysLog().Info("returnGold immutable api:%s request error:%s", f5.GetSysLog().Info("returnGold immutable api:%s request error:%s",
url, url,
rsp.GetErr()) err)
return return true
} }
if err := q5.DecodeJson(rsp.GetRawData(), &rspObj); err != nil { f5.GetSysLog().Info("returnGold immutable api:%s statusCode:%d body:%s",
url,
rsp.StatusCode,
data)
if rsp.StatusCode != 404 {
return true
}
if rsp.StatusCode == 200 {
if err := q5.DecodeJson(data, &rspObj); err != nil {
f5.GetSysLog().Info("returnGold immutable api:%s decodeJson error:%s", f5.GetSysLog().Info("returnGold immutable api:%s decodeJson error:%s",
url, url,
err) err)
return
}
})
if httpErr != nil {
return true return true
} }
if rspObj.Result.TokenId == tokenId { if rspObj.Result.TokenId == tokenId {
@ -105,6 +103,8 @@ func (this* goldBullionReturn) returnGold(ds *f5.DataSet) bool {
return true return true
} }
} }
}
return true return true
//return service.ReturnGoldBullion(accountId, netId, tokenId) //return service.ReturnGoldBullion(accountId, netId, tokenId)
} }