diff options
author | Sean Molenaar <sean@seanmolenaar.eu> | 2020-08-29 23:39:35 +0200 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2020-09-27 15:35:31 +0200 |
commit | d00d1ab2a28f428223e52b17052c072c64784016 (patch) | |
tree | c019f85fb7ac67147dd43ca64b4ac3cda99832f7 /lib/Controller/UtilityApiController.php | |
parent | 5687baca75d47dbdffd3de74e865ad2f71ef0cb7 (diff) |
Create V2 mapper, Service and management commands
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Diffstat (limited to 'lib/Controller/UtilityApiController.php')
-rw-r--r-- | lib/Controller/UtilityApiController.php | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/Controller/UtilityApiController.php b/lib/Controller/UtilityApiController.php index ee9ca0900..23956f149 100644 --- a/lib/Controller/UtilityApiController.php +++ b/lib/Controller/UtilityApiController.php @@ -15,18 +15,17 @@ namespace OCA\News\Controller; +use OCA\News\Service\UpdaterService; use \OCP\IRequest; use \OCP\IConfig; use \OCP\IUserSession; -use \OCP\AppFramework\Http; -use \OCA\News\Utility\Updater; use \OCA\News\Service\StatusService; class UtilityApiController extends ApiController { - private $updater; + private $updaterService; private $settings; private $statusService; @@ -34,12 +33,12 @@ class UtilityApiController extends ApiController $appName, IRequest $request, IUserSession $userSession, - Updater $updater, + UpdaterService $updater, IConfig $settings, StatusService $statusService ) { parent::__construct($appName, $request, $userSession); - $this->updater = $updater; + $this->updaterService = $updater; $this->settings = $settings; $this->statusService = $statusService; } @@ -50,7 +49,7 @@ class UtilityApiController extends ApiController * @NoCSRFRequired * @CORS */ - public function version() + public function version(): array { $version = $this->settings->getAppValue( $this->appName, @@ -64,9 +63,9 @@ class UtilityApiController extends ApiController * @NoCSRFRequired * @CORS */ - public function beforeUpdate() + public function beforeUpdate(): void { - $this->updater->beforeUpdate(); + $this->updaterService->beforeUpdate(); } @@ -74,9 +73,9 @@ class UtilityApiController extends ApiController * @NoCSRFRequired * @CORS */ - public function afterUpdate() + public function afterUpdate(): void { - $this->updater->afterUpdate(); + $this->updaterService->afterUpdate(); } @@ -85,7 +84,7 @@ class UtilityApiController extends ApiController * @NoCSRFRequired * @NoAdminRequired */ - public function status() + public function status(): array { return $this->statusService->getStatus(); } |