From 788fbdd5bd74aba50adcfe129f1d8808474c8491 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 22 Feb 2017 20:50:30 +0200 Subject: [PATCH] ga output --- app/library/App/Bootstrap/CollectionBootstrap.php | 6 ++---- app/library/App/Controllers/AllPositionController.php | 30 ++++++++++++++++++++++++++++++ app/library/App/Controllers/GaController.php | 1 - app/library/App/Resources/AllPositionResource.php | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 app/library/App/Controllers/AllPositionController.php create mode 100644 app/library/App/Resources/AllPositionResource.php diff --git a/app/library/App/Bootstrap/CollectionBootstrap.php b/app/library/App/Bootstrap/CollectionBootstrap.php index c376046..91a68f9 100755 --- a/app/library/App/Bootstrap/CollectionBootstrap.php +++ b/app/library/App/Bootstrap/CollectionBootstrap.php @@ -4,11 +4,10 @@ namespace App\Bootstrap; use App\BootstrapInterface; use App\Collections\ExportCollection; +use App\Resources\AllPositionResource; use App\Resources\GaResource; use App\Resources\ProjectResource; use App\Resources\UserResource; -use App\Resources\AlbumResource; -use App\Resources\PhotoResource; use Phalcon\Config; use Phalcon\DiInterface; use PhalconRest\Api; @@ -19,9 +18,8 @@ class CollectionBootstrap implements BootstrapInterface { $api ->resource(new GaResource('/ga')) + ->resource(new AllPositionResource('/ap')) ->resource(new UserResource('/users')) - //->resource(new AlbumResource('/albums')) - //->resource(new PhotoResource('/photos')) ->resource(new ProjectResource('/projects')) ->collection(new ExportCollection('/export')); } diff --git a/app/library/App/Controllers/AllPositionController.php b/app/library/App/Controllers/AllPositionController.php new file mode 100644 index 0000000..d351bdf --- /dev/null +++ b/app/library/App/Controllers/AllPositionController.php @@ -0,0 +1,30 @@ +get_project(418068); + + return $project_info; + + } + +} \ No newline at end of file diff --git a/app/library/App/Controllers/GaController.php b/app/library/App/Controllers/GaController.php index dcf9798..ee72a0f 100644 --- a/app/library/App/Controllers/GaController.php +++ b/app/library/App/Controllers/GaController.php @@ -10,7 +10,6 @@ namespace App\Controllers; use App\Model\Project; -use App\Model\User; use Google_Client; use Google_Service_AnalyticsReporting; use Google_Service_AnalyticsReporting_DateRange; diff --git a/app/library/App/Resources/AllPositionResource.php b/app/library/App/Resources/AllPositionResource.php new file mode 100644 index 0000000..dc6e1fc --- /dev/null +++ b/app/library/App/Resources/AllPositionResource.php @@ -0,0 +1,36 @@ +name('Google Analytics') + ->expectsJsonData() + //->transformer(ModelTransformer::class) + ->itemKey('ap') + ->collectionKey('ap') + ->deny(AclRoles::UNAUTHORIZED) + ->handler(GaController::class) + + ->endpoint(ApiEndpoint::get('', 'testAction') + ->allow(AclRoles::USER) + ->description('Returns data from AllPosition Api.') + ) + ; + + } + +} \ No newline at end of file -- libgit2 0.21.4