mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-12-28 16:12:13 +00:00
统一APIView的名字
This commit is contained in:
parent
172fd4b1f4
commit
7fcc4d972b
@ -1,7 +1,7 @@
|
||||
from django.conf.urls import url
|
||||
|
||||
from ..views.admin import UserAdminAPIView
|
||||
from ..views.admin import UserAdminAPI
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^user/$', UserAdminAPIView.as_view(), name="user_admin_api"),
|
||||
url(r'^user/$', UserAdminAPI.as_view(), name="user_admin_api"),
|
||||
]
|
||||
|
@ -1,9 +1,9 @@
|
||||
from django.conf.urls import url
|
||||
|
||||
from ..views.oj import UserLoginAPIView, UserRegisterAPIView, UserChangePasswordAPIView
|
||||
from ..views.oj import UserLoginAPI, UserRegisterAPI, UserChangePasswordAPI
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^login/$', UserLoginAPIView.as_view(), name="user_login_api"),
|
||||
url(r'^register/$', UserRegisterAPIView.as_view(), name="user_register_api"),
|
||||
url(r'^change_password/$', UserChangePasswordAPIView.as_view(), name="user_change_password_api")
|
||||
url(r'^login/$', UserLoginAPI.as_view(), name="user_login_api"),
|
||||
url(r'^register/$', UserRegisterAPI.as_view(), name="user_register_api"),
|
||||
url(r'^change_password/$', UserChangePasswordAPI.as_view(), name="user_change_password_api")
|
||||
]
|
||||
|
@ -12,7 +12,7 @@ from ..models import User
|
||||
from ..serializers import (UserSerializer, EditUserSerializer)
|
||||
|
||||
|
||||
class UserAdminAPIView(APIView):
|
||||
class UserAdminAPI(APIView):
|
||||
@validate_serializer(EditUserSerializer)
|
||||
@super_admin_required
|
||||
def put(self, request):
|
||||
|
@ -11,7 +11,7 @@ from ..serializers import (UserLoginSerializer, UserRegisterSerializer,
|
||||
UserChangePasswordSerializer)
|
||||
|
||||
|
||||
class UserLoginAPIView(APIView):
|
||||
class UserLoginAPI(APIView):
|
||||
@validate_serializer(UserLoginSerializer)
|
||||
def post(self, request):
|
||||
"""
|
||||
@ -43,7 +43,7 @@ class UserLoginAPIView(APIView):
|
||||
return self.success({})
|
||||
|
||||
|
||||
class UserRegisterAPIView(APIView):
|
||||
class UserRegisterAPI(APIView):
|
||||
@validate_serializer(UserRegisterSerializer)
|
||||
def post(self, request):
|
||||
"""
|
||||
@ -72,7 +72,7 @@ class UserRegisterAPIView(APIView):
|
||||
return self.success(_("Succeeded"))
|
||||
|
||||
|
||||
class UserChangePasswordAPIView(APIView):
|
||||
class UserChangePasswordAPI(APIView):
|
||||
@validate_serializer(UserChangePasswordSerializer)
|
||||
@login_required
|
||||
def post(self, request):
|
||||
|
@ -1,7 +1,7 @@
|
||||
from django.conf.urls import url
|
||||
|
||||
from ..views import AnnouncementAdminAPIView
|
||||
from ..views import AnnouncementAdminAPI
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', AnnouncementAdminAPIView.as_view(), name="announcement_admin_api"),
|
||||
url(r'^$', AnnouncementAdminAPI.as_view(), name="announcement_admin_api"),
|
||||
]
|
||||
|
@ -8,7 +8,7 @@ from .serializers import (CreateAnnouncementSerializer, AnnouncementSerializer,
|
||||
EditAnnouncementSerializer)
|
||||
|
||||
|
||||
class AnnouncementAdminAPIView(APIView):
|
||||
class AnnouncementAdminAPI(APIView):
|
||||
@super_admin_required
|
||||
def post(self, request):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user