libcore/models/users.go

32 lines
1.0 KiB
Go

package models
import "time"
type User struct {
Id string `gorm:"primaryKey;type:varchar(36)"`
OrganizationId string `gorm:"type:varchar(36)"`
State uint8 `gorm:"type:tinyint(1)"`
Disabled bool `gorm:"type:tinyint(1)"`
RoleId string `gorm:"type:varchar(36)"`
FirstName string `gorm:"type:varchar(255)"`
LastName string `gorm:"type:varchar(255)"`
Email string `gorm:"type:varchar(255)"`
Password string `gorm:"type:varchar(255)"`
ProfilePictureUrl string `gorm:"type:varchar(255)"`
LastOnlineAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
}
type UserSession struct {
Id string `gorm:"primaryKey;type:varchar(36)"`
UserId string `gorm:"type:varchar(36)"`
OrganizationId string `gorm:"type:varchar(36)"`
Session string `gorm:"type:varchar(36)"`
UserAgent string `gorm:"type:varchar(255)"`
ExpiresAt time.Time
LastUsedAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
}