|
|
|
@ -16,6 +16,9 @@ from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
|
|
|
|
@csrf_exempt
|
|
|
|
|
@permission(allowed_roles=["admin", "teacher"])
|
|
|
|
|
def add_student(request):
|
|
|
|
|
"""
|
|
|
|
|
添加学生
|
|
|
|
|
"""
|
|
|
|
|
if not request.method == "POST":
|
|
|
|
|
return JsonResponse(ResponseUtil.error("request method error!"))
|
|
|
|
|
try:
|
|
|
|
@ -37,6 +40,9 @@ def add_student(request):
|
|
|
|
|
@csrf_exempt
|
|
|
|
|
@permission(allowed_roles=["admin", "teacher"])
|
|
|
|
|
def search_student(request):
|
|
|
|
|
"""
|
|
|
|
|
根据表单对学生进行模糊查询,以及将查询的数据进行分页
|
|
|
|
|
"""
|
|
|
|
|
currentPage = request.GET.get("currentPage")
|
|
|
|
|
pageSize = request.GET.get("pageSize")
|
|
|
|
|
request_data = request.POST
|
|
|
|
@ -67,6 +73,9 @@ def search_student(request):
|
|
|
|
|
@csrf_exempt
|
|
|
|
|
@permission(allowed_roles=["admin", "teacher"])
|
|
|
|
|
def del_student(request):
|
|
|
|
|
"""
|
|
|
|
|
根据学生ID删除学生
|
|
|
|
|
"""
|
|
|
|
|
if not request.method == "GET":
|
|
|
|
|
return JsonResponse(ResponseUtil.error("request method error!"))
|
|
|
|
|
try:
|
|
|
|
@ -82,6 +91,9 @@ def del_student(request):
|
|
|
|
|
@csrf_exempt
|
|
|
|
|
@permission(allowed_roles=["admin", "student", "teacher"])
|
|
|
|
|
def select_course(request):
|
|
|
|
|
"""
|
|
|
|
|
选课
|
|
|
|
|
"""
|
|
|
|
|
if not request.method == "POST":
|
|
|
|
|
return JsonResponse(ResponseUtil.error("request method error!"))
|
|
|
|
|
try:
|
|
|
|
|