mirror of
https://github.com/Awuqing/BackupX.git
synced 2026-05-12 02:20:36 +08:00
19 lines
594 B
Go
19 lines
594 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
type User struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
Username string `gorm:"size:64;uniqueIndex;not null" json:"username"`
|
|
PasswordHash string `gorm:"column:password_hash;not null" json:"-"`
|
|
DisplayName string `gorm:"size:128;not null" json:"displayName"`
|
|
Email string `gorm:"size:255" json:"email"`
|
|
Role string `gorm:"size:32;not null;default:admin" json:"role"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
func (User) TableName() string {
|
|
return "users"
|
|
}
|