27 lines
470 B
Go
27 lines
470 B
Go
package web
|
|
|
|
import (
|
|
"code.mrmelon54.com/melon/summer/pkg/utils"
|
|
)
|
|
|
|
type HttpRedirect struct {
|
|
Id uint64 `json:"id" xorm:"pk autoincr"`
|
|
Src string `json:"address"`
|
|
Target string `json:"target"`
|
|
Enabled *bool `json:"enabled"`
|
|
}
|
|
|
|
func (h HttpRedirect) GetId() uint64 {
|
|
return h.Id
|
|
}
|
|
|
|
func (h HttpRedirect) SetEnabled(v bool) HttpRedirect {
|
|
h.Enabled = utils.PBool(v)
|
|
return h
|
|
}
|
|
|
|
func (h HttpRedirect) ClearForNew() HttpRedirect {
|
|
h.Id = 0
|
|
return h
|
|
}
|