实现用户通过邮件重置密码功能

This commit is contained in:
GoEdgeLab
2022-12-10 15:57:17 +08:00
parent b402bed15c
commit ea6b1bcbfb
8 changed files with 142 additions and 8 deletions

View 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 UserVerifyCodeDAO dbs.DAO
func NewUserVerifyCodeDAO() *UserVerifyCodeDAO {
return dbs.NewDAO(&UserVerifyCodeDAO{
DAOObject: dbs.DAOObject{
DB: Tea.Env,
Table: "edgeUserVerifyCodes",
Model: new(UserVerifyCode),
PkName: "id",
},
}).(*UserVerifyCodeDAO)
}
var SharedUserVerifyCodeDAO *UserVerifyCodeDAO
func init() {
dbs.OnReady(func() {
SharedUserVerifyCodeDAO = NewUserVerifyCodeDAO()
})
}