mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-08 03:00:26 +08:00
29 lines
505 B
Go
29 lines
505 B
Go
package models
|
|
|
|
import (
|
|
_ "github.com/go-sql-driver/mysql"
|
|
"github.com/iwind/TeaGo/Tea"
|
|
"github.com/iwind/TeaGo/dbs"
|
|
)
|
|
|
|
type ServerStatDAO dbs.DAO
|
|
|
|
func NewServerStatDAO() *ServerStatDAO {
|
|
return dbs.NewDAO(&ServerStatDAO{
|
|
DAOObject: dbs.DAOObject{
|
|
DB: Tea.Env,
|
|
Table: "edgeServerStats",
|
|
Model: new(ServerStat),
|
|
PkName: "id",
|
|
},
|
|
}).(*ServerStatDAO)
|
|
}
|
|
|
|
var SharedServerStatDAO *ServerStatDAO
|
|
|
|
func init() {
|
|
dbs.OnReady(func() {
|
|
SharedServerStatDAO = NewServerStatDAO()
|
|
})
|
|
}
|