mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 08:11:49 +08:00
优化 IpPool
This commit is contained in:
@@ -19,11 +19,14 @@ func GetXdb() *xorm.Engine {
|
||||
func initDb() {
|
||||
var err error
|
||||
xdb, err = xorm.NewEngine(base.Cfg.DbType, base.Cfg.DbSource)
|
||||
// xdb.ShowSQL(true)
|
||||
if err != nil {
|
||||
base.Fatal(err)
|
||||
}
|
||||
|
||||
if base.Cfg.ShowSQL {
|
||||
xdb.ShowSQL(true)
|
||||
}
|
||||
|
||||
// 初始化数据库
|
||||
err = xdb.Sync2(&User{}, &Setting{}, &Group{}, &IpMap{}, &AccessAudit{}, &Policy{}, &StatsNetwork{}, &StatsCpu{}, &StatsMem{}, &StatsOnline{})
|
||||
if err != nil {
|
||||
|
@@ -47,7 +47,7 @@ type IpMap struct {
|
||||
Keep bool `json:"keep" xorm:"Bool"` // 保留 ip-mac 绑定
|
||||
KeepTime time.Time `json:"keep_time" xorm:"DateTime"`
|
||||
Note string `json:"note" xorm:"varchar(255)"` // 备注
|
||||
LastLogin time.Time `json:"last_login" xorm:"DateTime updated"`
|
||||
LastLogin time.Time `json:"last_login" xorm:"DateTime"`
|
||||
UpdatedAt time.Time `json:"updated_at" xorm:"DateTime updated"`
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user