19 Commits

Author SHA1 Message Date
Alex Shevchuk
33229f1eb7 71
Some checks failed
Go Linter / Tag Commit (push) Successful in 13s
Go Linter / Build golang services (api_gateway) (push) Successful in 3m2s
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Successful in 3m52s
Go Linter / Push Docker Images (api_gateway) (push) Failing after 1m45s
2025-09-17 15:11:39 +03:00
Alex Shevchuk
5d10849397 71
Some checks failed
Go Linter / Tag Commit (push) Successful in 28s
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Successful in 4m13s
Go Linter / Push Docker Images (api_gateway) (push) Failing after 1m57s
Go Linter / Build golang services (api_gateway) (push) Failing after 2m5s
2025-09-17 14:59:21 +03:00
Alex Shevchuk
f46b07c210 71
Some checks failed
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Failing after 42s
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
2025-09-17 14:56:52 +03:00
Alex Shevchuk
f5310dd516 71
Some checks failed
Go Linter / Tag Commit (push) Has been skipped
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Failing after 2m39s
Go Linter / Build golang services (api_gateway) (push) Has been skipped
Go Linter / Push Docker Images (api_gateway) (push) Has been skipped
2025-09-17 14:37:10 +03:00
Alex Shevchuk
61fc0d2747 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
2025-09-17 14:32:06 +03:00
Alex Shevchuk
03372d7f9b 70
Some checks failed
Go Linter / Tag Commit (push) Successful in 13s
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Successful in 2m43s
Go Linter / Push Docker Images (api_gateway) (push) Failing after 28s
Go Linter / Build golang services (api_gateway) (push) Successful in 1m46s
2025-09-14 23:01:46 +03:00
Alex Shevchuk
14b2c33922 70
Some checks failed
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Successful in 2m9s
Go Linter / Tag Commit (push) Successful in 14s
Go Linter / Push Docker Images (api_gateway) (push) Failing after 24s
Go Linter / Build golang services (api_gateway) (push) Successful in 1m45s
2025-09-14 22:54:07 +03:00
Alex Shevchuk
3a25af30ab 69
Some checks failed
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Failing after 2m3s
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
2025-09-14 22:42:19 +03:00
Alex Shevchuk
2b0898ddbe 69
Some checks failed
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Failing after 2m35s
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
2025-09-14 22:39:27 +03:00
Alex Shevchuk
286b63e7ea 69
Some checks failed
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Failing after 2m33s
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
2025-09-14 22:09:46 +03:00
Alex Shevchuk
4816566db2 69
Some checks failed
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Failing after 6m44s
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
2025-09-14 16:20:36 +03:00
Alex Shevchuk
d71c3a9418 69
Some checks failed
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Failing after 6m45s
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
2025-09-14 16:07:00 +03:00
Alex Shevchuk
a75f7a5f33 69
Some checks failed
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Failing after 6m34s
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
2025-09-12 18:58:02 +03:00
Alex Shevchuk
20d8409b40 69
All checks were successful
Go Linter / Run golangci-lint (api_gateway) (push) Has been skipped
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Build golang services (api_gateway) (push) Has been skipped
Go Linter / Push Docker Images (api_gateway) (push) Has been skipped
Go Linter / Tag Commit (push) Successful in 6s
2025-09-12 18:49:05 +03:00
Alex Shevchuk
62e549c5ec 69
All checks were successful
Go Linter / Push Docker Images (api_gateway) (push) Has been skipped
Go Linter / Run golangci-lint (api_gateway) (push) Has been skipped
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Build golang services (api_gateway) (push) Has been skipped
Go Linter / Tag Commit (push) Successful in 6s
2025-09-12 18:47:26 +03:00
Alex Shevchuk
5859bc4f4c 69
All checks were successful
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Tag Commit (push) Successful in 6s
Go Linter / Run golangci-lint (api_gateway) (push) Has been skipped
Go Linter / Build golang services (api_gateway) (push) Has been skipped
Go Linter / Push Docker Images (api_gateway) (push) Has been skipped
2025-09-12 18:46:30 +03:00
Alex Shevchuk
9de6619407 68
All checks were successful
Go Linter / Run golangci-lint (api_gateway) (push) Has been skipped
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Build golang services (api_gateway) (push) Has been skipped
Go Linter / Push Docker Images (api_gateway) (push) Has been skipped
Go Linter / Tag Commit (push) Successful in 5s
2025-09-12 18:46:01 +03:00
Alex Shevchuk
27841c72fe 68
All checks were successful
Go Linter / Tag Commit (push) Successful in 6s
Go Linter / Run golangci-lint (api_gateway) (push) Has been skipped
Go Linter / Push Docker Images (api_gateway) (push) Has been skipped
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Build golang services (api_gateway) (push) Has been skipped
2025-09-12 18:16:45 +03:00
Alex Shevchuk
0fabd2aea3 67
All checks were successful
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Build golang services (api_gateway) (push) Has been skipped
Go Linter / Tag Commit (push) Successful in 6s
Go Linter / Run golangci-lint (api_gateway) (push) Has been skipped
Go Linter / Push Docker Images (api_gateway) (push) Has been skipped
2025-09-12 18:15:07 +03:00
26 changed files with 15505 additions and 213 deletions

View File

