models

package
v0.0.0-...-28c8458 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

type Post struct {
	ID     uuid.UUID `gorm:"primaryKey"`
	Title  string    `json:"title" gorm:"not null"`
	Body   string    `json:"body" gorm:"not null"`
	UserID uuid.UUID `json:"user_id" db:"user_id"`
	gorm.Model
}

type PostDto

type PostDto struct {
	Title string `json:"title"`
	Body  string `json:"body"`
}

type User

type User struct {
	ID       uuid.UUID `gorm:"primaryKey"`
	Name     string    `json:"name" gorm:"not null"`
	LastName string    `json:"last_name" gorm:"not null" db:"last_name"`
	Email    string    `json:"email" gorm:"not null;unique_index"`
	Password string    `json:"-" gorm:"not null"`
	Nickname string    `json:"nickname" gorm:"not null;unique_index;"`
	Posts    []Post    `json:"posts" gorm:"foreignKey:UserID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	gorm.Model
}

type UserAuthDto

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

type UserDto

type UserDto struct {
	Name     string `json:"name"`
	LastName string `json:"last_name" db:"last_name"`
	Email    string `json:"email"`
	Password string `json:"password"`
	Nickname string `json:"nickname"`
}

type UserToken

type UserToken struct {
	User  User
	Token string
}

Jump to

Keyboard shortcuts

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