完善logic.tpl的错误
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
package model
|
||||
|
||||
import "github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
var _ FsUserModel = (*customFsUserModel)(nil)
|
||||
|
||||
@@ -9,6 +14,7 @@ type (
|
||||
// and implement the added methods in customFsUserModel.
|
||||
FsUserModel interface {
|
||||
fsUserModel
|
||||
UpdateVerificationToken(ctx context.Context, userid int64, token string) error
|
||||
}
|
||||
|
||||
customFsUserModel struct {
|
||||
@@ -22,3 +28,9 @@ func NewFsUserModel(conn sqlx.SqlConn) FsUserModel {
|
||||
defaultFsUserModel: newFsUserModel(conn),
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultFsUserModel) UpdateVerificationToken(ctx context.Context, userid int64, verificationToken string) error {
|
||||
query := fmt.Sprintf("update %s set `verification_token` = ? where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, verificationToken, userid)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user