Рефакторинг наименования параметров конфигурации подключения
This commit is contained in:
parent
22c69a9df7
commit
ea74ff4ed1
@ -16,9 +16,9 @@ let dbConnect = {
|
|||||||
//Строка подключения к БД
|
//Строка подключения к БД
|
||||||
connectString: "DEMOP_CITKSERV_WAN",
|
connectString: "DEMOP_CITKSERV_WAN",
|
||||||
//Наименование модуля (для сессии БД)
|
//Наименование модуля (для сессии БД)
|
||||||
moduleName: "PARUS$ExchangeServer",
|
sessionModuleName: "PARUS$ExchangeServer",
|
||||||
//Подключаемый модуль обслуживания БД (низкоуровневые функции работы с СУБД)
|
//Подключаемый модуль обслуживания БД (низкоуровневые функции работы с СУБД)
|
||||||
module: "parus_oracle_db.js"
|
connectorModule: "parus_oracle_db.js"
|
||||||
};
|
};
|
||||||
|
|
||||||
//Параметры обработки очереди исходящих сообщений
|
//Параметры обработки очереди исходящих сообщений
|
||||||
|
@ -34,15 +34,16 @@ class DBConnector {
|
|||||||
{ name: "user", required: true },
|
{ name: "user", required: true },
|
||||||
{ name: "password", required: true },
|
{ name: "password", required: true },
|
||||||
{ name: "connectString", required: true },
|
{ name: "connectString", required: true },
|
||||||
{ name: "module", required: false }
|
{ name: "sessionModuleName", required: true },
|
||||||
|
{ name: "connectorModule", required: false }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
//Если структура объекта в норме
|
//Если структура объекта в норме
|
||||||
if (!checkResult) {
|
if (!checkResult) {
|
||||||
//Проверяем наличие модуля для работы с БД в настройках подключения
|
//Проверяем наличие модуля для работы с БД в настройках подключения
|
||||||
if (dbConnect.module) {
|
if (dbConnect.connectorModule) {
|
||||||
//Подключим модуль
|
//Подключим модуль
|
||||||
this.connector = require(makeModuleFullPath(dbConnect.module));
|
this.connector = require(makeModuleFullPath(dbConnect.connectorModule));
|
||||||
//Проверим его интерфейс
|
//Проверим его интерфейс
|
||||||
if (
|
if (
|
||||||
!checkModuleInterface(this.connector, {
|
!checkModuleInterface(this.connector, {
|
||||||
@ -88,7 +89,7 @@ class DBConnector {
|
|||||||
this.connectSettings.user,
|
this.connectSettings.user,
|
||||||
this.connectSettings.password,
|
this.connectSettings.password,
|
||||||
this.connectSettings.connectString,
|
this.connectSettings.connectString,
|
||||||
this.connectSettings.moduleName
|
this.connectSettings.sessionModuleName
|
||||||
);
|
);
|
||||||
return this.connection;
|
return this.connection;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user