repod/lib/Controller/TopsController.php
Michel Roux 37d264d717
All checks were successful
repod / xml (push) Successful in 18s
repod / php (push) Successful in 1m1s
repod / nodejs (push) Successful in 2m22s
repod / release (push) Has been skipped
refacto: simplify tops wordings
2024-01-17 22:38:47 +01:00

30 lines
617 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 TopsController 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());
}
}