diff --git a/core/db/models/account.go b/core/db/models/account.go index 6bd3e0c..c03f244 100644 --- a/core/db/models/account.go +++ b/core/db/models/account.go @@ -10,7 +10,7 @@ type Account struct { Name string `gorm:"column:name; type:varchar(100)" json:"name,omitempty" binding:"max=100"` Lang string `gorm:"column:lang; type:varchar(2)" json:"lang,omitempty" binding:"max=2"` Channel uint64 `gorm:"column:channel; not null; unique" json:"channel,omitempty"` - ID int `gorm:"primary_key"` + ID int `gorm:"primary_key" json:"id"` ConnectionID int `gorm:"column:connection_id" json:"connectionId,omitempty"` } diff --git a/core/db/models/connection.go b/core/db/models/connection.go index 3bc8512..15fbf0c 100644 --- a/core/db/models/connection.go +++ b/core/db/models/connection.go @@ -6,12 +6,12 @@ import "time" type Connection struct { CreatedAt time.Time UpdatedAt time.Time - Key string `gorm:"column:api_key; type:varchar(100); not null" json:"api_key,omitempty" binding:"required,max=100"` // nolint:lll - URL string `gorm:"column:api_url; type:varchar(255); not null" json:"api_url,omitempty" binding:"required,validateCrmURL,max=255"` // nolint:lll + Key string `gorm:"column:api_key; type:varchar(100); not null" json:"apiKey,omitempty" binding:"required,max=100"` // nolint:lll + URL string `gorm:"column:api_url; type:varchar(255); not null" json:"apiUrl,omitempty" binding:"required,validateCrmURL,max=255"` // nolint:lll GateURL string `gorm:"column:mg_url; type:varchar(255); not null;" json:"mg_url,omitempty" binding:"max=255"` GateToken string `gorm:"column:mg_token; type:varchar(100); not null; unique" json:"mg_token,omitempty" binding:"max=100"` // nolint:lll ClientID string `gorm:"column:client_id; type:varchar(70); not null; unique" json:"clientId,omitempty"` - Accounts []Account `gorm:"foreignkey:ConnectionID"` - ID int `gorm:"primary_key"` + Accounts []Account `gorm:"foreignkey:ConnectionID" json:"accounts"` + ID int `gorm:"primary_key" json:"id"` Active bool `json:"active,omitempty"` }