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