controllers

package
v0.0.0-...-a7d6750 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetErrorByID

func GetErrorByID(ctx echo.Context) error

GetErrorByID example @Summary Returns the error definition @Description Returns the error definition @ID get-error-by-id @Accept json @Produce json @Param id_error query int true "Error ID" @Success 200 {object} ErrorResponse "ok" @Success 204 {string} string "ok" @Router /errors [get]

func GetPersonAddressByID

func GetPersonAddressByID(ctx echo.Context) error

GetPersonAddressByIDRequest example @Summary Get the person address. @Description Get the person address. @ID get-person-address-by-id @Accept json @Produce json @Param id_person path string true "Person ID" @Param id_address path string true "Address ID" @Success 200 {string} AddressResponse "ok" @Failure 400 {object} ErrorResponse "error" @Router /persons/{id_person}/addresses/{id_address} [get]

func GetPersonByID

func GetPersonByID(ctx echo.Context) error

GetPersonByIDRequest example @Summary Get person by id. @Description Get person by id. @ID get-person-by-id @Accept json @Produce json @Param id_person path string true "Person ID" @Param age query int false "Age" @Success 200 {string} PersonResponse "ok" @Failure 400 {object} ErrorResponse "error" @Router /persons/{id_person} [get]

Types

type AddressResponse

type AddressResponse struct {
	Id      string `json:"id"`
	Country string `json:"country"`
	City    string `json:"city"`
	Street  string `json:"street"`
	Number  int    `json:"number"`
}

AddressResponse is an struct that contains the address information.

type ErrorResponse

type ErrorResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

ErrorResponse is an error that is used when the required input fails validation.

type GetPersonAddressByIDRequest

type GetPersonAddressByIDRequest struct {
	IdPerson  string `json:"id_person"`
	IdAddress string `json:"id_address"`
}

GetPersonAddressByIDRequest

type GetPersonByIDRequest

type GetPersonByIDRequest struct {
	IdPerson string `json:"id_person"`
	Age      int    `json:"age"`
}

GetPersonByIDRequest

type PersonResponse

type PersonResponse struct {
	Id   string `json:"id"`
	Name string `json:"name"`
	Age  int    `json:"age"`
}

PersonResponse is an struct that contains the person information.

Jump to

Keyboard shortcuts

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