. * */ namespace OCA\Tasks\Controller; use \OCA\Tasks\Service\SettingsService; use \OCP\AppFramework\Controller; use \OCP\IRequest; class SettingsController extends Controller { private $settingsService; use Response; public function __construct($appName, IRequest $request, SettingsService $settingsService){ parent::__construct($appName, $request); $this->settingsService = $settingsService; } /** * @NoAdminRequired */ public function get(){ return $this->generateResponse(function () { return ['settings' => $this->settingsService->get()]; }); } /** * @NoAdminRequired */ public function set($setting, $type, $value){ return $this->generateResponse(function () use ($setting, $type, $value) { return $this->settingsService->set($setting, $type, $value); }); } }