From cf4bbf1ba8335b02240fc4024826c572d15898ce Mon Sep 17 00:00:00 2001 From: jiyoon607 Date: Mon, 26 May 2025 21:09:41 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Feat:=20=EB=B0=B1=EC=97=94=EB=93=9C?= =?UTF-8?q?=EC=9A=A9=20=EB=B6=80=EC=8A=A4=20=EB=A7=88=EA=B0=90=20api?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- booth/views.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/booth/views.py b/booth/views.py index 36a2ebd..a2f49e7 100644 --- a/booth/views.py +++ b/booth/views.py @@ -124,6 +124,26 @@ def retrieve(self, request, *args, **kwargs): success=False ) + #부스 운영 마감 + @action(detail=False, methods=['post'], url_path='finish-operating-booth') + def set_booth_finished(self, request): + try: + operating_booths = Booth.objects.filter(operating_status='operating') + count = operating_booths.update(operating_status='finished') + return custom_response( + data={'detail': f'{count}개 부스의 운영을 마감하였습니다.'}, + message="부스 운영 마감 성공", + code=status.HTTP_200_OK + ) + except Exception as e: + return custom_response( + data={'detail': str(e)}, + message='부스 운영 마감 실패', + code=status.HTTP_500_INTERNAL_SERVER_ERROR, + success=False + ) + + class BoothWaitingStatusViewSet(CustomResponseMixin, viewsets.GenericViewSet, mixins.RetrieveModelMixin, mixins.ListModelMixin): """ - GET /booths-waiting -> 부스 목록(가나다순) - 대기 정보 From 526942c03c41c09c0f4522cdc85a8a3d9869dec8 Mon Sep 17 00:00:00 2001 From: jiyoon607 Date: Mon, 26 May 2025 21:18:39 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Fix:=20=EB=B6=80=EC=8A=A4=20=EB=A7=88?= =?UTF-8?q?=EA=B0=90=20api=EC=97=90=20=EB=B9=84=EB=B0=80=EB=B2=88=ED=98=B8?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- booth/views.py | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/booth/views.py b/booth/views.py index a2f49e7..95daf23 100644 --- a/booth/views.py +++ b/booth/views.py @@ -125,23 +125,32 @@ def retrieve(self, request, *args, **kwargs): ) #부스 운영 마감 - @action(detail=False, methods=['post'], url_path='finish-operating-booth') + @action(detail=False, methods=['post'], url_path='finish') def set_booth_finished(self, request): - try: - operating_booths = Booth.objects.filter(operating_status='operating') - count = operating_booths.update(operating_status='finished') - return custom_response( - data={'detail': f'{count}개 부스의 운영을 마감하였습니다.'}, - message="부스 운영 마감 성공", - code=status.HTTP_200_OK + password = request.data.get('password') + if password == '219480linenow@since2024!': + try: + operating_booths = Booth.objects.filter(operating_status='operating') + count = operating_booths.update(operating_status='finished') + return custom_response( + data={'detail': f'{count}개 부스의 운영을 마감하였습니다.'}, + message="부스 운영 마감 성공", + code=status.HTTP_200_OK + ) + except Exception as e: + return custom_response( + data={'detail': str(e)}, + message='부스 운영 마감 실패', + code=status.HTTP_500_INTERNAL_SERVER_ERROR, + success=False ) - except Exception as e: + else: return custom_response( - data={'detail': str(e)}, - message='부스 운영 마감 실패', - code=status.HTTP_500_INTERNAL_SERVER_ERROR, - success=False - ) + data={'detail': '비밀번호가 틀립니다.'}, + message='부스 운영 마감 실패', + code=status.HTTP_500_INTERNAL_SERVER_ERROR, + success=False + ) class BoothWaitingStatusViewSet(CustomResponseMixin, viewsets.GenericViewSet, mixins.RetrieveModelMixin, mixins.ListModelMixin):