Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OAuthCredential ¶
type RegisterParams ¶
type RegisterParams struct { Username string `json:"username"` Email string `json:"email"` Password string `json:"password"` }
RegisterParams 定义注册参数结构体
type TwoFactorSetting ¶
type User ¶
type User struct { gorm.Model // Includes ID, CreatedAt, UpdatedAt, DeletedAt fields Username string `gorm:"uniqueIndex;not null"` Email string `gorm:"uniqueIndex;not null"` PasswordHash string `gorm:"not null"` TwoFactorID uint `gorm:"column:two_factor_setting_id"` // Reference to two-factor settings }
User 定义了用户账号管理模块的模型
func (*User) BeforeCreate ¶
BeforeCreate 是Gorm的hook,在创建记录前调用
Click to show internal directories.
Click to hide internal directories.