Skip to content

Commit

Permalink
fix: solana显示
Browse files Browse the repository at this point in the history
  • Loading branch information
liangjies committed Oct 9, 2023
1 parent 1237a1f commit 11dee27
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions internal/app/api/v1/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions internal/app/initialize/gorm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 11dee27

Please sign in to comment.