Refactor SoundCloud/Third party controllers to fit new service architecture

This commit is contained in:
Duncan Sommerville 2015-09-22 14:18:48 -04:00
parent 5bd8a508b1
commit 79db208cd4
2 changed files with 40 additions and 41 deletions

View file

@ -23,6 +23,45 @@ class SoundcloudController extends ThirdPartyController implements OAuth2Control
$this->_service = new Application_Service_SoundcloudService();
}
/**
* Upload the file with the given id to a third-party service
*
* @return void
*
* @throws Zend_Controller_Response_Exception thrown if upload fails for any reason
*/
public function uploadAction() {
$request = $this->getRequest();
$id = $request->getParam('id');
$this->_service->upload($id);
}
/**
* Download the file with the given id from a third-party service
*
* @return void
*
* @throws Zend_Controller_Response_Exception thrown if download fails for any reason
*/
public function downloadAction() {
$request = $this->getRequest();
$id = $request->getParam('id');
$this->_service->download($id);
}
/**
* Delete the file with the given id from a third-party service
*
* @return void
*
* @throws Zend_Controller_Response_Exception thrown if deletion fails for any reason
*/
public function deleteAction() {
$request = $this->getRequest();
$id = $request->getParam('id');
$this->_service->delete($id);
}
/**
* Send user to SoundCloud to authorize before being redirected
*