Commit ec2de8a159a967964bc9d393e48d6f554994cf10
1 parent
34cfbfc0
docs
Showing
4 changed files
with
51 additions
and
45 deletions
Show diff stats
app/library/App/Resources/AllPositionResource.php
@@ -34,7 +34,7 @@ class AllPositionResource extends ApiResource | @@ -34,7 +34,7 @@ class AllPositionResource extends ApiResource | ||
34 | ApiEndpoint::factory('/project', HttpMethods::GET, 'projectAction') | 34 | ApiEndpoint::factory('/project', HttpMethods::GET, 'projectAction') |
35 | ->name('project') | 35 | ->name('project') |
36 | ->description('Данные о проекте') | 36 | ->description('Данные о проекте') |
37 | - ->exampleRequest([ | 37 | + ->paramsDescription([ |
38 | 'required params' => [ | 38 | 'required params' => [ |
39 | 'project' => "integer(ID проекта)" | 39 | 'project' => "integer(ID проекта)" |
40 | ] | 40 | ] |
@@ -56,7 +56,7 @@ class AllPositionResource extends ApiResource | @@ -56,7 +56,7 @@ class AllPositionResource extends ApiResource | ||
56 | ApiEndpoint::factory('/projects', HttpMethods::GET, 'projectsAction') | 56 | ApiEndpoint::factory('/projects', HttpMethods::GET, 'projectsAction') |
57 | ->name('projects') | 57 | ->name('projects') |
58 | ->description('Список проектов пользователя') | 58 | ->description('Список проектов пользователя') |
59 | - ->exampleRequest([ | 59 | + ->paramsDescription([ |
60 | 'required params' => [], | 60 | 'required params' => [], |
61 | 'optional params' => [ | 61 | 'optional params' => [ |
62 | 'id_group' => "integer(ID проекта)" | 62 | 'id_group' => "integer(ID проекта)" |
@@ -91,7 +91,7 @@ class AllPositionResource extends ApiResource | @@ -91,7 +91,7 @@ class AllPositionResource extends ApiResource | ||
91 | ApiEndpoint::factory('/projects_group', HttpMethods::GET, 'projectsGroupAction') | 91 | ApiEndpoint::factory('/projects_group', HttpMethods::GET, 'projectsGroupAction') |
92 | ->name('projects group') | 92 | ->name('projects group') |
93 | ->description('Список групп проектов') | 93 | ->description('Список групп проектов') |
94 | - ->exampleRequest([ | 94 | + ->paramsDescription([ |
95 | 'required params' => [] | 95 | 'required params' => [] |
96 | ]) | 96 | ]) |
97 | ->exampleResponse([ | 97 | ->exampleResponse([ |
@@ -111,7 +111,7 @@ class AllPositionResource extends ApiResource | @@ -111,7 +111,7 @@ class AllPositionResource extends ApiResource | ||
111 | ApiEndpoint::factory('/queries', HttpMethods::GET, 'queriesAction') | 111 | ApiEndpoint::factory('/queries', HttpMethods::GET, 'queriesAction') |
112 | ->name('queries') | 112 | ->name('queries') |
113 | ->description('Список запросов, по которым определяется позиция сайта') | 113 | ->description('Список запросов, по которым определяется позиция сайта') |
114 | - ->exampleRequest([ | 114 | + ->paramsDescription([ |
115 | 'required params' => [ | 115 | 'required params' => [ |
116 | 'project' => 'integer(ID проекта)' | 116 | 'project' => 'integer(ID проекта)' |
117 | ], | 117 | ], |
@@ -142,7 +142,7 @@ class AllPositionResource extends ApiResource | @@ -142,7 +142,7 @@ class AllPositionResource extends ApiResource | ||
142 | ApiEndpoint::factory('/queries_group', HttpMethods::GET, 'queriesGroupAction') | 142 | ApiEndpoint::factory('/queries_group', HttpMethods::GET, 'queriesGroupAction') |
143 | ->name('queries group') | 143 | ->name('queries group') |
144 | ->description('Список групп запросов') | 144 | ->description('Список групп запросов') |
145 | - ->exampleRequest([ | 145 | + ->paramsDescription([ |
146 | 'required params' => ['project' => 'integer(ID проекта)'] | 146 | 'required params' => ['project' => 'integer(ID проекта)'] |
147 | ]) | 147 | ]) |
148 | ->exampleResponse([ | 148 | ->exampleResponse([ |
@@ -162,7 +162,7 @@ class AllPositionResource extends ApiResource | @@ -162,7 +162,7 @@ class AllPositionResource extends ApiResource | ||
162 | ApiEndpoint::factory('/report', HttpMethods::GET, 'reportAction') | 162 | ApiEndpoint::factory('/report', HttpMethods::GET, 'reportAction') |
163 | ->name('report') | 163 | ->name('report') |
164 | ->description('Отчет по позициям сайта') | 164 | ->description('Отчет по позициям сайта') |
165 | - ->exampleRequest([ | 165 | + ->paramsDescription([ |
166 | 'required params' => [ | 166 | 'required params' => [ |
167 | 'project' => 'integer(ID проекта)' | 167 | 'project' => 'integer(ID проекта)' |
168 | ], | 168 | ], |
@@ -224,7 +224,7 @@ class AllPositionResource extends ApiResource | @@ -224,7 +224,7 @@ class AllPositionResource extends ApiResource | ||
224 | ApiEndpoint::factory('/visibility', HttpMethods::GET, 'visibilityAction') | 224 | ApiEndpoint::factory('/visibility', HttpMethods::GET, 'visibilityAction') |
225 | ->name('visibility') | 225 | ->name('visibility') |
226 | ->description('Данные о видимости сайта за указанный период') | 226 | ->description('Данные о видимости сайта за указанный период') |
227 | - ->exampleRequest([ | 227 | + ->paramsDescription([ |
228 | 'required params' => [ | 228 | 'required params' => [ |
229 | 'project' => 'integer(ID проекта)' | 229 | 'project' => 'integer(ID проекта)' |
230 | ], | 230 | ], |
app/library/App/Resources/GaResource.php
@@ -40,16 +40,18 @@ class GaResource extends ApiResource { | @@ -40,16 +40,18 @@ class GaResource extends ApiResource { | ||
40 | "Referral" => "128", | 40 | "Referral" => "128", |
41 | "Social" => "29" | 41 | "Social" => "29" |
42 | ]) | 42 | ]) |
43 | - ->exampleRequest([ | 43 | + ->paramsDescription([ |
44 | 'get params' => [ | 44 | 'get params' => [ |
45 | - 'required' => [], | ||
46 | - 'optional' => [ | ||
47 | - 'user_id' => '1', | ||
48 | - 'view_id' => 'GA VIEW_ID', | ||
49 | - 'start' => '30daysAgo / 2015-03-01', | ||
50 | - 'end' => 'today', | ||
51 | - 'metric' => 'users,sessions', | ||
52 | - 'dimension' => 'source,browser' | 45 | + 'required params' => [ |
46 | + 'metric' => 'string(метрика Google, линк в описании запроса)', | ||
47 | + 'dimension' => 'string(размерность Google, линк в описании запроса)', | ||
48 | + 'start' => 'ГГГГ-ММ-ДД/NdaysAgo, где N – целое положительное число(дата начала загрузки данных)', | ||
49 | + 'end' => 'ГГГГ-ММ-ДД/NdaysAgo, где N – целое положительное число(дата конца загрузки данных)' | ||
50 | + ], | ||
51 | + 'optional params' => [ | ||
52 | + 'user_id' => 'integer(id пользователя в системе)', | ||
53 | + 'view_id' => 'integer(id представления проэкта с гугл аналитики)', | ||
54 | + 'chart' => 'boolean(Задает структуру возвращаемых данных(true для графиков))', | ||
53 | ] | 55 | ] |
54 | ], | 56 | ], |
55 | 'summary' => 'http://test-30.artweb.com.ua/ga?view_id=119240817&metric=users,sessions&dimension=source,browser' | 57 | 'summary' => 'http://test-30.artweb.com.ua/ga?view_id=119240817&metric=users,sessions&dimension=source,browser' |
app/views/general/documentation.phtml
@@ -23,9 +23,9 @@ | @@ -23,9 +23,9 @@ | ||
23 | <div class="container"> | 23 | <div class="container"> |
24 | 24 | ||
25 | <h1><?php echo $title ?></h1> | 25 | <h1><?php echo $title ?></h1> |
26 | - <p class="lead">Documentation</p> | 26 | + <p class="lead">Документация</p> |
27 | 27 | ||
28 | - <h2>Collections</h2> | 28 | + <h2>Коллекции</h2> |
29 | 29 | ||
30 | <div ng-repeat="collection in vm.documentation.collections"> | 30 | <div ng-repeat="collection in vm.documentation.collections"> |
31 | 31 | ||
@@ -35,15 +35,15 @@ | @@ -35,15 +35,15 @@ | ||
35 | </div> | 35 | </div> |
36 | <table class="table table-bordered"> | 36 | <table class="table table-bordered"> |
37 | <tr ng-show="collection.description"> | 37 | <tr ng-show="collection.description"> |
38 | - <th>Description</th> | 38 | + <th>Описание</th> |
39 | <td>{{ collection.description }}</td> | 39 | <td>{{ collection.description }}</td> |
40 | </tr> | 40 | </tr> |
41 | <tr> | 41 | <tr> |
42 | - <th>Base path</th> | 42 | + <th>Префикс</th> |
43 | <td>{{ collection.prefix }}</td> | 43 | <td>{{ collection.prefix }}</td> |
44 | </tr> | 44 | </tr> |
45 | <tr ng-show="collection.fields"> | 45 | <tr ng-show="collection.fields"> |
46 | - <th>Fields</th> | 46 | + <th>Поля</th> |
47 | <td> | 47 | <td> |
48 | <table class="table table-bordered"> | 48 | <table class="table table-bordered"> |
49 | <tr ng-repeat="(field, dataType) in collection.fields"> | 49 | <tr ng-repeat="(field, dataType) in collection.fields"> |
@@ -65,27 +65,31 @@ | @@ -65,27 +65,31 @@ | ||
65 | </div> | 65 | </div> |
66 | <table class="table table-bordered"> | 66 | <table class="table table-bordered"> |
67 | <tr ng-show="endpoint.description"> | 67 | <tr ng-show="endpoint.description"> |
68 | - <th>Description</th> | 68 | + <th>Описание</th> |
69 | <th>{{ endpoint.description }}</th> | 69 | <th>{{ endpoint.description }}</th> |
70 | </tr> | 70 | </tr> |
71 | <tr> | 71 | <tr> |
72 | - <th>Full URL</th> | 72 | + <th>URL</th> |
73 | <td> | 73 | <td> |
74 | <a ng-href="{{ vm.documentation.basePath + collection.prefix + endpoint.path }}" target="_blank"> | 74 | <a ng-href="{{ vm.documentation.basePath + collection.prefix + endpoint.path }}" target="_blank"> |
75 | {{ vm.documentation.basePath + collection.prefix + endpoint.path }} | 75 | {{ vm.documentation.basePath + collection.prefix + endpoint.path }} |
76 | </a> | 76 | </a> |
77 | </td> | 77 | </td> |
78 | </tr> | 78 | </tr> |
79 | + <tr ng-show="endpoint.paramsDescription"> | ||
80 | + <th>Описание параметров</th> | ||
81 | + <th><pre style="font-weight: normal;">{{ endpoint.paramsDescription | json }}</pre></th> | ||
82 | + </tr> | ||
79 | <tr ng-show="endpoint.exampleRequest"> | 83 | <tr ng-show="endpoint.exampleRequest"> |
80 | - <th>Example request</th> | 84 | + <th>Пример запроса</th> |
81 | <th><pre style="font-weight: normal;">{{ endpoint.exampleRequest | json }}</pre></th> | 85 | <th><pre style="font-weight: normal;">{{ endpoint.exampleRequest | json }}</pre></th> |
82 | </tr> | 86 | </tr> |
83 | <tr ng-show="endpoint.exampleResponse"> | 87 | <tr ng-show="endpoint.exampleResponse"> |
84 | - <th>Example response</th> | 88 | + <th>Пример ответа</th> |
85 | <th><pre style="font-weight: normal;">{{ endpoint.exampleResponse | json }}</pre></th> | 89 | <th><pre style="font-weight: normal;">{{ endpoint.exampleResponse | json }}</pre></th> |
86 | </tr> | 90 | </tr> |
87 | <tr> | 91 | <tr> |
88 | - <th>Allowed roles</th> | 92 | + <th>Доступ</th> |
89 | <td> | 93 | <td> |
90 | <div class="label label-primary" ng-repeat="role in endpoint.allowedRoles" style="margin-right: 5px">{{ role }}</div> | 94 | <div class="label label-primary" ng-repeat="role in endpoint.allowedRoles" style="margin-right: 5px">{{ role }}</div> |
91 | </td> | 95 | </td> |
@@ -97,7 +101,7 @@ | @@ -97,7 +101,7 @@ | ||
97 | 101 | ||
98 | </div> | 102 | </div> |
99 | 103 | ||
100 | - <h2>Other routes</h2> | 104 | + <h2>Другие запросы</h2> |
101 | 105 | ||
102 | <div class="panel panel-default" ng-repeat="route in vm.documentation.routes"> | 106 | <div class="panel panel-default" ng-repeat="route in vm.documentation.routes"> |
103 | <div class="panel-heading"> | 107 | <div class="panel-heading"> |
composer.lock
@@ -438,12 +438,12 @@ | @@ -438,12 +438,12 @@ | ||
438 | "source": { | 438 | "source": { |
439 | "type": "git", | 439 | "type": "git", |
440 | "url": "https://github.com/libertysumy/phalcon-rest.git", | 440 | "url": "https://github.com/libertysumy/phalcon-rest.git", |
441 | - "reference": "8d51579789208e08627ddaf4e5228670f4850e70" | 441 | + "reference": "d5b1ec5a1f1c5fb88220cd2e7cecaa84fcec9637" |
442 | }, | 442 | }, |
443 | "dist": { | 443 | "dist": { |
444 | "type": "zip", | 444 | "type": "zip", |
445 | - "url": "https://api.github.com/repos/libertysumy/phalcon-rest/zipball/8d51579789208e08627ddaf4e5228670f4850e70", | ||
446 | - "reference": "8d51579789208e08627ddaf4e5228670f4850e70", | 445 | + "url": "https://api.github.com/repos/libertysumy/phalcon-rest/zipball/d5b1ec5a1f1c5fb88220cd2e7cecaa84fcec9637", |
446 | + "reference": "d5b1ec5a1f1c5fb88220cd2e7cecaa84fcec9637", | ||
447 | "shasum": "" | 447 | "shasum": "" |
448 | }, | 448 | }, |
449 | "require": { | 449 | "require": { |
@@ -473,20 +473,20 @@ | @@ -473,20 +473,20 @@ | ||
473 | } | 473 | } |
474 | ], | 474 | ], |
475 | "description": "Phalcon REST Library", | 475 | "description": "Phalcon REST Library", |
476 | - "time": "2017-02-14 18:19:40" | 476 | + "time": "2017-03-14 10:09:24" |
477 | }, | 477 | }, |
478 | { | 478 | { |
479 | "name": "monolog/monolog", | 479 | "name": "monolog/monolog", |
480 | - "version": "1.22.0", | 480 | + "version": "1.22.1", |
481 | "source": { | 481 | "source": { |
482 | "type": "git", | 482 | "type": "git", |
483 | "url": "https://github.com/Seldaek/monolog.git", | 483 | "url": "https://github.com/Seldaek/monolog.git", |
484 | - "reference": "bad29cb8d18ab0315e6c477751418a82c850d558" | 484 | + "reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0" |
485 | }, | 485 | }, |
486 | "dist": { | 486 | "dist": { |
487 | "type": "zip", | 487 | "type": "zip", |
488 | - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bad29cb8d18ab0315e6c477751418a82c850d558", | ||
489 | - "reference": "bad29cb8d18ab0315e6c477751418a82c850d558", | 488 | + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1e044bc4b34e91743943479f1be7a1d5eb93add0", |
489 | + "reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0", | ||
490 | "shasum": "" | 490 | "shasum": "" |
491 | }, | 491 | }, |
492 | "require": { | 492 | "require": { |
@@ -551,7 +551,7 @@ | @@ -551,7 +551,7 @@ | ||
551 | "logging", | 551 | "logging", |
552 | "psr-3" | 552 | "psr-3" |
553 | ], | 553 | ], |
554 | - "time": "2016-11-26 00:15:39" | 554 | + "time": "2017-03-13 07:08:03" |
555 | }, | 555 | }, |
556 | { | 556 | { |
557 | "name": "phpseclib/phpseclib", | 557 | "name": "phpseclib/phpseclib", |
@@ -2295,7 +2295,7 @@ | @@ -2295,7 +2295,7 @@ | ||
2295 | }, | 2295 | }, |
2296 | { | 2296 | { |
2297 | "name": "symfony/browser-kit", | 2297 | "name": "symfony/browser-kit", |
2298 | - "version": "v3.2.5", | 2298 | + "version": "v3.2.6", |
2299 | "source": { | 2299 | "source": { |
2300 | "type": "git", | 2300 | "type": "git", |
2301 | "url": "https://github.com/symfony/browser-kit.git", | 2301 | "url": "https://github.com/symfony/browser-kit.git", |
@@ -2352,7 +2352,7 @@ | @@ -2352,7 +2352,7 @@ | ||
2352 | }, | 2352 | }, |
2353 | { | 2353 | { |
2354 | "name": "symfony/console", | 2354 | "name": "symfony/console", |
2355 | - "version": "v3.2.5", | 2355 | + "version": "v3.2.6", |
2356 | "source": { | 2356 | "source": { |
2357 | "type": "git", | 2357 | "type": "git", |
2358 | "url": "https://github.com/symfony/console.git", | 2358 | "url": "https://github.com/symfony/console.git", |
@@ -2415,7 +2415,7 @@ | @@ -2415,7 +2415,7 @@ | ||
2415 | }, | 2415 | }, |
2416 | { | 2416 | { |
2417 | "name": "symfony/css-selector", | 2417 | "name": "symfony/css-selector", |
2418 | - "version": "v3.2.5", | 2418 | + "version": "v3.2.6", |
2419 | "source": { | 2419 | "source": { |
2420 | "type": "git", | 2420 | "type": "git", |
2421 | "url": "https://github.com/symfony/css-selector.git", | 2421 | "url": "https://github.com/symfony/css-selector.git", |
@@ -2468,7 +2468,7 @@ | @@ -2468,7 +2468,7 @@ | ||
2468 | }, | 2468 | }, |
2469 | { | 2469 | { |
2470 | "name": "symfony/debug", | 2470 | "name": "symfony/debug", |
2471 | - "version": "v3.2.5", | 2471 | + "version": "v3.2.6", |
2472 | "source": { | 2472 | "source": { |
2473 | "type": "git", | 2473 | "type": "git", |
2474 | "url": "https://github.com/symfony/debug.git", | 2474 | "url": "https://github.com/symfony/debug.git", |
@@ -2525,7 +2525,7 @@ | @@ -2525,7 +2525,7 @@ | ||
2525 | }, | 2525 | }, |
2526 | { | 2526 | { |
2527 | "name": "symfony/dom-crawler", | 2527 | "name": "symfony/dom-crawler", |
2528 | - "version": "v3.2.5", | 2528 | + "version": "v3.2.6", |
2529 | "source": { | 2529 | "source": { |
2530 | "type": "git", | 2530 | "type": "git", |
2531 | "url": "https://github.com/symfony/dom-crawler.git", | 2531 | "url": "https://github.com/symfony/dom-crawler.git", |
@@ -2581,7 +2581,7 @@ | @@ -2581,7 +2581,7 @@ | ||
2581 | }, | 2581 | }, |
2582 | { | 2582 | { |
2583 | "name": "symfony/event-dispatcher", | 2583 | "name": "symfony/event-dispatcher", |
2584 | - "version": "v3.2.5", | 2584 | + "version": "v3.2.6", |
2585 | "source": { | 2585 | "source": { |
2586 | "type": "git", | 2586 | "type": "git", |
2587 | "url": "https://github.com/symfony/event-dispatcher.git", | 2587 | "url": "https://github.com/symfony/event-dispatcher.git", |
@@ -2641,7 +2641,7 @@ | @@ -2641,7 +2641,7 @@ | ||
2641 | }, | 2641 | }, |
2642 | { | 2642 | { |
2643 | "name": "symfony/finder", | 2643 | "name": "symfony/finder", |
2644 | - "version": "v3.2.5", | 2644 | + "version": "v3.2.6", |
2645 | "source": { | 2645 | "source": { |
2646 | "type": "git", | 2646 | "type": "git", |
2647 | "url": "https://github.com/symfony/finder.git", | 2647 | "url": "https://github.com/symfony/finder.git", |
@@ -2749,7 +2749,7 @@ | @@ -2749,7 +2749,7 @@ | ||
2749 | }, | 2749 | }, |
2750 | { | 2750 | { |
2751 | "name": "symfony/process", | 2751 | "name": "symfony/process", |
2752 | - "version": "v3.2.5", | 2752 | + "version": "v3.2.6", |
2753 | "source": { | 2753 | "source": { |
2754 | "type": "git", | 2754 | "type": "git", |
2755 | "url": "https://github.com/symfony/process.git", | 2755 | "url": "https://github.com/symfony/process.git", |
@@ -2798,7 +2798,7 @@ | @@ -2798,7 +2798,7 @@ | ||
2798 | }, | 2798 | }, |
2799 | { | 2799 | { |
2800 | "name": "symfony/yaml", | 2800 | "name": "symfony/yaml", |
2801 | - "version": "v3.2.5", | 2801 | + "version": "v3.2.6", |
2802 | "source": { | 2802 | "source": { |
2803 | "type": "git", | 2803 | "type": "git", |
2804 | "url": "https://github.com/symfony/yaml.git", | 2804 | "url": "https://github.com/symfony/yaml.git", |