Files
a301_server/internal/auth/model.go
2026-02-24 13:18:43 +09:00

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'"`
}