Documentation
¶
Index ¶
- func CreateCompanyHandler(ctx *gin.Context)
- func DeleteCompanyHandler(ctx *gin.Context)
- func InitializeHandler()
- func ListCompaniesHandler(ctx *gin.Context)
- func ShowCompanyHandler(ctx *gin.Context)
- func UpdateCompanyHandler(ctx *gin.Context)
- type CreateCompanyRequest
- type CreateCompanyResponse
- type DeleteCompanyResponse
- type ErrorResponse
- type ListCompaniesResponse
- type ShowCompanyResponse
- type UpdateCompanyRequest
- type UpdateCompanyResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCompanyHandler ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 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"`
}