12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- from .models import KeywordMission, DateMission, TimeMission, PageMission
- from rest_framework.parsers import JSONParser
- from rest_framework import viewsets
- from .serializers import UserSerializer, KeywordMissionSerializer, DateMissionSerializer, TimeMissionSerializer, \
- PageMissionSerializer
- from django.contrib.auth.models import User
- class KeywordMissionViewSet(viewsets.ModelViewSet):
- """
- 允许用户查看或编辑的API路径。
- """
- queryset = KeywordMission.objects.all()
- serializer_class = KeywordMissionSerializer
- class UserViewSet(viewsets.ModelViewSet):
- """
- 允许用户查看或编辑的API路径。
- """
- queryset = User.objects.all()
- serializer_class = UserSerializer
- class DateMissionViewSet(viewsets.ModelViewSet):
- """
- 允许用户查看或编辑的API路径。
- """
- queryset = DateMission.objects.all()
- serializer_class = DateMissionSerializer
- class TimeMissionViewSet(viewsets.ModelViewSet):
- """
- 允许用户查看或编辑的API路径。
- """
- queryset = TimeMission.objects.all()
- serializer_class = TimeMissionSerializer
- class PageMissionViewSet(viewsets.ModelViewSet):
- """
- 允许用户查看或编辑的API路径。
- """
- queryset = PageMission.objects.all()
- serializer_class = PageMissionSerializer
|