16 lines
434 B
Go
16 lines
434 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type User struct {
|
|
ID string `json:"id" gorm:"primaryKey"`
|
|
Username string `json:"username" gorm:"uniqueIndex;not null"`
|
|
Password string `json:"-" gorm:"not null"`
|
|
Email string `json:"email" gorm:"uniqueIndex;not null"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
Roles []Role `json:"roles" gorm:"many2many:user_roles;"`
|
|
}
|