28 lines
524 B
Go
28 lines
524 B
Go
package web
|
|
|
|
import (
|
|
"code.mrmelon54.com/melon/summer/pkg/utils"
|
|
)
|
|
|
|
type ApiDomain struct {
|
|
Id uint64 `json:"id" xorm:"pk autoincr"`
|
|
Domain string `json:"domain"`
|
|
DstHome string `json:"dst_home"`
|
|
Enabled *bool `json:"enabled"`
|
|
LiveRoutes []ApiRoute `json:"-" xorm:"-"`
|
|
}
|
|
|
|
func (a ApiDomain) GetId() uint64 {
|
|
return a.Id
|
|
}
|
|
|
|
func (a ApiDomain) SetEnabled(v bool) ApiDomain {
|
|
a.Enabled = utils.PBool(v)
|
|
return a
|
|
}
|
|
|
|
func (a ApiDomain) ClearForNew() ApiDomain {
|
|
a.Id = 0
|
|
return a
|
|
}
|