From 675eb5c7bed2382540e9913bda1d590b9f20abe1 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 10 Jul 2024 14:30:36 +0800 Subject: [PATCH] 1 --- server/backtask/task/gold_bullion_return.go | 48 ++++++++++----------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/server/backtask/task/gold_bullion_return.go b/server/backtask/task/gold_bullion_return.go index 19abf3fd..217956d3 100644 --- a/server/backtask/task/gold_bullion_return.go +++ b/server/backtask/task/gold_bullion_return.go @@ -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)