repod/lib/Controller/ToplistController.php
Michel Roux 70f1d3b69f
All checks were successful
repod / xml (push) Successful in 20s
repod / php (push) Successful in 58s
repod / nodejs (push) Successful in 2m1s
feat: rework Discover
2024-01-10 17:50:06 +01:00

38 lines
722 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);
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*/
public function hot(): JSONResponse {
return new JSONResponse($this->fyydService->hot());
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*/
public function new(): JSONResponse {
return new JSONResponse($this->fyydService->latest());
}
}