mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-23 23:10:26 +08:00
重新实现套餐相关功能
This commit is contained in:
28
internal/db/models/user_plan_stat_dao.go
Normal file
28
internal/db/models/user_plan_stat_dao.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
"github.com/iwind/TeaGo/Tea"
|
||||
"github.com/iwind/TeaGo/dbs"
|
||||
)
|
||||
|
||||
type UserPlanStatDAO dbs.DAO
|
||||
|
||||
func NewUserPlanStatDAO() *UserPlanStatDAO {
|
||||
return dbs.NewDAO(&UserPlanStatDAO{
|
||||
DAOObject: dbs.DAOObject{
|
||||
DB: Tea.Env,
|
||||
Table: "edgeUserPlanStats",
|
||||
Model: new(UserPlanStat),
|
||||
PkName: "id",
|
||||
},
|
||||
}).(*UserPlanStatDAO)
|
||||
}
|
||||
|
||||
var SharedUserPlanStatDAO *UserPlanStatDAO
|
||||
|
||||
func init() {
|
||||
dbs.OnReady(func() {
|
||||
SharedUserPlanStatDAO = NewUserPlanStatDAO()
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user