From 11dee27e4aa1da8262990a370f26523e0d199e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E6=96=87=E6=9D=B0?= <1139629972@qq.com> Date: Mon, 9 Oct 2023 16:52:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20solana=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/app/api/v1/account.go | 14 +++++++------- internal/app/initialize/gorm.go | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/app/api/v1/account.go b/internal/app/api/v1/account.go index 3b3ac61..f2a6a1c 100644 --- a/internal/app/api/v1/account.go +++ b/internal/app/api/v1/account.go @@ -56,18 +56,18 @@ func GetCollection(c *gin.Context) { func GetContract(c *gin.Context) { address := c.Param("address") account := c.GetString("address") - if utils.IsValidSolanaAddress(address) { - response.OkWithDetailed(nil, "Success", c) - return - if list, err := service.GetSolanaContract(address, account); err != nil { + if utils.IsValidAddress(address) { + address = strings.ToLower(address) + if list, err := service.GetContract(address, account); err != nil { global.LOG.Error("Error!", zap.Error(err)) response.FailWithMessage("Error", c) } else { response.OkWithDetailed(list, "Success", c) } - } else if utils.IsValidAddress(address) { - address = strings.ToLower(address) - if list, err := service.GetContract(address, account); err != nil { + } else if utils.IsValidSolanaAddress(address) { + response.OkWithDetailed(nil, "Success", c) + return + if list, err := service.GetSolanaContract(address, account); err != nil { global.LOG.Error("Error!", zap.Error(err)) response.FailWithMessage("Error", c) } else { diff --git a/internal/app/initialize/gorm.go b/internal/app/initialize/gorm.go index 1400caa..c618110 100644 --- a/internal/app/initialize/gorm.go +++ b/internal/app/initialize/gorm.go @@ -25,8 +25,8 @@ func RegisterTables(db *gorm.DB) { model.Account{}, model.ContractDefault{}, model.Ens{}, - model.CollectionSolana{}, - model.ContractSolana{}, + //model.CollectionSolana{}, + //model.ContractSolana{}, ) if err != nil { global.LOG.Error("register table failed", zap.Error(err))