From ec2de8a159a967964bc9d393e48d6f554994cf10 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 14 Mar 2017 12:33:57 +0200 Subject: [PATCH] docs --- app/library/App/Resources/AllPositionResource.php | 14 +++++++------- app/library/App/Resources/GaResource.php | 20 +++++++++++--------- app/views/general/documentation.phtml | 26 +++++++++++++++----------- composer.lock | 36 ++++++++++++++++++------------------ 4 files changed, 51 insertions(+), 45 deletions(-) diff --git a/app/library/App/Resources/AllPositionResource.php b/app/library/App/Resources/AllPositionResource.php index ec8b81a..145700e 100644 --- a/app/library/App/Resources/AllPositionResource.php +++ b/app/library/App/Resources/AllPositionResource.php @@ -34,7 +34,7 @@ class AllPositionResource extends ApiResource ApiEndpoint::factory('/project', HttpMethods::GET, 'projectAction') ->name('project') ->description('Данные о проекте') - ->exampleRequest([ + ->paramsDescription([ 'required params' => [ 'project' => "integer(ID проекта)" ] @@ -56,7 +56,7 @@ class AllPositionResource extends ApiResource ApiEndpoint::factory('/projects', HttpMethods::GET, 'projectsAction') ->name('projects') ->description('Список проектов пользователя') - ->exampleRequest([ + ->paramsDescription([ 'required params' => [], 'optional params' => [ 'id_group' => "integer(ID проекта)" @@ -91,7 +91,7 @@ class AllPositionResource extends ApiResource ApiEndpoint::factory('/projects_group', HttpMethods::GET, 'projectsGroupAction') ->name('projects group') ->description('Список групп проектов') - ->exampleRequest([ + ->paramsDescription([ 'required params' => [] ]) ->exampleResponse([ @@ -111,7 +111,7 @@ class AllPositionResource extends ApiResource ApiEndpoint::factory('/queries', HttpMethods::GET, 'queriesAction') ->name('queries') ->description('Список запросов, по которым определяется позиция сайта') - ->exampleRequest([ + ->paramsDescription([ 'required params' => [ 'project' => 'integer(ID проекта)' ], @@ -142,7 +142,7 @@ class AllPositionResource extends ApiResource ApiEndpoint::factory('/queries_group', HttpMethods::GET, 'queriesGroupAction') ->name('queries group') ->description('Список групп запросов') - ->exampleRequest([ + ->paramsDescription([ 'required params' => ['project' => 'integer(ID проекта)'] ]) ->exampleResponse([ @@ -162,7 +162,7 @@ class AllPositionResource extends ApiResource ApiEndpoint::factory('/report', HttpMethods::GET, 'reportAction') ->name('report') ->description('Отчет по позициям сайта') - ->exampleRequest([ + ->paramsDescription([ 'required params' => [ 'project' => 'integer(ID проекта)' ], @@ -224,7 +224,7 @@ class AllPositionResource extends ApiResource ApiEndpoint::factory('/visibility', HttpMethods::GET, 'visibilityAction') ->name('visibility') ->description('Данные о видимости сайта за указанный период') - ->exampleRequest([ + ->paramsDescription([ 'required params' => [ 'project' => 'integer(ID проекта)' ], diff --git a/app/library/App/Resources/GaResource.php b/app/library/App/Resources/GaResource.php index 92b3f8c..5eececd 100644 --- a/app/library/App/Resources/GaResource.php +++ b/app/library/App/Resources/GaResource.php @@ -40,16 +40,18 @@ class GaResource extends ApiResource { "Referral" => "128", "Social" => "29" ]) - ->exampleRequest([ + ->paramsDescription([ 'get params' => [ - 'required' => [], - 'optional' => [ - 'user_id' => '1', - 'view_id' => 'GA VIEW_ID', - 'start' => '30daysAgo / 2015-03-01', - 'end' => 'today', - 'metric' => 'users,sessions', - 'dimension' => 'source,browser' + 'required params' => [ + 'metric' => 'string(метрика Google, линк в описании запроса)', + 'dimension' => 'string(размерность Google, линк в описании запроса)', + 'start' => 'ГГГГ-ММ-ДД/NdaysAgo, где N – целое положительное число(дата начала загрузки данных)', + 'end' => 'ГГГГ-ММ-ДД/NdaysAgo, где N – целое положительное число(дата конца загрузки данных)' + ], + 'optional params' => [ + 'user_id' => 'integer(id пользователя в системе)', + 'view_id' => 'integer(id представления проэкта с гугл аналитики)', + 'chart' => 'boolean(Задает структуру возвращаемых данных(true для графиков))', ] ], 'summary' => 'http://test-30.artweb.com.ua/ga?view_id=119240817&metric=users,sessions&dimension=source,browser' diff --git a/app/views/general/documentation.phtml b/app/views/general/documentation.phtml index 224eb0d..f3bda13 100755 --- a/app/views/general/documentation.phtml +++ b/app/views/general/documentation.phtml @@ -23,9 +23,9 @@

-

Documentation

+

Документация

-

Collections

+

Коллекции

@@ -35,15 +35,15 @@
- + - + - +
DescriptionОписание {{ collection.description }}
Base pathПрефикс {{ collection.prefix }}
FieldsПоля @@ -65,27 +65,31 @@
- + - + + + + + - + - + - + @@ -97,7 +101,7 @@ -

Other routes

+

Другие запросы

diff --git a/composer.lock b/composer.lock index e99c564..c8a351a 100755 --- a/composer.lock +++ b/composer.lock @@ -438,12 +438,12 @@ "source": { "type": "git", "url": "https://github.com/libertysumy/phalcon-rest.git", - "reference": "8d51579789208e08627ddaf4e5228670f4850e70" + "reference": "d5b1ec5a1f1c5fb88220cd2e7cecaa84fcec9637" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/libertysumy/phalcon-rest/zipball/8d51579789208e08627ddaf4e5228670f4850e70", - "reference": "8d51579789208e08627ddaf4e5228670f4850e70", + "url": "https://api.github.com/repos/libertysumy/phalcon-rest/zipball/d5b1ec5a1f1c5fb88220cd2e7cecaa84fcec9637", + "reference": "d5b1ec5a1f1c5fb88220cd2e7cecaa84fcec9637", "shasum": "" }, "require": { @@ -473,20 +473,20 @@ } ], "description": "Phalcon REST Library", - "time": "2017-02-14 18:19:40" + "time": "2017-03-14 10:09:24" }, { "name": "monolog/monolog", - "version": "1.22.0", + "version": "1.22.1", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "bad29cb8d18ab0315e6c477751418a82c850d558" + "reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bad29cb8d18ab0315e6c477751418a82c850d558", - "reference": "bad29cb8d18ab0315e6c477751418a82c850d558", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1e044bc4b34e91743943479f1be7a1d5eb93add0", + "reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0", "shasum": "" }, "require": { @@ -551,7 +551,7 @@ "logging", "psr-3" ], - "time": "2016-11-26 00:15:39" + "time": "2017-03-13 07:08:03" }, { "name": "phpseclib/phpseclib", @@ -2295,7 +2295,7 @@ }, { "name": "symfony/browser-kit", - "version": "v3.2.5", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", @@ -2352,7 +2352,7 @@ }, { "name": "symfony/console", - "version": "v3.2.5", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", @@ -2415,7 +2415,7 @@ }, { "name": "symfony/css-selector", - "version": "v3.2.5", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -2468,7 +2468,7 @@ }, { "name": "symfony/debug", - "version": "v3.2.5", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", @@ -2525,7 +2525,7 @@ }, { "name": "symfony/dom-crawler", - "version": "v3.2.5", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", @@ -2581,7 +2581,7 @@ }, { "name": "symfony/event-dispatcher", - "version": "v3.2.5", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -2641,7 +2641,7 @@ }, { "name": "symfony/finder", - "version": "v3.2.5", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -2749,7 +2749,7 @@ }, { "name": "symfony/process", - "version": "v3.2.5", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -2798,7 +2798,7 @@ }, { "name": "symfony/yaml", - "version": "v3.2.5", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", -- libgit2 0.21.4
DescriptionОписание {{ endpoint.description }}
Full URLURL {{ vm.documentation.basePath + collection.prefix + endpoint.path }}
Описание параметров
{{ endpoint.paramsDescription | json }}
Example requestПример запроса
{{ endpoint.exampleRequest | json }}
Example responseПример ответа
{{ endpoint.exampleResponse | json }}
Allowed rolesДоступ
{{ role }}