diff --git a/internal/entity/invest_account.go b/internal/entity/invest_account.go index f5b9973..fbe7709 100644 --- a/internal/entity/invest_account.go +++ b/internal/entity/invest_account.go @@ -8,13 +8,13 @@ import ( ) type InvestAccount struct { - ID uint `gorm:"primarykey" json:"id"` - IP string `gorm:"type:varchar(16);unique" json:"ip"` - CreatedAt time.Time ` json:"created_at"` - UpdatedAt time.Time ` json:"updated_at"` - DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"` - Code string `gorm:"type:varchar(64);index" json:"code"` - InvestCode InvestCode `gorm:"foreignKey:Code;references:Code" json:"-"` + ID uint `gorm:"primarykey" json:"id"` + IP string `gorm:"type:varchar(16);unique" json:"ip"` + CreatedAt time.Time ` json:"created_at"` + UpdatedAt time.Time ` json:"updated_at"` + DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"` + Code string `gorm:"type:varchar(64);index" json:"code"` + // InvestCode InvestCode `gorm:"foreignKey:Code;references:Code" json:"-"` } // TableName returns the entity table name. diff --git a/internal/entity/invest_code.go b/internal/entity/invest_code.go index d7a9151..91284d9 100644 --- a/internal/entity/invest_code.go +++ b/internal/entity/invest_code.go @@ -5,9 +5,9 @@ import ( ) type InvestCode struct { - Code string `gorm:"primarykey" json:"code"` - SocialNetwork string `gorm:"type:varchar(64)" json:"social_network"` - InvestAccounts []InvestAccount `gorm:"foreignKey:Code;references:Code"` + Code string `gorm:"primarykey" json:"code"` + SocialNetwork string `gorm:"type:varchar(64)" json:"social_network"` + // InvestAccounts []InvestAccount `gorm:"foreignKey:Code;references:Code"` } // TableName returns the entity table name.