diff options
author | Vitor Mattos <vitor@php.rio> | 2022-11-10 01:01:09 -0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-12-07 14:59:10 +0100 |
commit | 8c8ffbad2e0986b86edc219a3bbe04be4b16eb55 (patch) | |
tree | 0c899e70b2c289b7be6dd6b193477d897b175dbc /appinfo | |
parent | 1633f330251b7466a4f8b1670c3bd785567432a6 (diff) |
Implement group avatar endpoints
Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'appinfo')
-rw-r--r-- | appinfo/routes.php | 1 | ||||
-rw-r--r-- | appinfo/routes/routesGroupAvatarController.php | 40 |
2 files changed, 41 insertions, 0 deletions
diff --git a/appinfo/routes.php b/appinfo/routes.php index af1f35888..a16a54df2 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -43,4 +43,5 @@ return array_merge_recursive( include(__DIR__ . '/routes/routesSettingsController.php'), include(__DIR__ . '/routes/routesSignalingController.php'), include(__DIR__ . '/routes/routesTempAvatarController.php'), + include(__DIR__ . '/routes/routesGroupAvatarController.php'), ); diff --git a/appinfo/routes/routesGroupAvatarController.php b/appinfo/routes/routesGroupAvatarController.php new file mode 100644 index 000000000..970190050 --- /dev/null +++ b/appinfo/routes/routesGroupAvatarController.php @@ -0,0 +1,40 @@ +<?php + +declare(strict_types=1); +/** + * @copyright Copyright (c) 2022, Vitor Mattos <vitor@php.rio> + * + * @author Vitor Mattos <vitor@php.rio> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +$requirements = [ + 'apiVersion' => 'v1', + 'token' => '^[a-z0-9]{4,30}$', +]; + +return [ + 'ocs' => [ + /** @see \OCA\Talk\Controller\GroupAvatarController::postAvatar() */ + ['name' => 'GroupAvatar#postAvatar', 'url' => '/api/{apiVersion}/group-avatar/{token}', 'verb' => 'POST', 'requirements' => $requirements], + /** @see \OCA\Talk\Controller\GroupAvatarController::getAvatar() */ + ['name' => 'GroupAvatar#getAvatar', 'url' => '/api/{apiVersion}/group-avatar/{token}', 'verb' => 'GET', 'requirements' => $requirements], + /** @see \OCA\Talk\Controller\GroupAvatarController::deleteAvatar() */ + ['name' => 'GroupAvatar#deleteAvatar', 'url' => '/api/{apiVersion}/group-avatar/{token}', 'verb' => 'DELETE', 'requirements' => $requirements], + ], +]; |