mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-05 17:40:24 +08:00
32 lines
598 B
Go
32 lines
598 B
Go
package authority
|
|
|
|
import (
|
|
_ "github.com/go-sql-driver/mysql"
|
|
"github.com/iwind/TeaGo/Tea"
|
|
"github.com/iwind/TeaGo/dbs"
|
|
)
|
|
|
|
type AuthorityKeyDAO dbs.DAO
|
|
|
|
func NewAuthorityKeyDAO() *AuthorityKeyDAO {
|
|
return dbs.NewDAO(&AuthorityKeyDAO{
|
|
DAOObject: dbs.DAOObject{
|
|
DB: Tea.Env,
|
|
Table: "edgeAuthorityKeys",
|
|
Model: new(AuthorityKey),
|
|
PkName: "id",
|
|
},
|
|
}).(*AuthorityKeyDAO)
|
|
}
|
|
|
|
var SharedAuthorityKeyDAO *AuthorityKeyDAO
|
|
|
|
func init() {
|
|
dbs.OnReady(func() {
|
|
SharedAuthorityKeyDAO = NewAuthorityKeyDAO()
|
|
|
|
// 初始化IsPlus值
|
|
_, _ = SharedAuthorityKeyDAO.IsPlus(nil)
|
|
})
|
|
}
|