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