mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
847 B
31 lines
847 B
# ~*~ coding: utf-8 ~*~
|
|
#
|
|
|
|
from rest_framework import generics, mixins, status, permissions
|
|
from rest_framework.views import APIView
|
|
from rest_framework.response import Response
|
|
|
|
from .serializers import UserSerializer, UserGroupSerializer
|
|
from .models import User, UserGroup
|
|
|
|
|
|
class UserListAddApi(generics.ListCreateAPIView):
|
|
queryset = User.objects.all()
|
|
serializer_class = UserSerializer
|
|
|
|
|
|
class UserDetailDeleteUpdateApi(generics.RetrieveUpdateDestroyAPIView):
|
|
queryset = User.objects.all()
|
|
serializer_class = UserSerializer
|
|
|
|
|
|
class UserGroupListAddApi(generics.ListCreateAPIView):
|
|
queryset = UserGroup.objects.all()
|
|
serializer_class = UserGroupSerializer
|
|
|
|
|
|
class UserGroupDetailDeleteUpdateApi(generics.RetrieveUpdateDestroyAPIView):
|
|
queryset = UserGroup.objects.all()
|
|
serializer_class = UserGroupSerializer
|
|
|