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:
@@ -12,6 +12,18 @@ import (
|
||||
rmodel "git-molva.ru/Molva/molva-backend/services/api_gateway/internal/request_model"
|
||||
)
|
||||
|
||||
// @Summary Получить список компаний агента
|
||||
// @Description Получение списка всех компаний, принадлежащих агенту
|
||||
// @Tags agents
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param agent_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/agents/{agent_id}/companies [get]
|
||||
func (h *handler) getCompanyListAgentHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "getCompanyListAgentHandler"
|
||||
|
||||
@@ -44,6 +56,20 @@ func (h *handler) getCompanyListAgentHandler(w http.ResponseWriter, r *http.Requ
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Получить компанию по ID
|
||||
// @Description Получение детальной информации о компании агента
|
||||
// @Tags agents
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param agent_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/agents/{agent_id}/company/{company_id} [get]
|
||||
func (h *handler) getCompanyByIdAgentHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "getCompanyByIdAgentHandler"
|
||||
|
||||
@@ -78,6 +104,19 @@ func (h *handler) getCompanyByIdAgentHandler(w http.ResponseWriter, r *http.Requ
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Создать компанию
|
||||
// @Description Создание новой компании для агента
|
||||
// @Tags agents
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param agent_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/agents/{agent_id}/company [post]
|
||||
// FIXME: foreign key violation review
|
||||
func (h *handler) createCompanyAgentHandler(w http.ResponseWriter, r *http.Request) {
|
||||
const handlerName = "createAgentCompanyHandler"
|
||||
|
||||
Reference in New Issue
Block a user