From e8d7094c1c2422de2544005af8fd9801d7d779a6 Mon Sep 17 00:00:00 2001 From: mingi Date: Thu, 22 May 2025 21:29:08 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=A0=84=EC=B2=B4=20=EC=9C=A0=EC=A0=80?= =?UTF-8?q?=20=EC=88=98=20=ED=99=95=EC=9D=B8=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- accounts/views.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/accounts/views.py b/accounts/views.py index 0586fe2..3d336ae 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -266,6 +266,30 @@ def is_black_user(self, request): ] }, status=status.HTTP_200_OK) + @action(detail=False, methods=['get'], url_path='user-count') + def user_count(self, request): + try: + user_count = User.objects.count() + except Exception as e: + return Response({ + "status": "error", + "message": "유저 수 조회 실패", + "code": 500, + "data": [ + {"detail": str(e)} + ] + }, status=status.HTTP_500_INTERNAL_SERVER_ERROR) + + return Response({ + "status": "success", + "message": "유저 수 조회 성공", + "code": 200, + "data": { + "user_count": user_count + } + }, status=status.HTTP_200_OK) + + class SMSViewSet(viewsets.ViewSet): """ 문자인증 관련 API 뷰