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 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) {