mirror of
https://github.com/harivansh-afk/betterNAS.git
synced 2026-04-15 20:03:08 +00:00
init
This commit is contained in:
parent
4f174ec3a8
commit
db1dea097f
81 changed files with 6263 additions and 545 deletions
29
apps/nextcloud-app/lib/Controller/ApiController.php
Normal file
29
apps/nextcloud-app/lib/Controller/ApiController.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OCA\BetterNasControlplane\Controller;
|
||||
|
||||
use OCA\BetterNasControlplane\AppInfo\Application;
|
||||
use OCA\BetterNasControlplane\Service\ControlPlaneClient;
|
||||
use OCP\AppFramework\Http\Attribute\ApiRoute;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\OCSController;
|
||||
use OCP\IRequest;
|
||||
|
||||
class ApiController extends OCSController {
|
||||
public function __construct(
|
||||
IRequest $request,
|
||||
private readonly ControlPlaneClient $controlPlaneClient,
|
||||
) {
|
||||
parent::__construct(Application::APP_ID, $request);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
#[ApiRoute(verb: 'GET', url: '/api/status')]
|
||||
public function status(): DataResponse {
|
||||
return new DataResponse($this->controlPlaneClient->fetchSnapshot());
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue