requests

package
v0.0.0-...-5037bb9 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidationErrorResponse

func ValidationErrorResponse(w http.ResponseWriter, err error)

Types

type CartProductRequest

type CartProductRequest struct {
	ID       int                   `json:"id"`
	UserID   int32                 `json:"user_id"`
	Products []models.CartProducts `json:"products"`
}

func (CartProductRequest) Validate

func (c CartProductRequest) Validate() error

type CartRequest

type CartRequest struct {
	ID     int   `json:"id"`
	UserID int32 `json:"user_id"`
}

type LoginRequest

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

func (LoginRequest) Validate

func (c LoginRequest) Validate() error

type OrderRequest

type OrderRequest struct {
	ID               int32                  `json:"id"`
	UserID           int32                  `json:"user_id"`
	Address          string                 `json:"address"`
	PhoneNumber      string                 `json:"phone_number"`
	CustomerName     string                 `json:"customer_name"`
	CustomerLastname string                 `json:"customer_lastname"`
	PaymentMethod    string                 `json:"payment_method"`
	Status           string                 `json:"status"`
	Products         []models.OrderProducts `json:"products"`
}

func (OrderRequest) Validate

func (c OrderRequest) Validate() error

type ProductRequest

type ProductRequest struct {
	ID          int      `json:"id"`
	SupplierID  int32    `json:"supplier_id"`
	Name        string   `json:"name"`
	Price       float64  `json:"price"`
	Type        string   `json:"type"`
	Ingredients []string `json:"ingredients"`
	Image       string   `json:"image"`
}

func (ProductRequest) Validate

func (c ProductRequest) Validate() error

type SupplierRequest

type SupplierRequest struct {
	ID    int32  `json:"id"`
	Name  string `json:"name"`
	Image string `json:"image"`
}

func (SupplierRequest) Validate

func (c SupplierRequest) Validate() error

type UserRequest

type UserRequest struct {
	ID        int32  `json:"id"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Email     string `json:"email"`
	Password  string `json:"password"`
}

func (UserRequest) Validate

func (c UserRequest) Validate() error

Jump to

Keyboard shortcuts

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