Exemplo n.º 1
0
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)
Exemplo n.º 2
0
def recommend_volunteer(request):
    if request.method == 'POST':
        form = getForm(request.POST)
        message = recommendVolunteers(form)
        return JsonResponse({'message': message}, status=200)
Exemplo n.º 3
0
def message_detail(request):
    if request.method == 'POST':
        form = getForm(request.POST)
        message = getMessageDetail(form)
        return JsonResponse({'message': message}, status=200)
Exemplo n.º 4
0
def message(request):
    if request.method == 'POST':
        form = getForm(request.POST)
        messages = getMessages(form)
        return JsonResponse({'messages': messages}, status=200)
Exemplo n.º 5
0
def comment(request):
    if request.method == 'POST':
        form = getForm(request.POST)
        message, code = createComment(form)
        return JsonResponse({'message': '评价成功', 'code': code}, status=200)
Exemplo n.º 6
0
def finish(request):
    if request.method == 'POST':
        form = getForm(request.POST)
        message, code = finishReservation(form)
        return JsonResponse({'message': message, 'code': code}, status=200)
Exemplo n.º 7
0
def create(request):
    if request.method == 'POST':
        form = getForm(request.POST)
        createReservation(form)
        return JsonResponse({'message': '订单创建成功'}, status=200)