27 lines
568 B
Go
27 lines
568 B
Go
package dao
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
|
|
"36wisdom/biz/consts"
|
|
"36wisdom/common"
|
|
)
|
|
|
|
type adminUserDao struct{ common.BaseDao }
|
|
|
|
var AdminUser = &adminUserDao{BaseDao: common.BaseDao{Table: consts.TableAdminUser}}
|
|
|
|
func (d *adminUserDao) Init(ctx context.Context) error {
|
|
_, err := g.DB().Exec(ctx, `
|
|
CREATE TABLE IF NOT EXISTS admin_user (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
username TEXT UNIQUE NOT NULL,
|
|
password TEXT NOT NULL,
|
|
status INTEGER NOT NULL DEFAULT 1,
|
|
created_at DATETIME
|
|
);`)
|
|
return err
|
|
}
|