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:
@@ -10,6 +10,18 @@ import (
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
// @Summary Получить список компаний дистрибьютора
|
||||
// @Description Получение списка всех компаний, принадлежащих дистрибьютору
|
||||
// @Tags distributors
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Success 200 {object} rmodel.CompanyListGetResponse "Список компаний"
|
||||
// @Failure 400 {object} map[string]string "Неверные данные запроса"
|
||||
// @Failure 401 {object} map[string]string "Неавторизованный доступ"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/distributor/{distributor_id}/companies [get]
|
||||
func (h *handler) getCompanyListDistributorHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "getCompanyListDistributorHandler"
|
||||
|
||||
@@ -42,6 +54,20 @@ func (h *handler) getCompanyListDistributorHandler(w http.ResponseWriter, r *htt
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Получить компанию дистрибьютора по ID
|
||||
// @Description Получение детальной информации о компании дистрибьютора
|
||||
// @Tags distributors
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Param company_id path string true "ID компании"
|
||||
// @Success 200 {object} rmodel.CompanyByIdGetResponse "Информация о компании"
|
||||
// @Failure 400 {object} map[string]string "Неверные данные запроса"
|
||||
// @Failure 401 {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} [get]
|
||||
func (h *handler) getCompanyByIdDistributorHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "getCompanyByIdDistributorHandler"
|
||||
|
||||
@@ -76,6 +102,19 @@ func (h *handler) getCompanyByIdDistributorHandler(w http.ResponseWriter, r *htt
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Создать компанию дистрибьютора
|
||||
// @Description Создание новой компании для дистрибьютора
|
||||
// @Tags distributors
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Param request body rmodel.CompanyCreateRequest true "Данные для создания компании"
|
||||
// @Success 201 {object} rmodel.CompanyCreateResponse "Компания создана"
|
||||
// @Failure 400 {object} map[string]string "Неверные данные запроса"
|
||||
// @Failure 401 {object} map[string]string "Неавторизованный доступ"
|
||||
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
|
||||
// @Security BearerAuth
|
||||
// @Router /api/v1/distributor/{distributor_id}/company [post]
|
||||
func (h *handler) createCompanyDistributorHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "createCompanyDistributorHandler"
|
||||
|
||||
@@ -124,6 +163,21 @@ func (h *handler) createCompanyDistributorHandler(w http.ResponseWriter, r *http
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Обновить компанию дистрибьютора
|
||||
// @Description Обновление информации о компании дистрибьютора
|
||||
// @Tags distributors
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param distributor_id path string true "ID дистрибьютора"
|
||||
// @Param company_id path string true "ID компании"
|
||||
// @Param request body rmodel.CompanyUpdateRequest true "Данные для обновления"
|
||||
// @Success 204 "Компания обновлена"
|
||||
// @Failure 400 {object} map[string]string "Неверные данные запроса"
|
||||
// @Failure 401 {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} [patch]
|
||||
func (h *handler) updateCompanyDistributorHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "updateCompanyDistributorHandler"
|
||||
|
||||
@@ -161,6 +215,21 @@ func (h *handler) updateCompanyDistributorHandler(w http.ResponseWriter, r *http
|
||||
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 компании"
|
||||
// @Param request body rmodel.AddDistributorCompanyMemberRequest true "Данные участника"
|
||||
// @Success 201 "Участник добавлен"
|
||||
// @Failure 400 {object} map[string]string "Неверные данные запроса"
|
||||
// @Failure 401 {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} [post]
|
||||
func (h *handler) addCompanyMemberDistributorHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "addCompanyMemberDistributorHandler"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user