app_template/lib/Controller/ApiController.php
provokateurin a5f9017292
feat: Initial commit
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-04-25 10:03:54 +02:00

32 lines
672 B
PHP

<?php
declare(strict_types=1);
namespace OCA\AppTemplate\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
/**
* @psalm-suppress UnusedClass
*/
class ApiController extends OCSController {
/**
* An example API endpoint
*
* @return DataResponse<Http::STATUS_OK, array{message: string}, array{}>
*
* 200: Data returned
*/
#[NoAdminRequired]
#[ApiRoute(verb: 'GET', url: '/api')]
public function index(): DataResponse {
return new DataResponse(
['message' => 'Hello world!']
);
}
}