Skip to content

Commit

Permalink
添加接口api文档
Browse files Browse the repository at this point in the history
  • Loading branch information
xishandong committed Jul 27, 2023
1 parent d713b68 commit 312110b
Show file tree
Hide file tree
Showing 9 changed files with 669 additions and 5 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added Server01/static/img/post/120-桥本环奈.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Server01/views/__pycache__/post.cpython-39.pyc
Binary file not shown.
Binary file modified Server01/views/__pycache__/user.cpython-39.pyc
Binary file not shown.
6 changes: 2 additions & 4 deletions Server01/views/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,5 @@ def post_delete(request, payload):
if post.user.id == payload['user_id']:
post.delete()
return JsonResponse({'success': '帖子删除成功'}, status=200)
print(payload)
print(data, post)
# return JsonResponse({'error': '错误操作'}, status=404)
# return JsonResponse({'error': '未查询到帖子信息'}, status=404)
return JsonResponse({'error': '错误'}, status=401)
return JsonResponse({'error': '错误'}, status=401)
2 changes: 1 addition & 1 deletion Server01/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def register(request):
return JsonResponse({'error': '该邮箱已被注册'}, status=401)
try:
models.User.objects.create(**data)
return JsonResponse({'username': data})
return JsonResponse({'info': '创建用户成功'})
except Exception as e:
print(e)
return JsonResponse({'error': '创建用户失败'}, status=401)
Expand Down
Loading

0 comments on commit 312110b

Please sign in to comment.