diff options
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller/EntryController.php')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/EntryController.php | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryController.php b/src/Wallabag/ApiBundle/Controller/EntryController.php index 07ca8ccf..9bf84501 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryController.php | |||
@@ -6,17 +6,19 @@ use Nelmio\ApiDocBundle\Annotation\ApiDoc; | |||
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
7 | use Wallabag\CoreBundle\Entity\Entries; | 7 | use Wallabag\CoreBundle\Entity\Entries; |
8 | use FOS\RestBundle\Controller\Annotations\Get; | 8 | use FOS\RestBundle\Controller\Annotations\Get; |
9 | use FOS\RestBundle\Controller\Annotations\Delete; | ||
10 | use FOS\RestBundle\Controller\Annotations\Patch; | ||
9 | use Wallabag\CoreBundle\Entity\Users; | 11 | use Wallabag\CoreBundle\Entity\Users; |
10 | 12 | ||
11 | class EntryController extends Controller | 13 | class EntryController extends Controller |
12 | { | 14 | { |
13 | /** | 15 | /** |
14 | * Fetch an entry for a given user | 16 | * Fetches an entry for a given user |
15 | * | 17 | * |
16 | * @Get("/u/{user}/entry/{entry}") | 18 | * @Get("/u/{user}/entry/{entry}") |
17 | * @ApiDoc( | 19 | * @ApiDoc( |
18 | * requirements={ | 20 | * requirements={ |
19 | * {"name"="user", "dataType"="string", "requirement"="\w+", "description"="The username"}, | 21 | * {"name"="user", "dataType"="string", "requirement"="\w+", "description"="The user ID"}, |
20 | * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} | 22 | * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} |
21 | * } | 23 | * } |
22 | * ) | 24 | * ) |
@@ -26,4 +28,36 @@ class EntryController extends Controller | |||
26 | { | 28 | { |
27 | return $entry; | 29 | return $entry; |
28 | } | 30 | } |
31 | |||
32 | /** | ||
33 | * Deletes an entry for a given user | ||
34 | * | ||
35 | * @Delete("/u/{user}/entry/{entry}") | ||
36 | * @ApiDoc( | ||
37 | * requirements={ | ||
38 | * {"name"="user", "dataType"="string", "requirement"="\w+", "description"="The user ID"}, | ||
39 | * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} | ||
40 | * } | ||
41 | * ) | ||
42 | */ | ||
43 | public function deleteAction(Users $user, Entries $entry) | ||
44 | { | ||
45 | |||
46 | } | ||
47 | |||
48 | /** | ||
49 | * Changes several properties of an entry. I.E tags, archived, starred and deleted status | ||
50 | * | ||
51 | * @Patch("/u/{user}/entry/{entry}") | ||
52 | * @ApiDoc( | ||
53 | * requirements={ | ||
54 | * {"name"="user", "dataType"="string", "requirement"="\w+", "description"="The user ID"}, | ||
55 | * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} | ||
56 | * } | ||
57 | * ) | ||
58 | */ | ||
59 | public function patchAction(Users $user, Entries $entry) | ||
60 | { | ||
61 | |||
62 | } | ||
29 | } | 63 | } |