Skip to content

Commit

Permalink
Adding initial search endpoint (routes through AwsSearch plugin). #173
Browse files Browse the repository at this point in the history
  • Loading branch information
jmathai committed Jan 31, 2014
1 parent 0db299d commit 394f5b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/libraries/controllers/ApiPhotoController.php
Expand Up @@ -390,6 +390,16 @@ public function replace($id)
return $this->success(sprintf('Photo %s was successfully replaced.', $id), $photoResp['result']);
}

/**
* Search photos
*
* @return string standard json envelope
*/
public function search()
{
return $this->api->invoke("/plugin/AwsSearch/search.json", EpiRoute::httpGet);
}

/**
* Transform a photo.
* Modifies a photo by rotating/BW/etc.
Expand Down
1 change: 1 addition & 0 deletions src/libraries/routes-api.php
Expand Up @@ -93,6 +93,7 @@
$apiObj->get('/?v?[1-2]?/photo/([a-zA-Z0-9]+)/url/(\d+)x(\d+)x?([A-Zx]*)?.json', array('ApiPhotoController', 'dynamicUrl'), EpiApi::external); // generate a dynamic photo url (/photo/{id}/url/{options}.json) TODO, make internal for now
$apiObj->get('/?v?[1-2]?/photo/([a-zA-Z0-9]+)/nextprevious/?(.+)?.json', array('ApiPhotoController', 'nextPrevious'), EpiApi::external); // get a photo's next/previous (/photo/{id}/nextprevious[/{options}].json)
//$apiObj->post('/photo/([a-zA-Z0-9]+)/create/([a-z0-9]+)/([0-9]+)x([0-9]+)x?(.*).json', array('ApiPhotoController', 'dynamic'), EpiApi::external);
$apiObj->get('/?v?[1-2]?/photos/search.json', array('ApiPhotoController', 'search'), EpiApi::external); // get a photo's next/previous (/photo/{id}/nextprevious[/{options}].json)
$apiObj->post('/?v?[1-2]?/photo/([a-zA-Z0-9]+)/transform.json', array('ApiPhotoController', 'transform'), EpiApi::external); // transform a photo

/**
Expand Down

0 comments on commit 394f5b5

Please sign in to comment.