structure

package
v0.0.0-...-3f89699 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetAllUsersRequest

type GetAllUsersRequest struct {
	Count int `schema:"count,required"`
	Page  int `schema:"page,required"`
}

type GetAllUsersResponse

type GetAllUsersResponse struct {
	Users       []User `json:"users"`
	CurrentPage int    `json:"current_page" example:"2"`
	TotalPages  int    `json:"total_pages" example:"5"`
	PerPage     int    `json:"per_page" example:"10"`
}

type LoginRequest

type LoginRequest struct {
	Username string `json:"username"  example:"username"`
	Password string `json:"password"  example:"password"`
}

type LoginResponse

type LoginResponse struct {
	Token string `json:"token"  example:"random_jwt_token"`
}

type Order

type Order struct {
	ID       int       `json:"id"`
	Products []Product `json:"products"`
	UserID   int       `json:"user_id"`
}

type Product

type Product struct {
	ID          int     `json:"id"`
	Name        string  `json:"name"`
	Description string  `json:"description"`
	Review      *string `json:"review"`
	Quantity    int32   `json:"quantity"`
	Price       int32   `json:"price"`
	Status      bool    `json:"status"`
	Available   bool    `json:"available"`
	Rating      float64 `json:"rating"`
	RatingCount int32   `json:"rating_count"`
}

type ProductUpdate

type ProductUpdate struct {
	Name        *string  `json:"name"`
	Description *string  `json:"description"`
	Quantity    *int32   `json:"quantity"`
	Price       *int32   `json:"price"`
	Status      *bool    `json:"status"`
	Available   *bool    `json:"available"`
	Rating      *float64 `json:"rating"`
	RatingCount *int32   `json:"rating_count"`
}

type User

type User struct {
	ID        int               `json:"id" example:"1"`
	Username  string            `json:"username" example:"user"`
	Password  password.Password `json:"-"`
	FirstName *string           `json:"firstname,omitempty" example:"John"`
	LastName  *string           `json:"lastname,omitempty" example:"Doe"`
	Email     *string           `json:"email,omitempty" example:"email@email.com"`
	Phone     *string           `json:"phone,omitempty" example:"0123456789"`
	Status    bool              `json:"-"`
	Orders    []Order           `json:"orders,omitempty"`
	Role      string            `json:"-"`
}

type UserCreationRequest

type UserCreationRequest struct {
	Username  string  `json:"username" example:"user"  validate:"required"`
	Password  string  `json:"password" example:"123456"  validate:"required"`
	FirstName *string `json:"firstname" example:"John"`
	LastName  *string `json:"lastname" example:"Doe"`
	Email     *string `json:"email" example:"email@email.com"`
	Phone     *string `json:"phone" example:"0123456789"`
}

type UserUpdateRequest

type UserUpdateRequest struct {
	UserName  *string `json:"username" example:"user"`
	Password  *string `json:"password" example:"123456"`
	FirstName *string `json:"firstname" example:"John"`
	LastName  *string `json:"lastname" example:"Doe"`
	Email     *string `json:"email" example:"email@email.com"`
	Phone     *string `json:"phone" example:"0123456789"`
}

Jump to

Keyboard shortcuts

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