mirror of
https://github.com/nextcloud/ocsms.git
synced 2026-08-21 13:23:04 +00:00
Create a basic SmsController
This commit is contained in:
@@ -14,7 +14,7 @@ namespace OCA\OcSms\AppInfo;
|
||||
|
||||
use \OCP\AppFramework\App;
|
||||
|
||||
use \OCA\OcSms\Controller\PageController;
|
||||
use \OCA\OcSms\Controller\SmsController;
|
||||
|
||||
|
||||
class Application extends App {
|
||||
@@ -28,9 +28,10 @@ class Application extends App {
|
||||
/**
|
||||
* Controllers
|
||||
*/
|
||||
$container->registerService('PageController', function($c) {
|
||||
return new PageController(
|
||||
$c->query('AppName'),
|
||||
|
||||
$container->registerService('SmsController', function($c) {
|
||||
return new SmsController(
|
||||
$c->query('AppName'),
|
||||
$c->query('Request'),
|
||||
$c->query('UserId')
|
||||
);
|
||||
@@ -42,9 +43,7 @@ class Application extends App {
|
||||
*/
|
||||
$container->registerService('UserId', function($c) {
|
||||
return \OCP\User::getUser();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -22,6 +22,5 @@ namespace OCA\OcSms\AppInfo;
|
||||
$application = new Application();
|
||||
|
||||
$application->registerRoutes($this, array('routes' => array(
|
||||
array('name' => 'page#index', 'url' => '/', 'verb' => 'GET'),
|
||||
array('name' => 'page#do_echo', 'url' => '/echo', 'verb' => 'POST'),
|
||||
array('name' => 'sms#push', 'url' => '/push', 'verb' => 'POST'),
|
||||
)));
|
||||
|
||||
Reference in New Issue
Block a user