From 972e80527a66071bae321c66e3d02bdf28394021 Mon Sep 17 00:00:00 2001 From: Nikitin Aleksandr Date: Thu, 19 Oct 2023 09:40:16 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20TELEGRAM?= =?UTF-8?q?=5FMESSAGES=5FCOUNT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env_empty | 3 ++- README.md | 1 + bin/date.txt | 2 +- bin/settings/services_add.txt | 32 +++++++++++++++++++------------- bin/subversion.txt | 2 +- internal/config/config.go | 15 ++++++++++----- readme.rus | 1 + 7 files changed, 35 insertions(+), 21 deletions(-) diff --git a/.env_empty b/.env_empty index 6a05beb..7c6eb10 100644 --- a/.env_empty +++ b/.env_empty @@ -3,9 +3,10 @@ TELEGRAM_APP_ID= TELEGRAM_APP_HASH= TELEGRAM_PHONE_FROM= TELEGRAM_PHONE_SEND_TEST= +TELEGRAM_CHAT_NAME= +TELEGRAM_MESSAGES_COUNT= LOKI_URL= GRAFANA_LOGIN= GRAFANA_PASSWORD= -TELEGRAM_CHAT_NAME= diff --git a/README.md b/README.md index 0569bad..3467494 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ LOKI_URL= GRAFANA_LOGIN= GRAFANA_PASSWORD= TELEGRAM_CHAT_NAME= +TELEGRAM_MESSAGES_COUNT= 3. Fill in the settings/services.txt file diff --git a/bin/date.txt b/bin/date.txt index 25fa65e..87c629f 100644 --- a/bin/date.txt +++ b/bin/date.txt @@ -1 +1 @@ -2023-10-16 06:56:58.125 \ No newline at end of file +2023-10-19 06:39:37.367 \ No newline at end of file diff --git a/bin/settings/services_add.txt b/bin/settings/services_add.txt index 8ca07c9..00fe0fa 100644 --- a/bin/settings/services_add.txt +++ b/bin/settings/services_add.txt @@ -1,29 +1,35 @@ { "admin-service": "@t_bondarenko140", "billing-status-service": "@ivanov_i_i", - "calendar-service": "@rexMonstra", - "claim-service": "@nich2000", - "close-service": "", + "calendar-service": "@AliceDwarf", + "claim-service": "@t_bondarenko140", + "close-service": "@rexMonstra", + "cryptopro-service": "@ivanov_i_i", "docone-service": "", "fnsndscaws-service": "@ivanov_i_i", - "inner-notify-service": "", + "inner-notify-service": "@t_bondarenko140", "kafka-service": "@ivanov_i_i", - "loop-service": "", - "monitor-service": "@nich2000", - "notifi-delivery-service": "", + "loop-service": "@rexMonstra", + "monitor-service": "@rexMonstra", + "notifi-delivery-service": "@ivanov_i_i", "notify-service": "@ivanov_i_i", "nsi-service": "@ivanov_i_i", "pdf-service": "@t_bondarenko140", - "plan-service": "", + "plan-service": "@rexMonstra", "post-office_service": "@ivanov_i_i", - "preclaim-service": "", + "preclaim-service": "@t_bondarenko140", + "pretrial-service": "@t_bondarenko140", "rabbit-service": "@ivanov_i_i", - "report-service": "", + "report-service": "@rexMonstra", "snotify-service": "", - "state-duty-service": "", - "status-service": "", + "state-duty-service": "@AliceDwarf", + "stage-service": "@rexMonstra", + "status-service": "@rexMonstra", "sync-service": "@nich2000", + "schedule-service": "@t_bondarenko140", + "state-duty-service": "@AliceDwarf", "casebook-service": "@ManyakRus", "debezium-adapter-postgres": "@ManyakRus", - "debtors-list": "@ManyakRus" + "debtors-list": "@ManyakRus", + "stack-exchange-postgres": "@ManyakRus" } \ No newline at end of file diff --git a/bin/subversion.txt b/bin/subversion.txt index 32af320..4424fb1 100644 --- a/bin/subversion.txt +++ b/bin/subversion.txt @@ -1 +1 @@ -00132 \ No newline at end of file +00133 \ No newline at end of file diff --git a/internal/config/config.go b/internal/config/config.go index b173617..ebd82dd 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -11,11 +11,12 @@ var Settings SettingsINI // SettingsINI - структура для хранения всех нужных переменных окружения type SettingsINI struct { - LOKI_URL string - TELEGRAM_CHAT_NAME string - GRAFANA_LOGIN string - GRAFANA_PASSWORD string - INTERVAL_SEND_MINUTES int + LOKI_URL string + TELEGRAM_CHAT_NAME string + GRAFANA_LOGIN string + GRAFANA_PASSWORD string + INTERVAL_SEND_MINUTES int + TELEGRAM_MESSAGES_COUNT int } // FillSettings загружает переменные окружения в структуру из переменных окружения @@ -31,6 +32,10 @@ func FillSettings() { if err != nil { Settings.INTERVAL_SEND_MINUTES = 10 } + Settings.TELEGRAM_MESSAGES_COUNT, err = strconv.Atoi(os.Getenv("TELEGRAM_MESSAGES_COUNT")) + if err != nil || Settings.TELEGRAM_MESSAGES_COUNT == 0 { + Settings.TELEGRAM_MESSAGES_COUNT = 1 + } if Settings.TELEGRAM_CHAT_NAME == "" { log.Panic("Error: Need fill TELEGRAM_CHAT_NAME") diff --git a/readme.rus b/readme.rus index 8aae59d..c7a989d 100644 --- a/readme.rus +++ b/readme.rus @@ -27,6 +27,7 @@ LOKI_URL= GRAFANA_LOGIN= GRAFANA_PASSWORD= TELEGRAM_CHAT_NAME= +TELEGRAM_MESSAGES_COUNT= 3. Заполнить файл settings/services.txt