swagger done

This commit is contained in:
Sense T
2024-04-19 12:47:00 +08:00
parent 34fb2a478b
commit 47335ca5e9
15 changed files with 2801 additions and 21 deletions

View File

@@ -5,11 +5,11 @@ import (
"strings"
)
// Domain domain data structure
type Domain struct {
ID uint `gorm:"primaryKey" json:"id"`
DomainName string `gorm:"unique,not null,size:255" json:"domain_name"`
//SOA Info
MainDNS string `gorm:"not null;size:255" json:"main_dns"`
AdminEmail string `gorm:"not null;size:255" json:"admin_email"`
SerialNumber int64 `gorm:"not null;default:1" json:"serial_number"`

View File

@@ -24,11 +24,13 @@ type recordContentTypes interface {
ARecord | AAAARecord | CNAMERecord | CAARecord | NSRecord | MXRecord | SOARecord | SRVRecord | TXTRecord | RecordContentDefault
}
// Record dns records for coredns mysql plugin
type Record[T recordContentTypes] struct {
ID uint `gorm:"primaryKey" json:"id"`
Zone string `gorm:"not null;size:255" json:"zone"`
Name string `gorm:"not null;size:255" json:"name"`
Ttl int `json:"ttl"`
ID uint `gorm:"primaryKey" json:"id"`
Zone string `gorm:"not null;size:255" json:"zone"`
Name string `gorm:"not null;size:255" json:"name"`
Ttl int `json:"ttl"`
// see https://github.com/cloud66-oss/coredns_mysql/blob/main/types.go for content
Content T `gorm:"serializer:json;type:text" json:"content"`
RecordType string `gorm:"not null;size:255" json:"record_type"`
}

View File

@@ -10,6 +10,7 @@ const (
SettingsKeyDNSServer = "dns.servers"
)
// Settings settings for this app
type Settings struct {
ID uint `gorm:"primaryKey"`
Key string `gorm:"unique;not null;size:255"`