Skip to content

Commit

Permalink
camelCase JSON parameter names in Connection and Account db models
Browse files Browse the repository at this point in the history
  • Loading branch information
Neur0toxine authored Jun 6, 2022
2 parents ea1c7b7 + b0c2ca5 commit 873d1e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/db/models/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down
12 changes: 6 additions & 6 deletions core/db/models/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
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:"mgUrl,omitempty" binding:"max=255"`
GateToken string `gorm:"column:mg_token; type:varchar(100); not null; unique" json:"mgToken,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"`
}

0 comments on commit 873d1e3

Please sign in to comment.