diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-01-29 20:32:11 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-01-29 20:32:11 +0100 |
commit | 27f15aa4ca4eb0eff11ddb3f3a2ce6fe945ba0e2 (patch) | |
tree | 95a48bdfad990d7d4039b3e9e9c1ceea856e278c | |
parent | f8bf8952541b51481a7463c6efc0b2bc9c1edff1 (diff) | |
download | wallabag-27f15aa4ca4eb0eff11ddb3f3a2ce6fe945ba0e2.tar.gz wallabag-27f15aa4ca4eb0eff11ddb3f3a2ce6fe945ba0e2.tar.zst wallabag-27f15aa4ca4eb0eff11ddb3f3a2ce6fe945ba0e2.zip |
improve API
-rw-r--r-- | app/config/config.yml | 2 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/WallabagRestController.php | 15 |
2 files changed, 14 insertions, 3 deletions
diff --git a/app/config/config.yml b/app/config/config.yml index f2f5f9f3..e5c87860 100644 --- a/app/config/config.yml +++ b/app/config/config.yml | |||
@@ -101,6 +101,6 @@ fos_rest: | |||
101 | failed_validation: HTTP_BAD_REQUEST | 101 | failed_validation: HTTP_BAD_REQUEST |
102 | default_engine: twig | 102 | default_engine: twig |
103 | routing_loader: | 103 | routing_loader: |
104 | default_format: json | 104 | include_format: false |
105 | 105 | ||
106 | nelmio_api_doc: ~ \ No newline at end of file | 106 | nelmio_api_doc: ~ \ No newline at end of file |
diff --git a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php index a2a9af38..eb41d011 100644 --- a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php | |||
@@ -5,6 +5,7 @@ namespace Wallabag\CoreBundle\Controller; | |||
5 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; | 5 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; |
6 | use FOS\RestBundle\Controller\Annotations\View; | 6 | use FOS\RestBundle\Controller\Annotations\View; |
7 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 7 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
8 | use Symfony\Component\HttpFoundation\Request; | ||
8 | use Symfony\Component\Security\Core\Exception\AccessDeniedException; | 9 | use Symfony\Component\Security\Core\Exception\AccessDeniedException; |
9 | use Wallabag\CoreBundle\Entity\Entries; | 10 | use Wallabag\CoreBundle\Entity\Entries; |
10 | use Wallabag\CoreBundle\Entity\Tags; | 11 | use Wallabag\CoreBundle\Entity\Tags; |
@@ -20,9 +21,19 @@ class WallabagRestController | |||
20 | * ) | 21 | * ) |
21 | * @return Entries | 22 | * @return Entries |
22 | */ | 23 | */ |
23 | public function getEntriesAction() | 24 | public function getEntriesAction(Request $request) |
24 | { | 25 | { |
25 | 26 | $isArchive = $request->query->get('archive'); | |
27 | var_dump($isArchive); | ||
28 | $isStarred = $request->query->get('star'); | ||
29 | $isDeleted = $request->query->get('delete'); | ||
30 | $sort = $request->query->get('sort'); | ||
31 | $order = $request->query->get('order'); | ||
32 | $page = $request->query->get('page'); | ||
33 | $perPage = $request->query->get('perPage'); | ||
34 | $tags = $request->query->get('tags', array()); | ||
35 | |||
36 | return 'plop'; | ||
26 | } | 37 | } |
27 | 38 | ||
28 | /** | 39 | /** |