add errors interface and update api

This commit is contained in:
Aleksey Chichenkov 2019-03-19 14:36:08 +03:00
parent 0142743bb1
commit b242cef027
7 changed files with 117 additions and 17 deletions

View File

@ -40,6 +40,7 @@
* - - #### {@link ModelTypes} * - - #### {@link ModelTypes}
* - - #### {@link GroupTypes} - Менеджер для доступа к типам компонентов * - - #### {@link GroupTypes} - Менеджер для доступа к типам компонентов
* - - #### {@link CoreConfig} * - - #### {@link CoreConfig}
* - - #### {@link CoreErrors}
* - - #### {@link CoreTranslations} * - - #### {@link CoreTranslations}
* - - #### {@link Datasource} * - - #### {@link Datasource}
* - - #### {@link UserManager} - Менеджер для доступа к настройкам доступа пользователей * - - #### {@link UserManager} - Менеджер для доступа к настройкам доступа пользователей
@ -136,9 +137,10 @@
* - {@link Models} - Менеджер, для доступа к устройствам, определен как **ps.pl.mm** * - {@link Models} - Менеджер, для доступа к устройствам, определен как **ps.pl.mm**
* - {@link Trees} - Менеджер, для доступа к деревьям, определен как **ps.pl.tm** * - {@link Trees} - Менеджер, для доступа к деревьям, определен как **ps.pl.tm**
* - {@link CoreConfig} - Менеджер, для доступа к конфигу платформы, определен как **ps.pl.core_config** * - {@link CoreConfig} - Менеджер, для доступа к конфигу платформы, определен как **ps.pl.core_config**
* - {@link CoreTranslations} - Менеджер, для доступа к переводам, определен как **ps.pl.core_translations** * - {@link CoreErrors} - Менеджер, для доступа к конфигу платформы, определен как **ps.pl.core_errors**
* - {@link Datasource} - Менеджер, для к каталогу датасорсов, определен как **ps.pl.datasource_manager** * - {@link CoreTranslations} - Менеджер, для доступа к переводам, определен как **ps.pl.translations**
* - {@link UserManager} - Менеджер, для доступа к данным пользоваталей, определен как **ps.pl.user_manager** * - {@link Datasource} - Менеджер, для к каталогу датасорсов, определен как **ps.pl.datasources**
* - {@link UserManager} - Менеджер, для доступа к данным пользоваталей, определен как **ps.pl.users**
* *
* *
* *

View File

