def reservation(request): if request.method == 'GET': reservations = getAllReservation() return JsonResponse({'message': reservations}, status=200) elif request.method == 'POST': form = getForm(request.POST) reservations = getReservations(form) return JsonResponse({'message': reservations}, status=200)
def recommend_volunteer(request): if request.method == 'POST': form = getForm(request.POST) message = recommendVolunteers(form) return JsonResponse({'message': message}, status=200)
def message_detail(request): if request.method == 'POST': form = getForm(request.POST) message = getMessageDetail(form) return JsonResponse({'message': message}, status=200)
def message(request): if request.method == 'POST': form = getForm(request.POST) messages = getMessages(form) return JsonResponse({'messages': messages}, status=200)
def comment(request): if request.method == 'POST': form = getForm(request.POST) message, code = createComment(form) return JsonResponse({'message': '评价成功', 'code': code}, status=200)
def finish(request): if request.method == 'POST': form = getForm(request.POST) message, code = finishReservation(form) return JsonResponse({'message': message, 'code': code}, status=200)
def create(request): if request.method == 'POST': form = getForm(request.POST) createReservation(form) return JsonResponse({'message': '订单创建成功'}, status=200)