model

package
v0.0.0-...-20154b5 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Automigrate

func Automigrate(DB *gorm.DB) error

Types

type User

type User struct {
	gorm.Model
	ID           uint   `gorm:"primaryKey"`
	Name         string `gorm:"not null"`
	Email        string `gorm:"unique;not null"`
	Username     string `gorm:"unique;not null"`
	PasswordHash string `gorm:"not null"`
}

func (*User) GetAPIResponseObject

func (user *User) GetAPIResponseObject() *UserResponse

type UserCreateRequest

type UserCreateRequest struct {
	Name     string `json:"name"`
	Email    string `json:"email"`
	Username string `json:"user_name"`
	Password string `json:"password"`
}

func (*UserCreateRequest) GetDBObject

func (ucr *UserCreateRequest) GetDBObject() *User

type UserResponse

type UserResponse struct {
	ID       uint   `json:"user_id"`
	Name     string `json:"name"`
	Email    string `json:"email"`
	Username string `json:"user_name"`
}

type UserUpdateRequest

type UserUpdateRequest struct {
	ID       uint   `json:"user_id"`
	Name     string `json:"name"`
	Email    string `json:"email"`
	Username string `json:"user_name"`
	Password string `json:"password"`
}

func (*UserUpdateRequest) GetDBObject

func (uur *UserUpdateRequest) GetDBObject() *User

Jump to

Keyboard shortcuts

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