File manager - Edit - /var/www/html/pcadigital/api/app/Http/Controllers/NotificationController.php
Back
<?php namespace App\Http\Controllers; use App\Http\Services\NotificationService; use App\Models\Notification; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; /** * @OA\Tag( * name="Notification", * description="Gerenciamento de Notificações" * ) */ class NotificationController extends Controller { private NotificationService $notificationService; public function __construct() { $this->notificationService = new NotificationService(); } /** * @OA\Get( * path="/api/notification/unread/{authUuid}", * summary="Lista notificações não lidas de um usuário", * operationId="GetAllUnreadNotifications", * tags={"Notification"}, * security={{"bearerAuth":{}}}, * @OA\Parameter( * name="authUuid", * in="path", * description="UUID de autenticação do usuário", * required=true, * @OA\Schema(type="string", format="uuid") * ), * @OA\Response( * response=200, * description="Notificações não lidas retornadas com sucesso" * ), * @OA\Response(response=404, description="Usuário não encontrado ou sem notificações") * ) */ public function getAllUnreadByUser(string $authUuid): JsonResponse { $response = $this->notificationService->getAllUnreadByUser($authUuid); return response()->json($response->data, $response->code); } /** * @OA\Put( * path="/api/notification/{notification}/read", * summary="Marca uma notificação como lida", * operationId="SetNotificationAsRead", * tags={"Notification"}, * security={{"bearerAuth":{}}}, * @OA\Parameter( * name="notification", * in="path", * description="ID da notificação", * required=true, * @OA\Schema(type="integer") * ), * @OA\Response(response=200, description="Notificação marcada como lida com sucesso"), * @OA\Response(response=404, description="Notificação não encontrada") * ) */ public function setAsRead(Notification $notification): JsonResponse { $response = $this->notificationService->setAsRead($notification); return response()->json($response->data, $response->code); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings