2022-10-29 18:05:05 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @copyright Copyright (c) 2022 Varun Patil <radialapps@gmail.com>
|
|
|
|
* @author Varun Patil <radialapps@gmail.com>
|
|
|
|
* @license AGPL-3.0-or-later
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace OCA\Memories\Controller;
|
|
|
|
|
|
|
|
use OCA\Memories\AppInfo\Application;
|
2023-03-24 04:57:54 +00:00
|
|
|
use OCA\Memories\Db\FsManager;
|
2022-10-29 18:05:05 +00:00
|
|
|
use OCA\Memories\Db\TimelineQuery;
|
|
|
|
use OCP\App\IAppManager;
|
2023-05-16 07:25:59 +00:00
|
|
|
use OCP\AppFramework\ApiController;
|
2022-10-29 18:05:05 +00:00
|
|
|
use OCP\Files\IRootFolder;
|
|
|
|
use OCP\IConfig;
|
|
|
|
use OCP\IDBConnection;
|
|
|
|
use OCP\IRequest;
|
|
|
|
use OCP\IUserSession;
|
2023-02-24 08:21:38 +00:00
|
|
|
use Psr\Log\LoggerInterface;
|
2022-10-29 18:05:05 +00:00
|
|
|
|
2023-05-16 07:25:59 +00:00
|
|
|
abstract class GenericApiController extends ApiController
|
2022-10-29 18:05:05 +00:00
|
|
|
{
|
|
|
|
protected IConfig $config;
|
|
|
|
protected IUserSession $userSession;
|
|
|
|
protected IRootFolder $rootFolder;
|
|
|
|
protected IAppManager $appManager;
|
2023-01-18 03:02:00 +00:00
|
|
|
protected IDBConnection $connection;
|
2023-02-24 08:21:38 +00:00
|
|
|
protected LoggerInterface $logger;
|
2023-03-23 21:45:56 +00:00
|
|
|
protected TimelineQuery $timelineQuery;
|
|
|
|
protected FsManager $fs;
|
2022-10-29 18:05:05 +00:00
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
IRequest $request,
|
|
|
|
IConfig $config,
|
|
|
|
IUserSession $userSession,
|
|
|
|
IDBConnection $connection,
|
|
|
|
IRootFolder $rootFolder,
|
2023-02-24 08:21:38 +00:00
|
|
|
IAppManager $appManager,
|
2023-03-23 18:16:28 +00:00
|
|
|
LoggerInterface $logger,
|
2023-03-23 21:45:56 +00:00
|
|
|
TimelineQuery $timelineQuery,
|
|
|
|
FsManager $fs
|
2022-10-29 18:05:05 +00:00
|
|
|
) {
|
|
|
|
parent::__construct(Application::APPNAME, $request);
|
|
|
|
|
|
|
|
$this->config = $config;
|
|
|
|
$this->userSession = $userSession;
|
|
|
|
$this->connection = $connection;
|
|
|
|
$this->rootFolder = $rootFolder;
|
|
|
|
$this->appManager = $appManager;
|
2023-02-24 08:21:38 +00:00
|
|
|
$this->logger = $logger;
|
2023-03-23 18:16:28 +00:00
|
|
|
$this->timelineQuery = $timelineQuery;
|
2023-03-23 21:45:56 +00:00
|
|
|
$this->fs = $fs;
|
2022-10-29 18:05:05 +00:00
|
|
|
}
|
|
|
|
}
|