mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-18 05:20:50 +01:00
feat(preset): Add list API
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
1d436cdd75
commit
0956c95116
2 changed files with 53 additions and 0 deletions
46
lib/Controller/PresetController.php
Normal file
46
lib/Controller/PresetController.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Controller;
|
||||
|
||||
use OCA\Talk\ResponseDefinitions;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\Attribute\ApiRoute;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\IRequest;
|
||||
|
||||
/**
|
||||
* @psalm-import-type TalkConversationPreset from ResponseDefinitions
|
||||
*/
|
||||
class PresetController extends AEnvironmentAwareOCSController {
|
||||
|
||||
public function __construct(
|
||||
string $appName,
|
||||
IRequest $request,
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of available presets
|
||||
*
|
||||
* @return DataResponse<Http::STATUS_OK, list<TalkConversationPreset>, array{}>
|
||||
*
|
||||
* 200: Successfully got presets
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/preset', requirements: [
|
||||
'apiVersion' => '(v1)',
|
||||
'token' => '[a-z0-9]{4,30}',
|
||||
])]
|
||||
public function getPresets(): DataResponse {
|
||||
return new DataResponse([], Http::STATUS_OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -580,6 +580,13 @@ namespace OCA\Talk;
|
|||
* sendAt: int,
|
||||
* silent: bool,
|
||||
* }
|
||||
*
|
||||
* @psalm-type TalkConversationPreset = {
|
||||
* // Identifier of the preset, currently known: default, webinar, presentation, hallway
|
||||
* id: string,
|
||||
* // Translated name of the preset in user's language
|
||||
* name: string,
|
||||
* }
|
||||
*/
|
||||
class ResponseDefinitions {
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue