mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-03 15:00:27 +08:00
34 lines
579 B
Go
34 lines
579 B
Go
package nameservers
|
|
|
|
import (
|
|
_ "github.com/go-sql-driver/mysql"
|
|
"github.com/iwind/TeaGo/Tea"
|
|
"github.com/iwind/TeaGo/dbs"
|
|
)
|
|
|
|
const (
|
|
NSDomainStateEnabled = 1 // 已启用
|
|
NSDomainStateDisabled = 0 // 已禁用
|
|
)
|
|
|
|
type NSDomainDAO dbs.DAO
|
|
|
|
func NewNSDomainDAO() *NSDomainDAO {
|
|
return dbs.NewDAO(&NSDomainDAO{
|
|
DAOObject: dbs.DAOObject{
|
|
DB: Tea.Env,
|
|
Table: "edgeNSDomains",
|
|
Model: new(NSDomain),
|
|
PkName: "id",
|
|
},
|
|
}).(*NSDomainDAO)
|
|
}
|
|
|
|
var SharedNSDomainDAO *NSDomainDAO
|
|
|
|
func init() {
|
|
dbs.OnReady(func() {
|
|
SharedNSDomainDAO = NewNSDomainDAO()
|
|
})
|
|
}
|