reCoreD-UI/models/settings.go
2024-04-11 11:41:33 +08:00

28 lines
454 B
Go

package models
import (
"fmt"
"gorm.io/gorm"
)
const (
SettingsKeyAdminUsername = "admin.username"
SettingsKeyAdminPassword = "admin.password"
SettingsKeyDNSServer = "dns.servers"
)
type Settings struct {
gorm.Model
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)
}
type ISettings interface {
String() string
}