implement email verification feature, add captcha validation middleware, and enhance user authentication flow

This commit is contained in:
2025-07-22 08:50:16 +08:00
parent 6187425df6
commit a0d215fa2e
26 changed files with 844 additions and 50 deletions

View File

@ -1,6 +1,9 @@
package model
import "gorm.io/gorm"
import (
"github.com/snowykami/neo-blog/internal/dto"
"gorm.io/gorm"
)
type User struct {
gorm.Model
@ -13,3 +16,14 @@ type User struct {
Password string // 密码,存储加密后的值
}
func (user *User) ToDto() *dto.UserDto {
return &dto.UserDto{
Username: user.Username,
Nickname: user.Nickname,
AvatarUrl: user.AvatarUrl,
Email: user.Email,
Gender: user.Gender,
Role: user.Role,
}
}