RePod-Nextcloud-App/lib/Controller/ToplistController.php
2024-01-10 20:58:00 +01:00

30 lines
620 B
PHP

<?php
declare(strict_types=1);
namespace OCA\RePod\Controller;
use OCA\RePod\AppInfo\Application;
use OCA\RePod\Service\FyydService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
class ToplistController extends Controller
{
public function __construct(
IRequest $request,
private FyydService $fyydService
) {
parent::__construct(Application::APP_ID, $request);
}
public function hot(): JSONResponse {
return new JSONResponse($this->fyydService->hot());
}
public function new(): JSONResponse {
return new JSONResponse($this->fyydService->latest());
}
}