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 | 34 | ApiEndpoint::factory('/project', HttpMethods::GET, 'projectAction') |
| 35 | 35 | ->name('project') |
| 36 | 36 | ->description('Данные о проекте') |
| 37 | - ->exampleRequest([ | |
| 37 | + ->paramsDescription([ | |
| 38 | 38 | 'required params' => [ |
| 39 | 39 | 'project' => "integer(ID проекта)" |
| 40 | 40 | ] |
| ... | ... | @@ -56,7 +56,7 @@ class AllPositionResource extends ApiResource |
| 56 | 56 | ApiEndpoint::factory('/projects', HttpMethods::GET, 'projectsAction') |
| 57 | 57 | ->name('projects') |
| 58 | 58 | ->description('Список проектов пользователя') |
| 59 | - ->exampleRequest([ | |
| 59 | + ->paramsDescription([ | |
| 60 | 60 | 'required params' => [], |
| 61 | 61 | 'optional params' => [ |
| 62 | 62 | 'id_group' => "integer(ID проекта)" |
| ... | ... | @@ -91,7 +91,7 @@ class AllPositionResource extends ApiResource |
| 91 | 91 | ApiEndpoint::factory('/projects_group', HttpMethods::GET, 'projectsGroupAction') |
| 92 | 92 | ->name('projects group') |
| 93 | 93 | ->description('Список групп проектов') |
| 94 | - ->exampleRequest([ | |
| 94 | + ->paramsDescription([ | |
| 95 | 95 | 'required params' => [] |
| 96 | 96 | ]) |
| 97 | 97 | ->exampleResponse([ |
| ... | ... | @@ -111,7 +111,7 @@ class AllPositionResource extends ApiResource |
| 111 | 111 | ApiEndpoint::factory('/queries', HttpMethods::GET, 'queriesAction') |
| 112 | 112 | ->name('queries') |
| 113 | 113 | ->description('Список запросов, по которым определяется позиция сайта') |
| 114 | - ->exampleRequest([ | |
| 114 | + ->paramsDescription([ | |
| 115 | 115 | 'required params' => [ |
| 116 | 116 | 'project' => 'integer(ID проекта)' |
| 117 | 117 | ], |
| ... | ... | @@ -142,7 +142,7 @@ class AllPositionResource extends ApiResource |
| 142 | 142 | ApiEndpoint::factory('/queries_group', HttpMethods::GET, 'queriesGroupAction') |
| 143 | 143 | ->name('queries group') |
| 144 | 144 | ->description('Список групп запросов') |
| 145 | - ->exampleRequest([ | |
| 145 | + ->paramsDescription([ | |
| 146 | 146 | 'required params' => ['project' => 'integer(ID проекта)'] |
| 147 | 147 | ]) |
| 148 | 148 | ->exampleResponse([ |
| ... | ... | @@ -162,7 +162,7 @@ class AllPositionResource extends ApiResource |
| 162 | 162 | ApiEndpoint::factory('/report', HttpMethods::GET, 'reportAction') |
| 163 | 163 | ->name('report') |
| 164 | 164 | ->description('Отчет по позициям сайта') |
| 165 | - ->exampleRequest([ | |
| 165 | + ->paramsDescription([ | |
| 166 | 166 | 'required params' => [ |
| 167 | 167 | 'project' => 'integer(ID проекта)' |
| 168 | 168 | ], |
| ... | ... | @@ -224,7 +224,7 @@ class AllPositionResource extends ApiResource |
| 224 | 224 | ApiEndpoint::factory('/visibility', HttpMethods::GET, 'visibilityAction') |
| 225 | 225 | ->name('visibility') |
| 226 | 226 | ->description('Данные о видимости сайта за указанный период') |
| 227 | - ->exampleRequest([ | |
| 227 | + ->paramsDescription([ | |
| 228 | 228 | 'required params' => [ |
| 229 | 229 | 'project' => 'integer(ID проекта)' |
| 230 | 230 | ], | ... | ... |
app/library/App/Resources/GaResource.php
| ... | ... | @@ -40,16 +40,18 @@ class GaResource extends ApiResource { |
| 40 | 40 | "Referral" => "128", |
| 41 | 41 | "Social" => "29" |
| 42 | 42 | ]) |
| 43 | - ->exampleRequest([ | |
| 43 | + ->paramsDescription([ | |
| 44 | 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 | 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 | 23 | <div class="container"> |
| 24 | 24 | |
| 25 | 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 | 30 | <div ng-repeat="collection in vm.documentation.collections"> |
| 31 | 31 | |
| ... | ... | @@ -35,15 +35,15 @@ |
| 35 | 35 | </div> |
| 36 | 36 | <table class="table table-bordered"> |
| 37 | 37 | <tr ng-show="collection.description"> |
| 38 | - <th>Description</th> | |
| 38 | + <th>Описание</th> | |
| 39 | 39 | <td>{{ collection.description }}</td> |
| 40 | 40 | </tr> |
| 41 | 41 | <tr> |
| 42 | - <th>Base path</th> | |
| 42 | + <th>Префикс</th> | |
| 43 | 43 | <td>{{ collection.prefix }}</td> |
| 44 | 44 | </tr> |
| 45 | 45 | <tr ng-show="collection.fields"> |
| 46 | - <th>Fields</th> | |
| 46 | + <th>Поля</th> | |
| 47 | 47 | <td> |
| 48 | 48 | <table class="table table-bordered"> |
| 49 | 49 | <tr ng-repeat="(field, dataType) in collection.fields"> |
| ... | ... | @@ -65,27 +65,31 @@ |
| 65 | 65 | </div> |
| 66 | 66 | <table class="table table-bordered"> |
| 67 | 67 | <tr ng-show="endpoint.description"> |
| 68 | - <th>Description</th> | |
| 68 | + <th>Описание</th> | |
| 69 | 69 | <th>{{ endpoint.description }}</th> |
| 70 | 70 | </tr> |
| 71 | 71 | <tr> |
| 72 | - <th>Full URL</th> | |
| 72 | + <th>URL</th> | |
| 73 | 73 | <td> |
| 74 | 74 | <a ng-href="{{ vm.documentation.basePath + collection.prefix + endpoint.path }}" target="_blank"> |
| 75 | 75 | {{ vm.documentation.basePath + collection.prefix + endpoint.path }} |
| 76 | 76 | </a> |
| 77 | 77 | </td> |
| 78 | 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 | 83 | <tr ng-show="endpoint.exampleRequest"> |
| 80 | - <th>Example request</th> | |
| 84 | + <th>Пример запроса</th> | |
| 81 | 85 | <th><pre style="font-weight: normal;">{{ endpoint.exampleRequest | json }}</pre></th> |
| 82 | 86 | </tr> |
| 83 | 87 | <tr ng-show="endpoint.exampleResponse"> |
| 84 | - <th>Example response</th> | |
| 88 | + <th>Пример ответа</th> | |
| 85 | 89 | <th><pre style="font-weight: normal;">{{ endpoint.exampleResponse | json }}</pre></th> |
| 86 | 90 | </tr> |
| 87 | 91 | <tr> |
| 88 | - <th>Allowed roles</th> | |
| 92 | + <th>Доступ</th> | |
| 89 | 93 | <td> |
| 90 | 94 | <div class="label label-primary" ng-repeat="role in endpoint.allowedRoles" style="margin-right: 5px">{{ role }}</div> |
| 91 | 95 | </td> |
| ... | ... | @@ -97,7 +101,7 @@ |
| 97 | 101 | |
| 98 | 102 | </div> |
| 99 | 103 | |
| 100 | - <h2>Other routes</h2> | |
| 104 | + <h2>Другие запросы</h2> | |
| 101 | 105 | |
| 102 | 106 | <div class="panel panel-default" ng-repeat="route in vm.documentation.routes"> |
| 103 | 107 | <div class="panel-heading"> | ... | ... |
composer.lock
| ... | ... | @@ -438,12 +438,12 @@ |
| 438 | 438 | "source": { |
| 439 | 439 | "type": "git", |
| 440 | 440 | "url": "https://github.com/libertysumy/phalcon-rest.git", |
| 441 | - "reference": "8d51579789208e08627ddaf4e5228670f4850e70" | |
| 441 | + "reference": "d5b1ec5a1f1c5fb88220cd2e7cecaa84fcec9637" | |
| 442 | 442 | }, |
| 443 | 443 | "dist": { |
| 444 | 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 | 447 | "shasum": "" |
| 448 | 448 | }, |
| 449 | 449 | "require": { |
| ... | ... | @@ -473,20 +473,20 @@ |
| 473 | 473 | } |
| 474 | 474 | ], |
| 475 | 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 | 479 | "name": "monolog/monolog", |
| 480 | - "version": "1.22.0", | |
| 480 | + "version": "1.22.1", | |
| 481 | 481 | "source": { |
| 482 | 482 | "type": "git", |
| 483 | 483 | "url": "https://github.com/Seldaek/monolog.git", |
| 484 | - "reference": "bad29cb8d18ab0315e6c477751418a82c850d558" | |
| 484 | + "reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0" | |
| 485 | 485 | }, |
| 486 | 486 | "dist": { |
| 487 | 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 | 490 | "shasum": "" |
| 491 | 491 | }, |
| 492 | 492 | "require": { |
| ... | ... | @@ -551,7 +551,7 @@ |
| 551 | 551 | "logging", |
| 552 | 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 | 557 | "name": "phpseclib/phpseclib", |
| ... | ... | @@ -2295,7 +2295,7 @@ |
| 2295 | 2295 | }, |
| 2296 | 2296 | { |
| 2297 | 2297 | "name": "symfony/browser-kit", |
| 2298 | - "version": "v3.2.5", | |
| 2298 | + "version": "v3.2.6", | |
| 2299 | 2299 | "source": { |
| 2300 | 2300 | "type": "git", |
| 2301 | 2301 | "url": "https://github.com/symfony/browser-kit.git", |
| ... | ... | @@ -2352,7 +2352,7 @@ |
| 2352 | 2352 | }, |
| 2353 | 2353 | { |
| 2354 | 2354 | "name": "symfony/console", |
| 2355 | - "version": "v3.2.5", | |
| 2355 | + "version": "v3.2.6", | |
| 2356 | 2356 | "source": { |
| 2357 | 2357 | "type": "git", |
| 2358 | 2358 | "url": "https://github.com/symfony/console.git", |
| ... | ... | @@ -2415,7 +2415,7 @@ |
| 2415 | 2415 | }, |
| 2416 | 2416 | { |
| 2417 | 2417 | "name": "symfony/css-selector", |
| 2418 | - "version": "v3.2.5", | |
| 2418 | + "version": "v3.2.6", | |
| 2419 | 2419 | "source": { |
| 2420 | 2420 | "type": "git", |
| 2421 | 2421 | "url": "https://github.com/symfony/css-selector.git", |
| ... | ... | @@ -2468,7 +2468,7 @@ |
| 2468 | 2468 | }, |
| 2469 | 2469 | { |
| 2470 | 2470 | "name": "symfony/debug", |
| 2471 | - "version": "v3.2.5", | |
| 2471 | + "version": "v3.2.6", | |
| 2472 | 2472 | "source": { |
| 2473 | 2473 | "type": "git", |
| 2474 | 2474 | "url": "https://github.com/symfony/debug.git", |
| ... | ... | @@ -2525,7 +2525,7 @@ |
| 2525 | 2525 | }, |
| 2526 | 2526 | { |
| 2527 | 2527 | "name": "symfony/dom-crawler", |
| 2528 | - "version": "v3.2.5", | |
| 2528 | + "version": "v3.2.6", | |
| 2529 | 2529 | "source": { |
| 2530 | 2530 | "type": "git", |
| 2531 | 2531 | "url": "https://github.com/symfony/dom-crawler.git", |
| ... | ... | @@ -2581,7 +2581,7 @@ |
| 2581 | 2581 | }, |
| 2582 | 2582 | { |
| 2583 | 2583 | "name": "symfony/event-dispatcher", |
| 2584 | - "version": "v3.2.5", | |
| 2584 | + "version": "v3.2.6", | |
| 2585 | 2585 | "source": { |
| 2586 | 2586 | "type": "git", |
| 2587 | 2587 | "url": "https://github.com/symfony/event-dispatcher.git", |
| ... | ... | @@ -2641,7 +2641,7 @@ |
| 2641 | 2641 | }, |
| 2642 | 2642 | { |
| 2643 | 2643 | "name": "symfony/finder", |
| 2644 | - "version": "v3.2.5", | |
| 2644 | + "version": "v3.2.6", | |
| 2645 | 2645 | "source": { |
| 2646 | 2646 | "type": "git", |
| 2647 | 2647 | "url": "https://github.com/symfony/finder.git", |
| ... | ... | @@ -2749,7 +2749,7 @@ |
| 2749 | 2749 | }, |
| 2750 | 2750 | { |
| 2751 | 2751 | "name": "symfony/process", |
| 2752 | - "version": "v3.2.5", | |
| 2752 | + "version": "v3.2.6", | |
| 2753 | 2753 | "source": { |
| 2754 | 2754 | "type": "git", |
| 2755 | 2755 | "url": "https://github.com/symfony/process.git", |
| ... | ... | @@ -2798,7 +2798,7 @@ |
| 2798 | 2798 | }, |
| 2799 | 2799 | { |
| 2800 | 2800 | "name": "symfony/yaml", |
| 2801 | - "version": "v3.2.5", | |
| 2801 | + "version": "v3.2.6", | |
| 2802 | 2802 | "source": { |
| 2803 | 2803 | "type": "git", |
| 2804 | 2804 | "url": "https://github.com/symfony/yaml.git", | ... | ... |