Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions booth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,35 @@ def retrieve(self, request, *args, **kwargs):
success=False
)

#부스 운영 마감
@action(detail=False, methods=['post'], url_path='finish')
def set_booth_finished(self, request):
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
)
else:
return custom_response(
data={'detail': '비밀번호가 틀립니다.'},
message='부스 운영 마감 실패',
code=status.HTTP_500_INTERNAL_SERVER_ERROR,
success=False
)


class BoothWaitingStatusViewSet(CustomResponseMixin, viewsets.GenericViewSet, mixins.RetrieveModelMixin, mixins.ListModelMixin):
"""
- GET /booths-waiting -> 부스 목록(가나다순) - 대기 정보
Expand Down