input('limit', 30); return ApiResponse::handle(function () use ($limit) { return $this->todayIssueService->summary($limit); }, __('message.fetched')); } /** * 읽지 않은 이슈 목록 조회 (헤더 알림용) */ public function unread(Request $request): JsonResponse { $limit = (int) $request->input('limit', 10); return ApiResponse::handle(function () use ($limit) { return $this->todayIssueService->getUnreadList($limit); }, __('message.fetched')); } /** * 읽지 않은 이슈 개수 조회 (헤더 알림 뱃지용) */ public function unreadCount(): JsonResponse { return ApiResponse::handle(function () { return ['count' => $this->todayIssueService->getUnreadCount()]; }, __('message.fetched')); } /** * 이슈 읽음 처리 */ public function markAsRead(int $id): JsonResponse { return ApiResponse::handle(function () use ($id) { $result = $this->todayIssueService->markAsRead($id); if (! $result) { throw new \App\Exceptions\ApiException(__('error.not_found'), 404); } return null; }, __('message.today_issue.marked_as_read')); } /** * 모든 이슈 읽음 처리 */ public function markAllAsRead(): JsonResponse { return ApiResponse::handle(function () { $count = $this->todayIssueService->markAllAsRead(); return ['count' => $count]; }, __('message.today_issue.all_marked_as_read')); } }