mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
8efc3854ab
refactor: language mappings implementation
18 lines
542 B
Go
18 lines
542 B
Go
package models
|
|
|
|
type LanguageMapping struct {
|
|
ID uint `json:"id" gorm:"primary_key"`
|
|
User *User `json:"-" gorm:"not null"`
|
|
UserID string `json:"-" gorm:"not null; index:idx_language_mapping_user; uniqueIndex:idx_language_mapping_composite"`
|
|
Extension string `json:"extension" gorm:"uniqueIndex:idx_language_mapping_composite"`
|
|
Language string `json:"language"`
|
|
}
|
|
|
|
func validateLanguage(language string) bool {
|
|
return len(language) >= 1
|
|
}
|
|
|
|
func validateExtension(extension string) bool {
|
|
return len(extension) >= 1
|
|
}
|