models

package
v0.0.0-...-2d7ab85 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type RegisterRequest

type RegisterRequest struct {
	FirstName  string `json:"first_name"`
	SecondName string `json:"second_name"`
	Username   string `json:"username"`
	Email      string `json:"email"`
	Password   string `json:"password"`
}

type User

type User struct {
	gorm.Model
	Email         string  `gorm:"index:email,unique;not null" json:"email"`
	FirstName     string  `gorm:"column:first_name;not null" json:"first_name"`
	SecondName    string  `gorm:"column:second_name;not null" json:"second_name"`
	Username      string  `gorm:"index:username,unique;not null" json:"username"`
	Password      string  `gorm:"column:password; not null" json:"password"`
	Phone         *string `gorm:"index:phone;unique" json:"phone"`
	FirebaseToken string  `gorm:"column:firebase_token" json:"firebase_token"`
}

func (*User) CheckPassword

func (user *User) CheckPassword(providedPassword string) error

func (*User) HashPassword

func (user *User) HashPassword(password string) error

Jump to

Keyboard shortcuts

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