1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-10-15 19:42:08 +00:00

routing for API, trying to respect #414

This commit is contained in:
Nicolas Lœuillet 2015-01-29 16:56:58 +01:00
parent 589dce52c6
commit f8bf895254
17 changed files with 174 additions and 469 deletions

View file

@ -1,63 +0,0 @@
<?php
namespace Wallabag\ApiBundle\Controller;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Wallabag\CoreBundle\Entity\Entries;
use FOS\RestBundle\Controller\Annotations\Get;
use FOS\RestBundle\Controller\Annotations\Delete;
use FOS\RestBundle\Controller\Annotations\Patch;
use Wallabag\CoreBundle\Entity\Users;
class EntryController extends Controller
{
/**
* Fetches an entry for a given user
*
* @Get("/u/{user}/entry/{entry}")
* @ApiDoc(
* requirements={
* {"name"="user", "dataType"="string", "requirement"="\w+", "description"="The user ID"},
* {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"}
* }
* )
* @return Entries
*/
public function getAction(Users $user, Entries $entry)
{
return $entry;
}
/**
* Deletes an entry for a given user
*
* @Delete("/u/{user}/entry/{entry}")
* @ApiDoc(
* requirements={
* {"name"="user", "dataType"="string", "requirement"="\w+", "description"="The user ID"},
* {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"}
* }
* )
*/
public function deleteAction(Users $user, Entries $entry)
{
}
/**
* Changes several properties of an entry. I.E tags, archived, starred and deleted status
*
* @Patch("/u/{user}/entry/{entry}")
* @ApiDoc(
* requirements={
* {"name"="user", "dataType"="string", "requirement"="\w+", "description"="The user ID"},
* {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"}
* }
* )
*/
public function patchAction(Users $user, Entries $entry)
{
}
}

View file

@ -1,9 +0,0 @@
<?php
namespace Wallabag\ApiBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class WallabagApiBundle extends Bundle
{
}