@ -13,9 +13,10 @@
* - {@link Models} - Менеджер, для доступа к устройствам, определен как **mm** * - {@link Models} - Менеджер, для доступа к устройствам, определен как **mm**
* - {@link Trees} - Менеджер, для доступа к деревьям, определен как **tm** * - {@link Trees} - Менеджер, для доступа к деревьям, определен как **tm**
* - {@link CoreConfig} - Менеджер, для доступа к конфигу платформы, определен как **core_config** * - {@link CoreConfig} - Менеджер, для доступа к конфигу платформы, определен как **core_config**
* - {@link CoreTranslations} - Менеджер, для доступа к переводам, определен как **core_translations** * - {@link CoreErrors} - Менеджер, для доступа к списку ошибок, определен как **core_errors**
* - {@link Datasource} - Менеджер, для к каталогу датасорсов, определен как **datasource_manager** * - {@link CoreTranslations} - Менеджер, для доступа к переводам, определен как **translations**
* - {@link UserManager} - Менеджер, для доступа к данным пользоваталей, определен как **user_manager** * - {@link Datasource} - Менеджер, для к каталогу датасорсов, определен как **datasources**
* - {@link UserManager} - Менеджер, для доступа к данным пользоваталей, определен как **users**
* *
* @group providers_interface * @group providers_interface
* @namespace Platform * @namespace Platform
@ -59,11 +60,11 @@ function Platform() {
/** /**
* *
* @public * @public
* @name core_translations * @name translations
* @type {CoreTranslations} * @type {CoreTranslations}
* @memberof Platform * @memberof Platform
*/ */
this.core_translations = new CoreTranslations(); this.translations = new CoreTranslations();
/** /**
* *
@ -77,20 +78,29 @@ function Platform() {
/** /**
* *
* @public * @public
* @name datasource_manager * @name core_errors
* @type {Datasource} * @type {CoreErrors}
* @memberof Platform * @memberof Platform
*/ */
this.datasource_manager = new Datasource(); this.core_errors = new CoreErrors();
/** /**
* *
* @public * @public
* @name user_manager * @name datasources
* @type {Datasource}
* @memberof Platform
*/
this.datasources = new Datasource();
/**
*
* @public
* @name users
* @type {UserManager} * @type {UserManager}
* @memberof Platform * @memberof Platform
*/ */
this.user_manager = new UserManager(); this.users = new UserManager();
/** /**
* *

View File

@ -0,0 +1,35 @@
/**
* ### Серверные ошибки
*
* Интерфейс предоставляющий доступ к списку ошибок платформы.
*
* ```bash
* // доступ
* ps.pl.core_errors
* ```
*
* @group manager
* @namespace CoreErrors
* @extends manager
*/
function CoreErrors() {
/**
* Возвратит перевод названия и описания для ошибки.
* <br>
* <br>
* Пример
* ```javascript
* var error_info = ps.pl.core_errors.get_error(101);
* // Вывод =>
* // {name: "Узел не существует", description: "Узел с требуемым индексом не содержится в дереве п…. Данный код ошибки используется в masterProvider"}
* ```
* @public
* @function get_error
* @memberof CoreErrors
* @param {number} _id
* @returns {{}}
*/
this.get_error = function (_id) {
};
}

View File

@ -5,7 +5,7 @@
* *
* ```bash * ```bash
* // доступ * // доступ
* ps.pl.datasource_manager * ps.pl.datasources
* ``` * ```
* *
* @group manager * @group manager

View File

@ -109,6 +109,59 @@ function Model() {
}; };
/**
*
* @public
* @function get_base_components
* @memberof Models.Model
* @param groupType {v2.model_type}
* @returns {tools.promise()}
*/
this.get_base_components = function () {
};
/**
*
* @public
* @function get_components
* @memberof Models.Model
* @param {v2.string} _c_tag
* @param {v2.list<v2.string>} _parent_c_tags
* @returns {tools.promise()}
*/
this.get_components = function (_c_tag, _parent_c_tags) {
};
/**
*
* @public
* @function get_components_with_id
* @memberof Models.Model
* @param {v2.string} _c_tag
* @param {v2.list<v2.string>} _parent_c_tags
* @param {v2.string} _id
* @returns {tools.promise()}
*/
this.get_components_with_id = function (_c_tag, _parent_c_tags, _id) {
};
/**
*
* @public
* @function get_components_with_parent_id
* @memberof Models.Model
* @param {v2.string} _c_tag
* @param {v2.list<v2.string>} _parent_c_tags
* @param {v2.string} _parent_id
* @returns {tools.promise()}
*/
this.get_components_with_parent_id = function (_c_tag, _parent_c_tags, _parent_id) {
};
/** /**
* *
* @public * @public

View File

@ -5,7 +5,7 @@
* *
* ```bash * ```bash
* // доступ * // доступ
* ps.pl.core_translations * ps.pl.translations
* ``` * ```
* *
* @group manager * @group manager
@ -19,7 +19,7 @@ function CoreTranslations() {
* *
* @example * @example
* // Пример * // Пример
* var result = ps.pl.core_translations.translations(); * var result = ps.pl.translations.translations();
* var string = JSON.stringify(result, true, 3); * var string = JSON.stringify(result, true, 3);
* *
* // результат будет примерно такой * // результат будет примерно такой

View File

@ -4,7 +4,7 @@
* *
* ```bash * ```bash
* // доступ * // доступ
* ps.pl.user_manager * ps.pl.users
* ``` * ```
* *
* @group manager * @group manager