71
Some checks failed
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Failing after 2m31s
Go Linter / Build golang services (api_gateway) (push) Has been skipped
Go Linter / Tag Commit (push) Has been skipped
Go Linter / Push Docker Images (api_gateway) (push) Has been skipped
Some checks failed
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Failing after 2m31s
Go Linter / Build golang services (api_gateway) (push) Has been skipped
Go Linter / Tag Commit (push) Has been skipped
Go Linter / Push Docker Images (api_gateway) (push) Has been skipped
This commit is contained in:
@@ -130,6 +130,19 @@ func (lf *LogoFile) Reset() error {
|
||||
|
||||
// =============== LOGO HANDLERS ===============
|
||||
|
||||
// @Summary Получить логотип компании
|
||||
// @Description Получение логотипа компании дистрибьютора
|
||||
// @Tags distributors
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Param company_id path string true "ID компании"
|
||||
// @Success 200 {file} file "Логотип компании"
|
||||
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
|
||||
// @Failure 404 {object} map[string]string "Логотип не найден"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/distributor/{distributor_id}/company/{company_id}/logo [get]
|
||||
func (h *handler) getCompanyLogoHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "getCompanyLogoHandler"
|
||||
|
||||
@@ -180,6 +193,19 @@ func (h *handler) getCompanyLogoHandler(w http.ResponseWriter, r *http.Request)
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Создать логотип компании
|
||||
// @Description Загрузка нового логотипа для компании дистрибьютора
|
||||
// @Tags distributors
|
||||
// @Accept multipart/form-data
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Param company_id path string true "ID компании"
|
||||
// @Param logo formData file true "Файл логотипа"
|
||||
// @Success 201 {object} map[string]string "Логотип загружен"
|
||||
// @Failure 400 {object} map[string]string "Неверные данные запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/distributor/{distributor_id}/company/{company_id}/logo [post]
|
||||
func (h *handler) createCompanyLogoHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "createCompanyLogoHandler"
|
||||
|
||||
@@ -240,6 +266,19 @@ func (h *handler) createCompanyLogoHandler(w http.ResponseWriter, r *http.Reques
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
}
|
||||
|
||||
// @Summary Обновить логотип компании
|
||||
// @Description Обновление логотипа компании дистрибьютора
|
||||
// @Tags distributors
|
||||
// @Accept multipart/form-data
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Param company_id path string true "ID компании"
|
||||
// @Param logo formData file true "Новый файл логотипа"
|
||||
// @Success 200 {object} map[string]string "Логотип обновлен"
|
||||
// @Failure 400 {object} map[string]string "Неверные данные запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/distributor/{distributor_id}/company/{company_id}/logo [put]
|
||||
func (h *handler) updateCompanyLogoHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "updateCompanyLogoHandler"
|
||||
|
||||
@@ -300,6 +339,18 @@ func (h *handler) updateCompanyLogoHandler(w http.ResponseWriter, r *http.Reques
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
}
|
||||
|
||||
// @Summary Удалить логотип компании
|
||||
// @Description Удаление логотипа компании дистрибьютора
|
||||
// @Tags distributors
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Param company_id path string true "ID компании"
|
||||
// @Success 200 {object} map[string]string "Логотип удален"
|
||||
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/distributor/{distributor_id}/company/{company_id}/logo [delete]
|
||||
func (h *handler) deleteCompanyLogoHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "deleteCompanyLogoHandler"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user