From 252371b575fdb316384feb8801a7cc07280b5f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E6=96=87=E6=9D=B0?= <1139629972@qq.com> Date: Wed, 27 Sep 2023 10:00:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0NFT=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/app/service/account.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/app/service/account.go b/internal/app/service/account.go index 4ae1c82..3bad272 100644 --- a/internal/app/service/account.go +++ b/internal/app/service/account.go @@ -9,6 +9,7 @@ import ( "nft-collect/internal/app/utils" "nft-collect/pkg/slice" "strings" + "time" ) // GetContract @@ -34,7 +35,10 @@ func GetContract(address, account string) (res []response.GetContractRes, err er dealList = contractDefault } else if address != common.HexToAddress("0").String() { dealList = slice.DiffSlice[string](contractDefault, user.ContractIDs) - go updateAllCollection(address, dealList, false, false) // update all collection + go func() { + time.Sleep(5 * time.Second) + updateAllCollection(address, dealList, false, false) // update all collection + }() } if len(user.ContractIDs) != len(user.Counts) { From 19493fb48e95eb24d93f97733bc0fab4ec2a9efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E6=96=87=E6=9D=B0?= <1139629972@qq.com> Date: Wed, 27 Sep 2023 10:25:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20NFT=E6=95=B0=E9=87=8F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E6=AD=A3=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/app/router/account.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/app/router/account.go b/internal/app/router/account.go index 1c4eadc..ecb8bcf 100644 --- a/internal/app/router/account.go +++ b/internal/app/router/account.go @@ -15,7 +15,7 @@ func InitAccountRouter(Router *gin.RouterGroup) { accountRouterWithAddr.POST("/own/refreshUserData", v1.RefreshUserData) // refresh user data } { - accountRouterWithAuth.GET("/contract/:address", v1.GetCollectionByContract) // Get the NFT data by the Contract + accountRouterWithAddr.GET("/contract/:address", v1.GetCollectionByContract) // Get the NFT data by the Contract } { accountRouterWithAuth.POST("/own/collection", v1.AddCollection) // add collection