18 lines
285 B
Go
18 lines
285 B
Go
package auth
|
|
|
|
import "gorm.io/gorm"
|
|
|
|
type Role string
|
|
|
|
const (
|
|
RoleAdmin Role = "admin"
|
|
RoleUser Role = "user"
|
|
)
|
|
|
|
type User struct {
|
|
gorm.Model
|
|
Username string `gorm:"uniqueIndex;not null"`
|
|
PasswordHash string `gorm:"not null"`
|
|
Role Role `gorm:"default:'user'"`
|
|
}
|