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)" + } + } });