@@ -12,7 +12,6 @@ on:
jobs:
lint:
if: 0
name: Run golangci-lint
runs-on: ubuntu-22.04
@@ -26,13 +25,18 @@ jobs:
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v6
with:
go-version: 1.24
go-version: '1.24.x'
check-latest: true
- name: Enable Go toolchain auto
run: echo "GOTOOLCHAIN=auto" >> $GITHUB_ENV
- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.62.2
echo "Installing golangci-lint v1.62.2 with $(go version)"
GOBIN=$(go env GOPATH)/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
- name: Run golangci-lint
run: |
@@ -40,7 +44,6 @@ jobs:
golangci-lint run -c ./.golangci-lint.yaml --fix=false --color=always
build:
if: 0
name: Build golang services
runs-on: ubuntu-22.04
needs: lint
@@ -60,16 +63,18 @@ jobs:
go-version: 1.24
- name: Build golang services
env:
HOST: ${{ github.event.base_ref == 'refs/heads/release' && secrets.HOST_STG || secrets.HOST_PROD }}
run: |
go mod tidy
SWAGGER_HOST=${HOST} make docs
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o main cmd/main.go
push:
if: 0
name: Push Docker Images
runs-on: ubuntu-22.04
needs: lint
# if: ${{ gitea.ref == 'refs/heads/master' || gitea.ref == 'refs/heads/release' }}
if: ${{ gitea.ref == 'refs/heads/master' || gitea.ref == 'refs/heads/release' }}
strategy:
matrix:
@@ -121,10 +126,12 @@ jobs:
IMAGE_NAME: ${{ steps.docker-metadata.outputs.IMAGE_NAME }}
IMAGE_TAG: ${{ steps.docker-metadata.outputs.IMAGE_TAG }}
CONFIG_FILE: .build/config/${{ steps.git-metadata.outputs.TARGET_ENV }}.yaml
HOST: ${{ github.event.base_ref == 'refs/heads/release' && secrets.HOST_STG || secrets.HOST_PROD }}
run: |
docker build \
--build-arg BUILD_LDFLAGS="-w -s" \
--build-arg CONFIG_FILE_PATH=$CONFIG_FILE \
--build-arg SWAGGER_HOST=$HOST \
-t $IMAGE_NAME:$IMAGE_TAG \
-t $IMAGE_NAME:latest \
.
@@ -142,7 +149,7 @@ jobs:
rules:
- if: github.event_name == 'push' && github.ref_type == 'tag'
when: never
# needs: lint
needs: lint
steps:
- name: Checkout репозитория
@@ -155,7 +162,7 @@ jobs:
run: |
git fetch --tags --force
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo 'v0.0.0')
LATEST_TAG=$(git tag -l "v*" | sort -V | tail -n 1)
echo $LATEST_TAG
if [[ $LATEST_TAG =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
@@ -182,14 +189,9 @@ jobs:
echo "TAG_EXISTS=false" >> $GITHUB_OUTPUT
fi
- name: Push tag (if it doesn't exist)
- name: Push tag
if: steps.get-latest-tag.outputs.TAG_EXISTS == 'false'
run: |
git tag ${{ steps.get-latest-tag.outputs.NEW_TAG }}
git push origin ${{ steps.get-latest-tag.outputs.NEW_TAG }}
echo "Successfully pushed tag: ${{ steps.get-latest-tag.outputs.NEW_TAG }}"
- name: Skip tag push (tag already exists)
if: steps.get-latest-tag.outputs.TAG_EXISTS == 'true'
run: |
echo "Skipping tag push - tag ${{ steps.get-latest-tag.outputs.NEW_TAG }} already exists remotely"

View File

@@ -18,7 +18,7 @@ on:
jobs:
deploy:
name: Deploy to ${{ inputs.environment }}
name: Deploy
runs-on: ubuntu-22.04
env:

1
.gitignore vendored
View File

@@ -42,6 +42,7 @@ code-quality-repot.json
molva
test.sh
go.sum
bin/
code-quality-report.json

View File

@@ -40,7 +40,7 @@ run:
# Минимально поддерживаемая версия go.
# Mainly related to generics support in go1.18.
# Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.17
go: '1.22'
go: '1.24'
# output configuration options
output:

View File

@@ -1,13 +1,18 @@
FROM golang:1.24-alpine AS builder
ARG BUILD_LDFLAGS
ARG SWAGGER_HOST=localhost:8000
WORKDIR /app
COPY go.mod go.sum ./
RUN apk add --no-cache make
COPY go.mod ./
RUN go mod download -x
COPY . .
RUN SWAGGER_HOST=${SWAGGER_HOST} make docs
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="${BUILD_LDFLAGS}" -trimpath -o main ./cmd/main.go
FROM alpine:3.18 AS certs
@@ -21,8 +26,8 @@ ARG CONFIG_FILE_PATH
RUN apk add --no-cache ca-certificates tzdata
COPY --from=certs /YandexInternalRootCA.crt /etc/.redis/YandexInternalRootCA.crt
COPY --from=certs /YandexInternalRootCA.crt /etc/.postgres/YandexInternalRootCA.crt
COPY --from=certs /YandexInternalRootCA.crt /root/.redis/YandexInternalRootCA.crt
COPY --from=certs /YandexInternalRootCA.crt /root/.postgres/YandexInternalRootCA.crt
COPY ${CONFIG_FILE_PATH} /config.yaml
COPY --from=builder /app/main /main

View File

@@ -5,9 +5,16 @@ BUILD_DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
GIT_COMMIT := $(shell git rev-parse HEAD 2>/dev/null)
LDFLAGS := "-s -w -X main.version=$(VERSION) -X main.commit=$(GIT_COMMIT) -X main.date=$(BUILD_DATE)"
GOLANGCI_LINT_VERSION := v1.62.2
SWAG_VERSION := v1.16.2
ENV := "local"
UNAME_S := $(shell uname -s)
CONFIG_PATH := .build/config/
SWAGGER_DOCS_PATH := internal/http/swagger/docs
ifeq ($(UNAME_S),Darwin)
SED_INPLACE := -i ''
else
SED_INPLACE := -i
endif
ifeq ($(OS),Windows_NT)
CONFIG_PATH := $(subst /,\,$(CONFIG_PATH))
@@ -18,7 +25,7 @@ all: lint build
## -- Dependency Management --
.PHONY: install-tools
install-tools: $(BIN_DIR)/golangci-lint
install-tools: $(BIN_DIR)/golangci-lint $(BIN_DIR)/swag
.PHONY: $(BIN_DIR)/golangci-lint
$(BIN_DIR)/golangci-lint:
@@ -26,12 +33,45 @@ $(BIN_DIR)/golangci-lint:
@echo "Installing golangci-lint $(GOLANGCI_LINT_VERSION)..."
@GOBIN=$(BIN_DIR) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
.PHONY: $(BIN_DIR)/swag
$(BIN_DIR)/swag:
@mkdir -p $(@D)
@echo "Installing swag $(SWAG_VERSION)..."
@GOBIN=$(BIN_DIR) go install github.com/swaggo/swag/cmd/swag@$(SWAG_VERSION)
## -- Linting --
.PHONY: lint
lint: $(BIN_DIR)/golangci-lint
@echo "Running linter..."
@$(BIN_DIR)/golangci-lint run --config .golangci-lint.yaml --fix=false --color=always
## -- Documentation --
.PHONY: docs
docs: $(BIN_DIR)/swag
@echo "Generating Swagger documentation..."
@if [ -n "$(SWAGGER_HOST)" ]; then \
echo "Using SWAGGER_HOST: $(SWAGGER_HOST)"; \
$(MAKE) .generate-swagger-with-host HOST=$(SWAGGER_HOST); \
else \
echo "Using default host: localhost:8000"; \
mkdir -p $(SWAGGER_DOCS_PATH); \
$(BIN_DIR)/swag init -g cmd/main.go -o $(SWAGGER_DOCS_PATH) --parseDependency --parseInternal; \
echo "Swagger documentation generated in $(SWAGGER_DOCS_PATH)"; \
fi
.PHONY: .generate-swagger-with-host
.generate-swagger-with-host: $(BIN_DIR)/swag
@echo "Генерация Swagger документации с host: $(HOST)"
@mkdir -p $(SWAGGER_DOCS_PATH)
@TEMP_MAIN="cmd/main_temp.go" && \
cp cmd/main.go $$TEMP_MAIN && \
ESC_HOST=$$(printf '%s\n' "$(HOST)" | sed -e 's/[\\\/&]/\\\\&/g') && \
sed $(SED_INPLACE) "s|localhost:8000|$${ESC_HOST}|g" $$TEMP_MAIN && \
$(BIN_DIR)/swag init -g $$TEMP_MAIN -o $(SWAGGER_DOCS_PATH) --parseDependency --parseInternal && \
rm -f $$TEMP_MAIN && \
echo "Swagger документация успешно сгенерирована с host: $(HOST)" && \
echo "Документация доступна по адресу: http://$(HOST)/swagger/index.html"
## -- Run --
## To change env use: make run CONFIG_PATH={config file dir path} ENV={env}
.PHONY: run
@@ -71,12 +111,33 @@ docker-build:
@echo "Building Docker image..."
@docker build \
--build-arg BUILD_LDFLAGS=$(LDFLAGS) \
--build-arg SWAGGER_HOST=$(SWAGGER_HOST) \
--build-arg CONFIG_FILE_PATH="$(CONFIG_PATH)$(ENV).yaml" \
-t $(APP_NAME):$(VERSION) \
.
.PHONY: docker-build-staging
docker-build-staging:
@echo "Building Docker image for staging..."
@docker build \
--build-arg BUILD_LDFLAGS=$(LDFLAGS) \
--build-arg SWAGGER_HOST=api-staging.example.com \
--build-arg CONFIG_FILE_PATH="$(CONFIG_PATH)$(ENV).yaml" \
-t $(APP_NAME):staging \
.
.PHONY: docker-build-production
docker-build-production:
@echo "Building Docker image for production..."
@docker build \
--build-arg BUILD_LDFLAGS=$(LDFLAGS) \
--build-arg SWAGGER_HOST=api.example.com \
--build-arg CONFIG_FILE_PATH="$(CONFIG_PATH)$(ENV).yaml" \
-t $(APP_NAME):production \
.
## -- Cleanup --
.PHONY: clean
clean:
@echo "Cleaning..."
@rm -rf $(BIN_DIR)
@rm -rf $(BIN_DIR)

View File

@@ -166,3 +166,4 @@ molva-backend/
- `version` - версия приложения (git tag)
- `commit` - хеш коммита
- `date` - дата сборки

17
go.mod
View File

@@ -2,6 +2,8 @@ module git-molva.ru/Molva/molva-backend/services/api_gateway
go 1.24
toolchain go1.24.0
require (
github.com/AlexOreL-272/ProtoMolva v1.32.5
github.com/Masterminds/squirrel v1.5.4
@@ -19,13 +21,14 @@ require (
github.com/jmoiron/sqlx v1.4.0
github.com/lib/pq v1.10.9
github.com/rabbitmq/amqp091-go v1.10.0
github.com/swaggo/http-swagger v1.3.4
github.com/swaggo/swag v1.16.2
google.golang.org/protobuf v1.36.6
gopkg.in/yaml.v3 v3.0.1
)
require (
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/a8m/envsubst v1.4.3 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.10 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.67 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30 // indirect
@@ -40,24 +43,34 @@ require (
github.com/aws/aws-sdk-go-v2/service/sso v1.25.3 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.33.19 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/spec v0.20.6 // indirect
github.com/go-openapi/swag v0.19.15 // indirect
github.com/go-resty/resty/v2 v2.16.5 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/segmentio/ksuid v1.0.4 // indirect
github.com/swaggo/files v1.0.1 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/net v0.37.0 // indirect
golang.org/x/sync v0.13.0 // indirect
golang.org/x/sys v0.32.0 // indirect
golang.org/x/text v0.24.0 // indirect
golang.org/x/tools v0.26.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb // indirect
google.golang.org/grpc v1.71.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
olympos.io/encoding/edn v0.0.0-20201019073823-d3554ca0b0a3 // indirect
)

188
go.sum
View File

@@ -1,188 +0,0 @@
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
github.com/AlexOreL-272/ProtoMolva v1.32.5 h1:mQybFqLmwlW7DpSppiRsID11m6t8GGOOkiuzWtsjyT0=
github.com/AlexOreL-272/ProtoMolva v1.32.5/go.mod h1:0lY7t+z3fhKs2ZxsdVvAePxAC4UdIRQT7LOejnJmb00=
github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8afzqM=
github.com/Masterminds/squirrel v1.5.4/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10=
github.com/Nerzal/gocloak/v13 v13.9.0 h1:YWsJsdM5b0yhM2Ba3MLydiOlujkBry4TtdzfIzSVZhw=
github.com/Nerzal/gocloak/v13 v13.9.0/go.mod h1:YYuDcXZ7K2zKECyVP7pPqjKxx2AzYSpKDj8d6GuyM10=
github.com/a8m/envsubst v1.4.3 h1:kDF7paGK8QACWYaQo6KtyYBozY2jhQrTuNNuUxQkhJY=
github.com/a8m/envsubst v1.4.3/go.mod h1:4jjHWQlZoaXPoLQUb7H2qT4iLkZDdmEQiOUogdUmqVU=
github.com/aws/aws-sdk-go-v2 v1.36.3 h1:mJoei2CxPutQVxaATCzDUjcZEjVRdpsiiXi2o38yqWM=
github.com/aws/aws-sdk-go-v2 v1.36.3/go.mod h1:LLXuLpgzEbD766Z5ECcRmi8AzSwfZItDtmABVkRLGzg=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.10 h1:zAybnyUQXIZ5mok5Jqwlf58/TFE7uvd3IAsa1aF9cXs=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.10/go.mod h1:qqvMj6gHLR/EXWZw4ZbqlPbQUyenf4h82UQUlKc+l14=
github.com/aws/aws-sdk-go-v2/config v1.29.14 h1:f+eEi/2cKCg9pqKBoAIwRGzVb70MRKqWX4dg1BDcSJM=
github.com/aws/aws-sdk-go-v2/config v1.29.14/go.mod h1:wVPHWcIFv3WO89w0rE10gzf17ZYy+UVS1Geq8Iei34g=
github.com/aws/aws-sdk-go-v2/credentials v1.17.67 h1:9KxtdcIA/5xPNQyZRgUSpYOE6j9Bc4+D7nZua0KGYOM=
github.com/aws/aws-sdk-go-v2/credentials v1.17.67/go.mod h1:p3C44m+cfnbv763s52gCqrjaqyPikj9Sg47kUVaNZQQ=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30 h1:x793wxmUWVDhshP8WW2mlnXuFrO4cOd3HLBroh1paFw=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30/go.mod h1:Jpne2tDnYiFascUEs2AWHJL9Yp7A5ZVy3TNyxaAjD6M=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 h1:ZK5jHhnrioRkUNOc+hOgQKlUL5JeC3S6JgLxtQ+Rm0Q=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34/go.mod h1:p4VfIceZokChbA9FzMbRGz5OV+lekcVtHlPKEO0gSZY=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 h1:SZwFm17ZUNNg5Np0ioo/gq8Mn6u9w19Mri8DnJ15Jf0=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34/go.mod h1:dFZsC0BLo346mvKQLWmoJxT+Sjp+qcVR1tRVHQGOH9Q=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d2KyU5X/BZxjOkRo=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.34 h1:ZNTqv4nIdE/DiBfUUfXcLZ/Spcuz+RjeziUtNJackkM=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.34/go.mod h1:zf7Vcd1ViW7cPqYWEHLHJkS50X0JS2IKz9Cgaj6ugrs=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3 h1:eAh2A4b5IzM/lum78bZ590jy36+d/aFLgKF/4Vd1xPE=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3/go.mod h1:0yKJC/kb8sAnmlYa6Zs3QVYqaC8ug2AbnNChv5Ox3uA=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.7.2 h1:BCG7DCXEXpNCcpwCxg1oi9pkJWH2+eZzTn9MY56MbVw=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.7.2/go.mod h1:iu6FSzgt+M2/x3Dk8zhycdIcHjEFb36IS8HVUVFoMg0=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15 h1:dM9/92u2F1JbDaGooxTq18wmmFzbJRfXfVfy96/1CXM=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15/go.mod h1:SwFBy2vjtA0vZbjjaFtfN045boopadnoVPhu4Fv66vY=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.15 h1:moLQUoVq91LiqT1nbvzDukyqAlCv89ZmwaHw/ZFlFZg=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.15/go.mod h1:ZH34PJUc8ApjBIfgQCFvkWcUDBtl/WTD+uiYHjd8igA=
github.com/aws/aws-sdk-go-v2/service/s3 v1.79.4 h1:4yxno6bNHkekkfqG/a1nz/gC2gBwhJSojV1+oTE7K+4=
github.com/aws/aws-sdk-go-v2/service/s3 v1.79.4/go.mod h1:qbn305Je/IofWBJ4bJz/Q7pDEtnnoInw/dGt71v6rHE=
github.com/aws/aws-sdk-go-v2/service/sso v1.25.3 h1:1Gw+9ajCV1jogloEv1RRnvfRFia2cL6c9cuKV2Ps+G8=
github.com/aws/aws-sdk-go-v2/service/sso v1.25.3/go.mod h1:qs4a9T5EMLl/Cajiw2TcbNt2UNo/Hqlyp+GiuG4CFDI=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.1 h1:hXmVKytPfTy5axZ+fYbR5d0cFmC3JvwLm5kM83luako=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.1/go.mod h1:MlYRNmYu/fGPoxBQVvBYr9nyr948aY/WLUvwBMBJubs=
github.com/aws/aws-sdk-go-v2/service/sts v1.33.19 h1:1XuUZ8mYJw9B6lzAkXhqHlJd/XvaX32evhproijJEZY=
github.com/aws/aws-sdk-go-v2/service/sts v1.33.19/go.mod h1:cQnB8CUnxbMU82JvlqjKR2HBOm3fe9pWorWBza6MBJ4=
github.com/aws/smithy-go v1.22.3 h1:Z//5NuZCSW6R4PhQ93hShNbyBbn8BWCmCVCt+Q8Io5k=
github.com/aws/smithy-go v1.22.3/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-redis/redis/v7 v7.4.1 h1:PASvf36gyUpr2zdOUS/9Zqc80GbM+9BDyiJSJDDOrTI=
github.com/go-redis/redis/v7 v7.4.1/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
github.com/go-resty/resty/v2 v2.16.5 h1:hBKqmWrr7uRc3euHVqmh1HTHcKn99Smr7o5spptdhTM=
github.com/go-resty/resty/v2 v2.16.5/go.mod h1:hkJtXbA2iKHzJheXYvQ8snQES5ZLGKMwQ07xAwp/fiA=
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
github.com/golang-jwt/jwt/v5 v5.2.3 h1:kkGXqQOBSDDWRhWNXTFpqGSCMyh/PLnqUvMGJPDJDs0=
github.com/golang-jwt/jwt/v5 v5.2.3/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ilyakaznacheev/cleanenv v1.5.0 h1:0VNZXggJE2OYdXE87bfSSwGxeiGt9moSR2lOrsHHvr4=
github.com/ilyakaznacheev/cleanenv v1.5.0/go.mod h1:a5aDzaJrLCQZsazHol1w8InnDcOX0OColm64SlIi6gk=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.7.5 h1:JHGfMnQY+IEtGM63d+NGMjoRpysB2JBwDr5fsngwmJs=
github.com/jackc/pgx/v5 v5.7.5/go.mod h1:aruU7o91Tc2q2cFp5h4uP3f6ztExVpyVv88Xl/8Vl8M=
github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=
github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw=
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o=
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk=
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo=
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rabbitmq/amqp091-go v1.10.0 h1:STpn5XsHlHGcecLmMFCtg7mqq0RnD+zFr4uzukfVhBw=
github.com/rabbitmq/amqp091-go v1.10.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c=
github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU=
go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk=
go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w=
go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c=
golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb h1:p31xT4yrYrSM/G4Sn2+TNUkVhFCbG9y8itM2S6Th950=
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:jbe3Bkdp+Dh2IrslsFCklNhweNTBgSYanP1UXhJDhKg=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb h1:TLPQVbx1GJ8VKZxz52VAxl1EBgKXXbTiU9Fc5fZeLn4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I=
google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg=
google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
olympos.io/encoding/edn v0.0.0-20201019073823-d3554ca0b0a3 h1:slmdOY3vp8a7KQbHkL+FLbvbkgMqmXojpFUO/jENuqQ=
olympos.io/encoding/edn v0.0.0-20201019073823-d3554ca0b0a3/go.mod h1:oVgVk4OWVDi43qWBEyGhXgYxt7+ED4iYNpTngSLX2Iw=

View File

@@ -1,5 +1,5 @@
package config
const (
ConfigBasePath = "/config.yaml"
ConfigBasePath = ".build/config/local.yaml"
)

View File

@@ -26,6 +26,17 @@ import (
// LOGIN USER
// ------------------------------
// @Summary Вход пользователя
// @Description Аутентификация пользователя по email и паролю
// @Tags auth
// @Accept json
// @Produce json
// @Param request body rmodel.LoginUserRequest true "Данные для входа"
// @Success 200 {object} rmodel.LoginUserResponse "Успешная аутентификация"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 401 {object} map[string]string "Неверные учетные данные"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Router /api/v1/login [post]
func (h *handler) loginHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "loginHandler"
@@ -110,6 +121,17 @@ func (h *handler) loginHandler(w http.ResponseWriter, r *http.Request) {
// REGISTER USER
// ------------------------------
// @Summary Регистрация пользователя
// @Description Создание нового пользователя в системе
// @Tags auth
// @Accept json
// @Produce json
// @Param request body rmodel.UserCredentials true "Данные для регистрации"
// @Success 201 {object} rmodel.RegisterResponse "Пользователь успешно создан"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 409 {object} map[string]string "Пользователь уже существует"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Router /api/v1/register [post]
func (h *handler) registerHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "registerHandler"
@@ -301,6 +323,17 @@ func (h *handler) saveUser(ctx context.Context, uid string, creds rmodel.UserCre
// LOGOUT USER
// ------------------------------
// @Summary Выход пользователя
// @Description Завершение сессии пользователя
// @Tags auth
// @Accept json
// @Produce json
// @Param request body rmodel.LogoutUserRequest true "Токен для выхода"
// @Success 200 "Успешный выход"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 401 {object} map[string]string "Неверный токен"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Router /api/v1/logout [post]
func (h *handler) logoutHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "logoutHandler"
@@ -327,6 +360,17 @@ func (h *handler) logoutHandler(w http.ResponseWriter, r *http.Request) {
// REFRESH USER TOKEN
// ------------------------------
// @Summary Обновление токена доступа
// @Description Получение нового access token по refresh token
// @Tags auth
// @Accept json
// @Produce json
// @Param request body rmodel.RefreshTokenRequest true "Refresh token"
// @Success 200 {object} rmodel.RefreshTokenResponse "Новые токены"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 401 {object} map[string]string "Неверный refresh token"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Router /api/v1/refresh-token [post]
func (h *handler) refreshTokenHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "refreshTokenHandler"
@@ -362,6 +406,17 @@ func (h *handler) refreshTokenHandler(w http.ResponseWriter, r *http.Request) {
}
}
// @Summary Страница подтверждения email
// @Description HTML страница для подтверждения email адреса пользователя
// @Tags auth
// @Accept html
// @Produce html
// @Param uid query string true "ID пользователя"
// @Param token query string true "Токен подтверждения"
// @Success 200 {string} string "HTML страница подтверждения"
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Router /api/v1/confirm_email [get]
func (h *handler) confirmEmailPageHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "confirmEmailPageHandler"
@@ -418,6 +473,16 @@ func (h *handler) confirmEmailPageHandler(w http.ResponseWriter, r *http.Request
// RESET PASSWORD
// ------------------------------
// @Summary Запрос восстановления пароля
// @Description Отправка OTP кода на email для восстановления пароля
// @Tags auth
// @Accept json
// @Produce json
// @Param request body rmodel.ForgotPasswordRequest true "Данные для восстановления пароля"
// @Success 200 {object} map[string]string "OTP код отправлен"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Router /api/v1/forgot_password [post]
func (h *handler) forgotPasswordHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "forgotPasswordHandler"
@@ -475,6 +540,17 @@ func (h *handler) forgotPasswordHandler(w http.ResponseWriter, r *http.Request)
w.WriteHeader(http.StatusCreated)
}
// @Summary Валидация OTP кода
// @Description Проверка OTP кода для восстановления пароля
// @Tags auth
// @Accept json
// @Produce json
// @Param otp query string true "OTP код"
// @Param email query string true "Email пользователя"
// @Success 200 {object} map[string]string "OTP код валиден"
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Router /api/v1/validate_otp [get]
func (h *handler) validateOTPHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "validateOTPHandler"
@@ -519,6 +595,16 @@ func (h *handler) validateOTPHandler(w http.ResponseWriter, r *http.Request) {
}
}
// @Summary Сброс пароля
// @Description Установка нового пароля после валидации OTP кода
// @Tags auth
// @Accept json
// @Produce json
// @Param request body rmodel.ResetPasswordRequest true "Данные для сброса пароля"
// @Success 200 {object} map[string]string "Пароль успешно изменен"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Router /api/v1/reset_password [put]
func (h *handler) resetPasswordHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "resetPasswordHandler"

View File

@@ -12,6 +12,17 @@ import (
"github.com/gorilla/mux"
)
// @Summary Получить баланс агента
// @Description Получение текущего баланса агента
// @Tags agents
// @Accept json
// @Produce json
// @Param agent_id path string true "ID агента"
// @Success 200 {object} rmodel.BalanceGetResponse "Баланс агента"
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/agents/{agent_id}/balance [get]
func (h *handler) getBalanceAgentHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getBalanceAgentHandler"
@@ -42,6 +53,17 @@ func (h *handler) getBalanceAgentHandler(w http.ResponseWriter, r *http.Request)
}
}
// @Summary Получить список транзакций агента
// @Description Получение списка транзакций агента с возможностью фильтрации
// @Tags agents
// @Accept json
// @Produce json
// @Param agent_id path string true "ID агента"
// @Success 200 {object} rmodel.TransactionListGetResponse "Список транзакций"
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/agents/{agent_id}/transactions [get]
func (h *handler) getTransactionListAgentHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getTransactionListAgentHandler"
@@ -84,6 +106,18 @@ func (h *handler) getTransactionListAgentHandler(w http.ResponseWriter, r *http.
}
}
// @Summary Создать транзакцию агента
// @Description Создание новой транзакции для агента
// @Tags agents
// @Accept json
// @Produce json
// @Param agent_id path string true "ID агента"
// @Param request body rmodel.TransactionCreateRequest true "Данные транзакции"
// @Success 201 {object} rmodel.TransactionCreateResponse "Транзакция создана"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/agents/{agent_id}/transactions [post]
func (h *handler) createTransactionAgentHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "createTransactionAgentHandler"
@@ -146,6 +180,17 @@ func (h *handler) createTransactionAgentHandler(w http.ResponseWriter, r *http.R
}
}
// @Summary Получить список банковских счетов агента
// @Description Получение списка банковских счетов агента
// @Tags agents
// @Accept json
// @Produce json
// @Param agent_id path string true "ID агента"
// @Success 200 {object} rmodel.BankAccountListGetResponse "Список банковских счетов"
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/agents/{agent_id}/bank_accounts [get]
func (h *handler) getBankAccountListAgentHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getBankAccountListAgentHandler"
@@ -178,6 +223,18 @@ func (h *handler) getBankAccountListAgentHandler(w http.ResponseWriter, r *http.
}
}
// @Summary Создать банковский счет агента
// @Description Создание нового банковского счета для агента
// @Tags agents
// @Accept json
// @Produce json
// @Param agent_id path string true "ID агента"
// @Param request body rmodel.BankAccountCreateRequest true "Данные банковского счета"
// @Success 201 {object} rmodel.BankAccountCreateResponse "Банковский счет создан"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/agents/{agent_id}/bank_accounts [post]
func (h *handler) createBankAccountAgentHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "createBankAccountAgentHandler"
@@ -232,6 +289,19 @@ func (h *handler) createBankAccountAgentHandler(w http.ResponseWriter, r *http.R
}
}
// @Summary Обновить банковский счет агента
// @Description Обновление информации о банковском счете агента
// @Tags agents
// @Accept json
// @Produce json
// @Param agent_id path string true "ID агента"
// @Param bank_account_id path string true "ID банковского счета"
// @Param request body rmodel.BankAccountUpdateRequest 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}/bank_accounts/{bank_account_id} [put]
func (h *handler) updateBankAccountAgentHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "updateBankAccountAgentHandler"
@@ -285,6 +355,18 @@ func (h *handler) updateBankAccountAgentHandler(w http.ResponseWriter, r *http.R
}
// TODO: test when implemented
// @Summary Удалить банковский счет агента
// @Description Удаление банковского счета агента
// @Tags agents
// @Accept json
// @Produce json
// @Param agent_id path string true "ID агента"
// @Param bank_account_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/agents/{agent_id}/bank_accounts/{bank_account_id} [delete]
func (h *handler) deleteBankAccountAgentHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "deleteBankAccountAgentHandler"
@@ -327,6 +409,17 @@ func (h *handler) deleteBankAccountAgentHandler(w http.ResponseWriter, r *http.R
}
}
// @Summary Получить баланс дистрибьютора
// @Description Получение текущего баланса дистрибьютора
// @Tags distributors
// @Accept json
// @Produce json
// @Param distributor_id path string true "ID дистрибьютора"
// @Success 200 {object} rmodel.BalanceGetResponse "Баланс дистрибьютора"
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/distributor/{distributor_id}/balance [get]
func (h *handler) getBalanceDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getBalanceDistributorHandler"
@@ -359,6 +452,18 @@ func (h *handler) getBalanceDistributorHandler(w http.ResponseWriter, r *http.Re
}
}
// @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} rmodel.BalanceGetResponse "Баланс компании"
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/distributor/{distributor_id}/company/{company_id}/balance [get]
func (h *handler) getCompanyBalanceDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getCompanyBalanceDistributorHandler"
@@ -391,6 +496,17 @@ func (h *handler) getCompanyBalanceDistributorHandler(w http.ResponseWriter, r *
}
}
// @Summary Получить список транзакций дистрибьютора
// @Description Получение списка транзакций дистрибьютора с возможностью фильтрации
// @Tags distributors
// @Accept json
// @Produce json
// @Param distributor_id path string true "ID дистрибьютора"
// @Success 200 {object} rmodel.TransactionListGetResponse "Список транзакций"
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/distributor/{distributor_id}/transactions [get]
func (h *handler) getTransactionListDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getTransactionListDistributorHandler"
@@ -434,6 +550,18 @@ func (h *handler) getTransactionListDistributorHandler(w http.ResponseWriter, r
}
}
// @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} rmodel.TransactionListGetResponse "Список транзакций компании"
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/distributor/{distributor_id}/company/{company_id}/transactions [get]
func (h *handler) getCompanyTransactionListDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getCompanyTransactionListDistributorHandler"
@@ -477,6 +605,18 @@ func (h *handler) getCompanyTransactionListDistributorHandler(w http.ResponseWri
}
}
// @Summary Создать транзакцию дистрибьютора
// @Description Создание новой транзакции для дистрибьютора
// @Tags distributors
// @Accept json
// @Produce json
// @Param distributor_id path string true "ID дистрибьютора"
// @Param request body rmodel.TransactionCreateRequest true "Данные транзакции"
// @Success 201 {object} rmodel.TransactionCreateResponse "Транзакция создана"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/distributor/{distributor_id}/transactions [post]
func (h *handler) createTransactionDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "createTransactionDistributorHandler"
@@ -539,6 +679,17 @@ func (h *handler) createTransactionDistributorHandler(w http.ResponseWriter, r *
}
}
// @Summary Получить список банковских счетов дистрибьютора
// @Description Получение списка банковских счетов дистрибьютора
// @Tags distributors
// @Accept json
// @Produce json
// @Param distributor_id path string true "ID дистрибьютора"
// @Success 200 {object} rmodel.BankAccountListGetResponse "Список банковских счетов"
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/distributor/{distributor_id}/bank_accounts [get]
func (h *handler) getBankAccountListDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getBankAccountListDistributorHandler"
@@ -571,6 +722,18 @@ func (h *handler) getBankAccountListDistributorHandler(w http.ResponseWriter, r
}
}
// @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} rmodel.BankAccountListGetResponse "Список банковских счетов компании"
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/distributor/{distributor_id}/company/{company_id}/bank_accounts [get]
func (h *handler) getCompanyBankAccountListDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getCompanyBankAccountListDistributorHandler"
@@ -603,6 +766,19 @@ func (h *handler) getCompanyBankAccountListDistributorHandler(w http.ResponseWri
}
}
// @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.BankAccountCreateRequest true "Данные банковского счета"
// @Success 201 {object} rmodel.BankAccountCreateResponse "Банковский счет создан"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/distributor/{distributor_id}/company/{company_id}/bank_accounts [post]
func (h *handler) createBankAccountDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "createBankAccountDistributorHandler"
@@ -664,6 +840,19 @@ func (h *handler) createBankAccountDistributorHandler(w http.ResponseWriter, r *
}
}
// @Summary Обновить банковский счет дистрибьютора
// @Description Обновление информации о банковском счете дистрибьютора
// @Tags distributors
// @Accept json
// @Produce json
// @Param distributor_id path string true "ID дистрибьютора"
// @Param bank_account_id path string true "ID банковского счета"
// @Param request body rmodel.BankAccountUpdateRequest 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}/bank_accounts/{bank_account_id} [put]
func (h *handler) updateBankAccountDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "updateBankAccountDistributorHandler"
@@ -725,6 +914,18 @@ func (h *handler) updateBankAccountDistributorHandler(w http.ResponseWriter, r *
}
}
// @Summary Удалить банковский счет дистрибьютора
// @Description Удаление банковского счета дистрибьютора
// @Tags distributors
// @Accept json
// @Produce json
// @Param distributor_id path string true "ID дистрибьютора"
// @Param bank_account_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}/bank_accounts/{bank_account_id} [delete]
func (h *handler) deleteBankAccountDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "deleteBankAccountDistributorHandler"

