UnisKB/apps/system_manage/views/valid.py

32 lines
967 B
Python
Raw Normal View History

2025-06-24 03:09:19 +00:00
# coding=utf-8
"""
@project: MaxKB
@Author
@file valid.py
@date2024/7/8 17:50
@desc:
"""
from drf_spectacular.utils import extend_schema
from rest_framework.request import Request
from rest_framework.views import APIView
from common.auth import TokenAuth
from django.utils.translation import gettext_lazy as _
from common.result import result
from system_manage.serializers.valid_serializers import ValidSerializer
class Valid(APIView):
authentication_classes = [TokenAuth]
@extend_schema(
methods=['GET'],
description=_('Get verification results'),
summary=_('Get verification results'),
operation_id=_('Get verification results'), # type: ignore
tags=[_('Validation')] # type: ignore
)
def get(self, request: Request, valid_type: str, valid_count: int):
return result.success(ValidSerializer(data={'valid_type': valid_type, 'valid_count': valid_count}).valid())