From a32caa490474c6b87fd809b3c0e5e409253d09a7 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 19 Jul 2016 14:13:27 +0200 Subject: Convert Share API to use the AppFramework --- apps/files_sharing/appinfo/routes.php | 57 ++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 27 deletions(-) (limited to 'apps/files_sharing/appinfo') diff --git a/apps/files_sharing/appinfo/routes.php b/apps/files_sharing/appinfo/routes.php index 92c2759ed14..ee7ea55d506 100644 --- a/apps/files_sharing/appinfo/routes.php +++ b/apps/files_sharing/appinfo/routes.php @@ -40,6 +40,36 @@ $application->registerRoutes($this, [ 'verb' => 'GET' ], ], + 'ocs' => [ + /* + * OCS Share API + */ + [ + 'name' => 'ShareAPI#getShares', + 'url' => '/api/v1/shares', + 'verb' => 'GET', + ], + [ + 'name' => 'ShareAPI#createShare', + 'url' => '/api/v1/shares', + 'verb' => 'POST', + ], + [ + 'name' => 'ShareAPI#getShare', + 'url' => '/api/v1/shares/{id}', + 'verb' => 'GET', + ], + [ + 'name' => 'ShareAPI#updateShare', + 'url' => '/api/v1/shares/{id}', + 'verb' => 'PUT', + ], + [ + 'name' => 'ShareAPI#deleteShare', + 'url' => '/api/v1/shares/{id}', + 'verb' => 'DELETE', + ], + ], ]); /** @var $this \OCP\Route\IRouter */ @@ -59,33 +89,6 @@ $this->create('sharing_external_shareinfo', '/shareinfo') //TODO: SET: mail notification, waiting for PR #4689 to be accepted -$OCSShare = new \OCA\Files_Sharing\API\OCSShareWrapper(); - -API::register('get', - '/apps/files_sharing/api/v1/shares', - [$OCSShare, 'getAllShares'], - 'files_sharing'); - -API::register('post', - '/apps/files_sharing/api/v1/shares', - [$OCSShare, 'createShare'], - 'files_sharing'); - -API::register('get', - '/apps/files_sharing/api/v1/shares/{id}', - [$OCSShare, 'getShare'], - 'files_sharing'); - -API::register('put', - '/apps/files_sharing/api/v1/shares/{id}', - [$OCSShare, 'updateShare'], - 'files_sharing'); - -API::register('delete', - '/apps/files_sharing/api/v1/shares/{id}', - [$OCSShare, 'deleteShare'], - 'files_sharing'); - API::register('get', '/apps/files_sharing/api/v1/remote_shares', array('\OCA\Files_Sharing\API\Remote', 'getShares'), -- cgit v1.2.3