models

package
v0.0.0-...-421b44c Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteUserById

func DeleteUserById(uuid string) map[string]interface{}

func GetAllUsers

func GetAllUsers() map[string]interface{}

func Login

func Login(login *UserLogin) (resp map[string]interface{}, token string)

Types

type User

type User struct {
	gorm.Model

	ID        string `gorm:"type:uuid;default:gen_random_uuid()" json:"id"`
	Name      string `gorm:"not null;type:varchar(150)" json:"name"`
	Email     string `gorm:"unique;not null;type:varchar(100);default:null" json:"email"`
	Password  string `gorm:"not null" json:"password"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt
}

func GetUserByEmail

func GetUserByEmail(email string) *User

func GetUserByID

func GetUserByID(uuid string) *User

func (*User) Create

func (user *User) Create() map[string]interface{}

func (*User) Validate

func (user *User) Validate() (map[string]interface{}, bool)

type UserLogin

type UserLogin struct {
	Email    string `gorm:"unique;not null;type:varchar(100);default:null" json:"email"`
	Password string `gorm:"not null" json:"password"`
}

Jump to

Keyboard shortcuts

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