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

This commit is contained in:
Alex Shevchuk
2025-09-17 14:32:06 +03:00
parent 03372d7f9b
commit 61fc0d2747
22 changed files with 15486 additions and 10 deletions

View File

@@ -12,6 +12,17 @@ import (
rmodel "git-molva.ru/Molva/molva-backend/services/api_gateway/internal/request_model"
)
// @Summary Получить профиль агента
// @Description Получение профиля агента по ID
// @Tags agents
// @Accept json
// @Produce json
// @Param agent_id path string true "ID агента"
// @Success 200 {object} rmodel.ProfileGetResponse "Профиль агента"
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/agents/{agent_id}/profile [get]
func (h *handler) getProfileAgentHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getAgentProfileHandler"
@@ -44,6 +55,18 @@ func (h *handler) getProfileAgentHandler(w http.ResponseWriter, r *http.Request)
}
}
// @Summary Обновить профиль агента
// @Description Обновление профиля агента
// @Tags agents
// @Accept json
// @Produce json
// @Param agent_id path string true "ID агента"
// @Param request body rmodel.ProfileUpdateRequest true "Данные для обновления профиля"
// @Success 200 {object} map[string]string "Профиль обновлен"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/agents/{agent_id}/profile [put]
func (h *handler) updateProfileAgentHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "setAgentProfileHandler"
@@ -86,6 +109,17 @@ func (h *handler) updateProfileAgentHandler(w http.ResponseWriter, r *http.Reque
w.WriteHeader(http.StatusNoContent)
}
// @Summary Получить профиль дистрибьютора
// @Description Получение профиля дистрибьютора по ID
// @Tags distributors
// @Accept json
// @Produce json
// @Param distributor_id path string true "ID дистрибьютора"
// @Success 200 {object} rmodel.ProfileGetResponse "Профиль дистрибьютора"
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/distributor/{distributor_id}/profile [get]
func (h *handler) getProfileDisributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getProfileDisributorHandler"
@@ -118,6 +152,18 @@ func (h *handler) getProfileDisributorHandler(w http.ResponseWriter, r *http.Req
}
}
// @Summary Обновить профиль дистрибьютора
// @Description Обновление профиля дистрибьютора
// @Tags distributors
// @Accept json
// @Produce json
// @Param distributor_id path string true "ID дистрибьютора"
// @Param request body rmodel.ProfileUpdateRequest 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}/profile [put]
func (h *handler) updateProfileDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "updateProfileDistributorHandler"