View File

@@ -5,6 +5,13 @@ import (
"net/http"
)
// @Summary Получить информацию о сборке
// @Description Получение информации о версии, коммите и дате сборки приложения
// @Tags system
// @Accept json
// @Produce json
// @Success 200 {object} map[string]string "Информация о сборке"
// @Router /api/v1/healthcheck [get]
func (h *handler) getBuildInfoHandler(w http.ResponseWriter, _ *http.Request) {
response := struct {
Version string `json:"version"`

View File

@@ -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"

View File

@@ -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"

View File

@@ -32,6 +32,19 @@ import (
"github.com/gorilla/mux"
)
// @Summary Получить персональную ссылку
// @Description Получение персональной ссылки агента для вакансии
// @Tags agents
// @Accept json
// @Produce json
// @Param agent_id path string true "ID агента"
// @Param vacancy_id path string true "ID вакансии"
// @Success 200 {object} types.PersonalLinkResponse "Персональная ссылка"
// @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}/vacancies/{vacancy_id} [get]
func (h *handler) getPersonalLinkHandler(w http.ResponseWriter, r *http.Request) {
handlerName := "getPersonalLinkHandler"
vars := mux.Vars(r)
@@ -70,6 +83,18 @@ func (h *handler) getPersonalLinkHandler(w http.ResponseWriter, r *http.Request)
}
}
// @Summary Получить анкету
// @Description Получение HTML формы анкеты для клиента
// @Tags clients
// @Accept json
// @Produce text/html
// @Param link query string true "Зашифрованная ссылка с параметрами"
// @Success 200 {string} string "HTML форма анкеты"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 404 {object} map[string]string "Вакансия не найдена"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Router /api/v1/anketa [get]
//
//nolint:funlen // TODO: make it sudo super clean
func (h *handler) getAnketaHandler(w http.ResponseWriter, r *http.Request) {
handlerName := "getAnketaHandler"
@@ -235,6 +260,19 @@ func (h *handler) extractPermissions(permMap *auth.GetPermissionsByUsersIdRespon
return perm
}
// @Summary Получить список сотрудников компании
// @Description Получение списка сотрудников компании
// @Tags employees
// @Accept json
// @Produce json
// @Param company_id path string true "ID компании"
// @Param uid query string true "ID пользователя"
// @Success 200 {object} rmodel.EmployeeResponse "Список сотрудников"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 401 {object} map[string]string "Неавторизованный доступ"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/companies/{company_id}/employees [get]
func (h *handler) getEmployeesHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getEmployeesHandler"
@@ -292,6 +330,16 @@ func (h *handler) getEmployeesHandler(w http.ResponseWriter, r *http.Request) {
}
}
// @Summary Получить статус валидации пользователя
// @Description Получение статуса валидации пользователя по UID
// @Tags system
// @Accept json
// @Produce json
// @Param uid path string true "UID пользователя"
// @Success 200 {object} map[string]string "Статус валидации"
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Router /api/v1/{uid}/validation [get]
func (h *handler) getUserValidationStatusHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getValidationStatusHandler"
@@ -331,6 +379,16 @@ func (h *handler) getUserValidationStatusHandler(w http.ResponseWriter, r *http.
}
}
// @Summary Получить файл документа
// @Description Получение файла документа по имени
// @Tags system
// @Accept json
// @Produce application/octet-stream
// @Param file path string true "Имя файла"
// @Success 200 {file} file "Файл документа"
// @Failure 404 {object} map[string]string "Файл не найден"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Router /api/v1/docs/{file} [get]
func (h *handler) getFileHandler(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
fileName := vars["file"]
@@ -389,6 +447,17 @@ func (h *handler) getFileHandler(w http.ResponseWriter, r *http.Request) {
_, _ = w.Write([]byte(link))
}
// @Summary Подтверждение email
// @Description Подтверждение email адреса пользователя по токену
// @Tags auth
// @Accept json
// @Produce json
// @Param uid query string true "ID пользователя"
// @Param token query string true "Токен подтверждения"
// @Success 200 {object} map[string]string "Email успешно подтвержден"
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Router /api/v1/verify_email [patch]
func (h *handler) verifyEmailHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "verifyEmailHandler"
@@ -528,6 +597,16 @@ func (h *handler) sendNewUserNotificationToAdmin(userInfo *auth.UserInfo, userNa
return nil
}
// @Summary Статус подтверждения email
// @Description Получение статуса подтверждения email адреса пользователя
// @Tags auth
// @Accept json
// @Produce json
// @Param uid query string true "ID пользователя"
// @Success 200 {object} map[string]string "Статус подтверждения email"
// @Failure 400 {object} map[string]string "Неверные параметры запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Router /api/v1/verify_email [get]
func (h *handler) getEmailVerificationStatusHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getEmailVerificationStatusHandler"
@@ -638,6 +717,23 @@ func (h *handler) validateEmail(email string) (bool, error) {
return isValidEmail, nil
}
// @Summary Получить события пользователя
// @Description Получение ленты событий пользователя с возможностью фильтрации
// @Tags feed
// @Accept json
// @Produce json
// @Param uid path string true "ID пользователя"
// @Param user_type query string true "Тип пользователя (agent/distributor)"
// @Param event_type query string false "Тип события (через запятую)"
// @Param show_cancelled query bool false "Показывать отмененные события"
// @Param limit query int false "Лимит событий"
// @Param offset query int false "Смещение"
// @Success 200 {object} []feed.Event "Список событий"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 401 {object} map[string]string "Неавторизованный доступ"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/feed/{uid}/events [get]
func (h *handler) GetUserEventsHandler(w http.ResponseWriter, r *http.Request) {
handlerName := "GetUserEventsHandler"
query := r.URL.Query()

View File

@@ -11,6 +11,16 @@ import (
intrmodel "git-molva.ru/Molva/molva-backend/services/api_gateway/internal/request_model/integration"
)
// @Summary Callback интеграции с ВкусВилл
// @Description Обработка callback запросов от интеграции с ВкусВилл
// @Tags integration
// @Accept json
// @Produce json
// @Param request body map[string]interface{} true "Данные callback от ВкусВилл"
// @Success 200 {object} map[string]string "Callback обработан"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Router /api/v1/integration/vkusvill/callback [post]
func (h *handler) vkusvillIntegrationCallbackHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "vkusvillIntegrationCallbackHandler"

View File

@@ -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"

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"

View File

@@ -23,7 +23,9 @@ import (
formgenerator "git-molva.ru/Molva/molva-backend/services/api_gateway/internal/form_generator"
"git-molva.ru/Molva/molva-backend/services/api_gateway/internal/config"
_ "git-molva.ru/Molva/molva-backend/services/api_gateway/internal/http/swagger/docs"
"github.com/gorilla/mux"
httpSwagger "github.com/swaggo/http-swagger"
)
type Router struct {
@@ -200,6 +202,9 @@ func SetupRouter(r *Router, buildCfg config.BuildInfo) {
// --------------- FEED ------------
subRouter.HandleFunc("/feed/{uid}/events", h.GetUserEventsHandler).Methods(http.MethodGet)
// --------------- SWAGGER UI ------------
r.Mux.PathPrefix("/swagger/").Handler(httpSwagger.WrapHandler)
}
func setupAuthHandlers(r *Router, h *handler) {

View File

@@ -18,6 +18,22 @@ 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 агента"
// @Param vacancy_id query string false "ID вакансии"
// @Param status query string false "Статус заявки"
// @Param page query int false "Номер страницы"
// @Param page_size query int false "Размер страницы"
// @Success 200 {object} rmodel.SubmissionListGetResponse "Список заявок"
// @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}/submissions [get]
func (h *handler) getSubmissionListAgentHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getSubmissionListAgentHandler"
@@ -58,6 +74,20 @@ func (h *handler) getSubmissionListAgentHandler(w http.ResponseWriter, r *http.R
}
}
// @Summary Получить CV заявки
// @Description Получение CV файла заявки
// @Tags agents
// @Accept json
// @Produce application/octet-stream
// @Param agent_id path string true "ID агента"
// @Param submission_id path string true "ID заявки"
// @Success 200 {file} file "CV файл"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 401 {object} map[string]string "Неавторизованный доступ"
// @Failure 404 {object} map[string]string "CV не найден"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Security BearerAuth
// @Router /api/v1/agents/{agent_id}/submissions/{submission_id}/cv [get]
func (h *handler) getSubmissionCVHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getSubmissionCVHandler"
@@ -121,6 +151,20 @@ func (h *handler) getSubmissionCVHandler(w http.ResponseWriter, r *http.Request)
}
}
// @Summary Удалить заявку агента
// @Description Удаление заявки агента
// @Tags agents
// @Accept json
// @Produce json
// @Param agent_id path string true "ID агента"
// @Param submission_id path string true "ID заявки"
// @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/agents/{agent_id}/submissions/{submission_id} [delete]
func (h *handler) deleteSubmissionAgentHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "deleteSubmissionHandler"
@@ -162,6 +206,22 @@ func (h *handler) deleteSubmissionAgentHandler(w http.ResponseWriter, r *http.Re
}
}
// @Summary Получить список заявок дистрибьютора
// @Description Получение списка заявок дистрибьютора с возможностью фильтрации
// @Tags distributors
// @Accept json
// @Produce json
// @Param distributor_id path string true "ID дистрибьютора"
// @Param vacancy_id path string true "ID вакансии"
// @Param status query string false "Статус заявки"
// @Param page query int false "Номер страницы"
// @Param page_size query int false "Размер страницы"
// @Success 200 {object} rmodel.SubmissionListGetResponse "Список заявок"
// @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}/vacancies/{vacancy_id}/submissions [get]
func (h *handler) getSubmissionListDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getSubmissionsDistributorHandler"
@@ -205,6 +265,22 @@ func (h *handler) getSubmissionListDistributorHandler(w http.ResponseWriter, r *
}
}
// @Summary Обновить статус заявки
// @Description Обновление статуса заявки дистрибьютором
// @Tags distributors
// @Accept json
// @Produce json
// @Param distributor_id path string true "ID дистрибьютора"
// @Param vacancy_id path string true "ID вакансии"
// @Param submission_id path string true "ID заявки"
// @Param request body rmodel.SubmissionStatusUpdateRequest true "Новый статус заявки"
// @Success 200 "Статус обновлен"
// @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}/vacancies/{vacancy_id}/submissions/{submission_id}/status [post]
func (h *handler) updateSubmissionStatusDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "updateSubmissionStatusDistributorHandler"
@@ -243,6 +319,17 @@ func (h *handler) updateSubmissionStatusDistributorHandler(w http.ResponseWriter
w.WriteHeader(http.StatusNoContent)
}
// @Summary Отправить анкету
// @Description Отправка заполненной анкеты клиента
// @Tags clients
// @Accept json
// @Produce json
// @Param request body map[string]interface{} true "Данные анкеты"
// @Success 201 {object} map[string]string "Анкета отправлена"
// @Failure 400 {object} map[string]string "Неверные данные запроса"
// @Failure 500 {object} map[string]string "Внутренняя ошибка сервера"
// @Router /api/v1/anketa [post]
//
//nolint:funlen // TODO: refactor
func (h *handler) postAnketaHandler(w http.ResponseWriter, r *http.Request) {
handlerName := "postAnketaHandler"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
package swagger
// ErrorResponse представляет стандартный ответ об ошибке
type ErrorResponse struct {
Error string `json:"error" example:"Bad Request"`
Message string `json:"message" example:"Invalid request parameters"`
Code int `json:"code" example:"400"`
}
// SuccessResponse представляет стандартный ответ об успехе
type SuccessResponse struct {
Message string `json:"message" example:"Operation completed successfully"`
Code int `json:"code" example:"200"`
}

View File

@@ -34,6 +34,27 @@ func (h *handler) setVacancyLogoLinks(
}
}
// @Summary Получить список вакансий для агента
// @Description Получение списка вакансий с возможностью фильтрации
// @Tags agents
// @Accept json
// @Produce json
// @Param agent_id path string true "ID агента"
// @Param distributor_id query string false "ID дистрибьютора"
// @Param company_id query string false "ID компании"
// @Param region query string false "Регион"
// @Param salary_bottom query int false "Минимальная зарплата"
// @Param salary_top query int false "Максимальная зарплата"
// @Param is_archived query bool false "Архивные вакансии"
// @Param status query string false "Статус вакансии"
// @Param page query int false "Номер страницы"
// @Param page_size query int false "Размер страницы"
// @Success 200 {object} rmodel.VacancyListGetResponse "Список вакансий"
// @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}/vacancies [get]
func (h *handler) getVacancyListAgentHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getVacancyListAgentHandler"
@@ -71,6 +92,26 @@ func (h *handler) getVacancyListAgentHandler(w http.ResponseWriter, r *http.Requ
}
}
// @Summary Получить список вакансий дистрибьютора
// @Description Получение списка вакансий дистрибьютора с возможностью фильтрации
// @Tags distributors
// @Accept json
// @Produce json
// @Param distributor_id path string true "ID дистрибьютора"
// @Param company_id query string false "ID компании"
// @Param region query string false "Регион"
// @Param salary_bottom query int false "Минимальная зарплата"
// @Param salary_top query int false "Максимальная зарплата"
// @Param is_archived query bool false "Архивные вакансии"
// @Param status query string false "Статус вакансии"
// @Param page query int false "Номер страницы"
// @Param page_size query int false "Размер страницы"
// @Success 200 {object} rmodel.VacancyListGetResponse "Список вакансий"
// @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}/vacancies [get]
func (h *handler) getVacancyListDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "getVacancyListDistributorHandler"
@@ -106,6 +147,19 @@ func (h *handler) getVacancyListDistributorHandler(w http.ResponseWriter, r *htt
}
}
// @Summary Создать вакансию
// @Description Создание новой вакансии дистрибьютором
// @Tags distributors
// @Accept json
// @Produce json
// @Param distributor_id path string true "ID дистрибьютора"
// @Param request body rmodel.VacancyCreateRequest true "Данные для создания вакансии"
// @Success 201 {object} rmodel.VacancyCreateResponse "Вакансия создана"
// @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}/vacancies [post]
func (h *handler) createVacancyDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "createVacancyDistributorHandler"
@@ -158,6 +212,21 @@ func (h *handler) createVacancyDistributorHandler(w http.ResponseWriter, r *http
}
}
// @Summary Обновить вакансию
// @Description Обновление информации о вакансии дистрибьютора
// @Tags distributors
// @Accept json
// @Produce json
// @Param distributor_id path string true "ID дистрибьютора"
// @Param vacancy_id path string true "ID вакансии"
// @Param request body rmodel.VacancyUpdateRequest 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}/vacancies/{vacancy_id} [patch]
func (h *handler) updateVacancyDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "updateVacancyDistributorHandler"
@@ -201,6 +270,20 @@ func (h *handler) updateVacancyDistributorHandler(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 vacancy_id path string true "ID вакансии"
// @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}/vacancies/{vacancy_id} [delete]
func (h *handler) deleteVacancyDistributorHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "deleteDistributorVacancyHandler"
@@ -235,6 +318,18 @@ func (h *handler) deleteVacancyDistributorHandler(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 vacancy_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}/vacancies/{vacancy_id}/moderation [post]
func (h *handler) sendVacancyToModerationHandler(w http.ResponseWriter, r *http.Request) {
const handlerName = "sendVacancyToModerationHandler"