reCoreD-UI/models/settings.go
2024-04-19 09:44:37 +08:00

31 lines
535 B
Go

package models
import (
"fmt"
)
const (
SettingsKeyAdminUsername = "admin.username"
SettingsKeyAdminPassword = "admin.password"
SettingsKeyDNSServer = "dns.servers"
)
type Settings struct {
ID uint `gorm:"primaryKey"`
Key string `gorm:"unique;not null;size:255"`
Value string `gorm:"not null;size:255"`
}
func (s *Settings) String() string {
return fmt.Sprintf("%s: %s", s.Key, s.Value)
}
func (s *Settings) GetValue() Settings {
return *s
}
type ISettings interface {
String() string
GetValue() Settings
}