handler

package
v0.0.0-...-565acca Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCompanyHandler

func CreateCompanyHandler(ctx *gin.Context)

@Summary Create Company @Description Create a new company @Tags Company @Accept json @Producer json @Security ApiKeyAuth @param Authorization header string true "Authorization" @Param request body CreateCompanyRequest true "Request body" @Success 201 {object} CreateCompanyResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /company [post]

func DeleteCompanyHandler

func DeleteCompanyHandler(ctx *gin.Context)

@Summary Delete Company @Description Delete a company @Tags Company @Accept json @Producer json @Security ApiKeyAuth @param Authorization header string true "Authorization" @Param id query string true "Company identification" @Success 200 {object} DeleteCompanyResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Router /company [delete]

func InitializeHandler

func InitializeHandler()

func ListCompaniesHandler

func ListCompaniesHandler(ctx *gin.Context)

@Summary List Companies @Description List all Companies @Tags Company @Accept json @Producer json @Security ApiKeyAuth @param Authorization header string true "Authorization" @Success 200 {object} ListCompaniesResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Router /companies [get]

func ShowCompanyHandler

func ShowCompanyHandler(ctx *gin.Context)

@Summary Show Company @Description Show a company @Tags Company @Accept json @Producer json @Security ApiKeyAuth @param Authorization header string true "Authorization" @Param id query string true "Company identification" @Success 200 {object} ShowCompanyResponse @Failure 404 {object} ErrorResponse @Router /company [get]

func UpdateCompanyHandler

func UpdateCompanyHandler(ctx *gin.Context)

@Summary Update Company @Description Update a new company @Tags Company @Accept json @Producer json @Security ApiKeyAuth @param Authorization header string true "Authorization" @Param id query string true "Company identification" @Param request body UpdateCompanyRequest true "Request body" @Success 201 {object} UpdateCompanyResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /company [put]

Types

type CreateCompanyRequest

type CreateCompanyRequest struct {
	Name              string `json:"name"`
	CNPJ              string `json:"cnpj"`
	Address           string `json:"address"`
	AddressNumber     string `json:"addressNumber"`
	AddressComplement string `json:"addressComplement"`
	AddressCity       string `json:"addressCity"`
	AddressState      string `json:"addressState"`
	AddressZipCode    string `json:"addressZipCode"`
}

func (*CreateCompanyRequest) Validate

func (r *CreateCompanyRequest) Validate() error

type CreateCompanyResponse

type CreateCompanyResponse struct {
	Message string                  `json:"message"`
	Data    schemas.CompanyResponse `json:"data"`
}

type DeleteCompanyResponse

type DeleteCompanyResponse struct {
	Message string                  `json:"message"`
	Data    schemas.CompanyResponse `json:"data"`
}

type ErrorResponse

type ErrorResponse struct {
	Message   string `json:"message"`
	ErrorCode string `json:"errorCode"`
}

type ListCompaniesResponse

type ListCompaniesResponse struct {
	Message string                    `json:"message"`
	Data    []schemas.CompanyResponse `json:"data"`
}

type ShowCompanyResponse

type ShowCompanyResponse struct {
	Message string                  `json:"message"`
	Data    schemas.CompanyResponse `json:"data"`
}

type UpdateCompanyRequest

type UpdateCompanyRequest struct {
	Name              string `json:"name"`
	CNPJ              string `json:"cnpj"`
	Address           string `json:"address"`
	AddressNumber     string `json:"addressNumber"`
	AddressComplement string `json:"addressComplement"`
	AddressCity       string `json:"addressCity"`
	AddressState      string `json:"addressState"`
	AddressZipCode    string `json:"addressZipCode"`
}

func (*UpdateCompanyRequest) Validate

func (r *UpdateCompanyRequest) Validate() error

type UpdateCompanyResponse

type UpdateCompanyResponse struct {
	Message string                  `json:"message"`
	Data    schemas.CompanyResponse `json:"data"`
}

Jump to

Keyboard shortcuts

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