Documentation
¶
Index ¶
- type Handler
- func (h *Handler) Create(w netHttp.ResponseWriter, r *netHttp.Request)
- func (h *Handler) Delete(w netHttp.ResponseWriter, r *netHttp.Request)
- func (h *Handler) Get(w netHttp.ResponseWriter, r *netHttp.Request)
- func (h *Handler) GetAccounts(w netHttp.ResponseWriter, r *netHttp.Request)
- func (h *Handler) InviteUser(w netHttp.ResponseWriter, r *netHttp.Request)
- func (h *Handler) List(w netHttp.ResponseWriter, r *netHttp.Request)
- func (h *Handler) RemoveUser(w netHttp.ResponseWriter, r *netHttp.Request)
- func (h *Handler) Update(w netHttp.ResponseWriter, r *netHttp.Request)
- func (h *Handler) UpdateAccountCompany(w netHttp.ResponseWriter, r *netHttp.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(databaseWrite SQL.InterfaceWrite, databaseRead SQL.InterfaceRead, broker brokerLib.IBroker, appConfig app.IAppConfig) *Handler
func (*Handler) Create ¶
func (h *Handler) Create(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Companies @Description create company! If applicationAdmin is enable add field adminEmail in body @ID create-company @Accept json @Produce json @Param CreateCompany body account.Company true "create company info" @Success 201 {object} http.Response{content=string} "CREATED" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 401 {object} http.Response{content=string} "UNAUTHORIZED" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /account/companies [post] @Security ApiKeyAuth
func (*Handler) Delete ¶
func (h *Handler) Delete(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Companies @Description delete company! @ID delete-company @Accept json @Produce json @Param companyID path string true "companyID of the company" @Success 204 {object} http.Response{content=string} "NO CONTENT" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /account/companies/{companyID} [delete] @Security ApiKeyAuth
func (*Handler) Get ¶
func (h *Handler) Get(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Companies @Description get company! @ID get-company @Accept json @Produce json @Param companyID path string true "companyID of the company" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /account/companies/{companyID} [get] @Security ApiKeyAuth
func (*Handler) GetAccounts ¶
func (h *Handler) GetAccounts(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Companies @Description get all accounts in a company! @ID get-company-accounts @Accept json @Produce json @Param companyID path string true "companyID of the company" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /account/companies/{companyID}/roles [get] @Security ApiKeyAuth
func (*Handler) InviteUser ¶
func (h *Handler) InviteUser(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Companies @Description invite user to company! @ID invite-user @Accept json @Produce json @Param InviteUser body dto.InviteUser true "invite user info" @Param companyID path string true "companyID of the company" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 404 {object} http.Response{content=string} "NOT FOUND" @Failure 409 {object} http.Response{content=string} "CONFLICT" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /account/companies/{companyID}/roles [post] @Security ApiKeyAuth
func (*Handler) List ¶
func (h *Handler) List(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Companies @Description list companies! @ID list-companies @Accept json @Produce json @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 401 {object} http.Response{content=string} "UNAUTHORIZED" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /account/companies [get] @Security ApiKeyAuth
func (*Handler) RemoveUser ¶
func (h *Handler) RemoveUser(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Companies @Description remove user from company! @ID remove-user @Accept json @Produce json @Param companyID path string true "companyID of the company" @Param accountID path string true "accountID of the account" @Success 204 {object} http.Response{content=string} "NO CONTENT" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 404 {object} http.Response{content=string} "NOT FOUND" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /account/companies/{companyID}/roles/{accountID} [delete] @Security ApiKeyAuth
func (*Handler) Update ¶
func (h *Handler) Update(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Companies @Description update company! @ID update-company @Accept json @Produce json @Param UpdateCompany body account.Company true "update company info" @Param companyID path string true "companyID of the company" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /account/companies/{companyID} [patch] @Security ApiKeyAuth
func (*Handler) UpdateAccountCompany ¶
func (h *Handler) UpdateAccountCompany(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Companies @Description update account company! @ID update-account-company @Accept json @Produce json @Param AccountCompany body roles.AccountCompany true "account company info" @Param companyID path string true "companyID of the company" @Param accountID path string true "accountID of the account" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /account/companies/{companyID}/roles/{accountID} [patch] @Security ApiKeyAuth