From 6911886e749f45186757153fa8caf2d9f79ae0a6 Mon Sep 17 00:00:00 2001 From: Mikhail Chechnev Date: Mon, 24 Dec 2018 13:58:25 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=20=D0=BE=D0=B1=D1=8A=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=20=D0=A1=D0=B5=D1=80=D0=B2=D0=B8=D1=81=D0=B0=20=D0=B4=D0=BE?= =?UTF-8?q?=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20=D0=BA=D0=BE=D0=BD=D1=82?= =?UTF-8?q?=D0=B5=D0=BA=D1=81=D1=82=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20(context)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/db_connector.js | 1 + models/obj_service.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/db_connector.js b/core/db_connector.js index a0666f9..78dac86 100644 --- a/core/db_connector.js +++ b/core/db_connector.js @@ -138,6 +138,7 @@ class DBConnector extends EventEmitter { let srvs = await this.connector.getServices({ connection: this.connection }); srvs.forEach(s => { s.functions = []; + s.context = {}; }); //Валидируем его let sCheckResult = validateObject({ services: srvs }, objServicesSchema.Services, "Список сервисов"); diff --git a/models/obj_service.js b/models/obj_service.js index 60805ce..1f6a3e1 100644 --- a/models/obj_service.js +++ b/models/obj_service.js @@ -180,5 +180,14 @@ exports.Service = new Schema({ } }, //Список функций сервиса - functions: defServiceFunctions(true, "functions") + functions: defServiceFunctions(true, "functions"), + //Контекст работы сервиса + context: { + type: Object, + required: true, + message: { + type: "Контекст работы сервиса (context) имеет некорректный тип данных (ожидалось - Object)", + required: "Не указан контекст работы сервиса (context)" + } + } });