entity

package
v0.1.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Email

type Email struct {
	gorm.Model
	Uuid           uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()"`
	UserID         uint
	Email          string `gorm:"unique;not null"`
	VerifiedStatus string `gorm:"not null"`
}

func CreateEmail

func CreateEmail(email string) *Email

type Invite

type Invite struct {
	gorm.Model
	Code    string `gorm:"unique;not null"`
	Claimed bool
}

type Password

type Password struct {
	gorm.Model
	Uuid     uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()"`
	UserID   uint
	Password string `gorm:"not null"`
}

type User

type User struct {
	gorm.Model
	Uuid          uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()"`
	CognitoId     uuid.UUID
	Name          string
	Username      string `gorm:"unique;not null"`
	ProfilePic    string
	BioMessage    string
	Role          string `gorm:"default:'user'"`
	IsBanned      bool   `gorm:"default:false"`
	AddressStreet string
	AddressCity   string
	AddressZip    string
	Email         string `gorm:"unique;not null"`
	Password      string `gorm:"not null"`
	Birthday      string
	Verified      bool `gorm:"not null"`
	InviteID      uint
	OTP           string
	Emails        []*Email
	Passwords     []*Password
}

func (*User) ToJson

func (u *User) ToJson() []byte

func (*User) UpdateUserProfileFromModel

func (u *User) UpdateUserProfileFromModel(user *model.User)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL