aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_status/lib/Controller/UserStatusController.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_status/lib/Controller/UserStatusController.php')
-rw-r--r--apps/user_status/lib/Controller/UserStatusController.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/user_status/lib/Controller/UserStatusController.php b/apps/user_status/lib/Controller/UserStatusController.php
index d06370a19ea..736c4e772ca 100644
--- a/apps/user_status/lib/Controller/UserStatusController.php
+++ b/apps/user_status/lib/Controller/UserStatusController.php
@@ -39,6 +39,7 @@ use OCA\UserStatus\ResponseDefinitions;
use OCA\UserStatus\Service\StatusService;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCS\OCSBadRequestException;
use OCP\AppFramework\OCS\OCSNotFoundException;
@@ -72,6 +73,7 @@ class UserStatusController extends OCSController {
*
* 200: The status was found successfully
*/
+ #[ApiRoute(verb: 'GET', url: '/api/v1/user_status')]
public function getStatus(): DataResponse {
try {
$this->calendarStatusService->processCalendarStatus($this->userId);
@@ -94,6 +96,7 @@ class UserStatusController extends OCSController {
*
* 200: The status was updated successfully
*/
+ #[ApiRoute(verb: 'PUT', url: '/api/v1/user_status/status')]
public function setStatus(string $statusType): DataResponse {
try {
$status = $this->service->setStatus($this->userId, $statusType, null, true);
@@ -118,6 +121,7 @@ class UserStatusController extends OCSController {
*
* 200: The message was updated successfully
*/
+ #[ApiRoute(verb: 'PUT', url: '/api/v1/user_status/message/predefined')]
public function setPredefinedMessage(string $messageId,
?int $clearAt): DataResponse {
try {
@@ -146,6 +150,7 @@ class UserStatusController extends OCSController {
*
* 200: The message was updated successfully
*/
+ #[ApiRoute(verb: 'PUT', url: '/api/v1/user_status/message/custom')]
public function setCustomMessage(?string $statusIcon,
?string $message,
?int $clearAt): DataResponse {
@@ -179,6 +184,7 @@ class UserStatusController extends OCSController {
*
* 200: Message cleared successfully
*/
+ #[ApiRoute(verb: 'DELETE', url: '/api/v1/user_status/message')]
public function clearMessage(): DataResponse {
$this->service->clearMessage($this->userId);
return new DataResponse([]);
@@ -195,6 +201,7 @@ class UserStatusController extends OCSController {
*
* 200: Status reverted
*/
+ #[ApiRoute(verb: 'DELETE', url: '/api/v1/user_status/revert/{messageId}')]
public function revertStatus(string $messageId): DataResponse {
$backupStatus = $this->service->revertUserStatus($this->userId, $messageId, true);
if ($backupStatus) {