mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-07 10:00:25 +08:00
阶段性提交
This commit is contained in:
28
internal/db/models/metrics/metric_stat_dao.go
Normal file
28
internal/db/models/metrics/metric_stat_dao.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package metrics
|
||||
|
||||
import (
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
"github.com/iwind/TeaGo/Tea"
|
||||
"github.com/iwind/TeaGo/dbs"
|
||||
)
|
||||
|
||||
type MetricStatDAO dbs.DAO
|
||||
|
||||
func NewMetricStatDAO() *MetricStatDAO {
|
||||
return dbs.NewDAO(&MetricStatDAO{
|
||||
DAOObject: dbs.DAOObject{
|
||||
DB: Tea.Env,
|
||||
Table: "edgeMetricStats",
|
||||
Model: new(MetricStat),
|
||||
PkName: "id",
|
||||
},
|
||||
}).(*MetricStatDAO)
|
||||
}
|
||||
|
||||
var SharedMetricStatDAO *MetricStatDAO
|
||||
|
||||
func init() {
|
||||
dbs.OnReady(func() {
|
||||
SharedMetricStatDAO = NewMetricStatDAO()
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user