system_profile.py 889 B

12345678910111213141516171819202122232425262728
  1. # coding=utf-8
  2. """
  3. @project: MaxKB
  4. @Author:虎虎
  5. @file: system_profile.py
  6. @date:2025/6/4 15:59
  7. @desc:
  8. """
  9. from django.utils.translation import gettext_lazy as _
  10. from drf_spectacular.utils import extend_schema
  11. from rest_framework.request import Request
  12. from rest_framework.views import APIView
  13. from common import result
  14. from system_manage.api.system import SystemProfileAPI
  15. from system_manage.serializers.system import SystemProfileSerializer
  16. class SystemProfile(APIView):
  17. @extend_schema(
  18. methods=['GET'],
  19. description=_('Get MaxKB related information'),
  20. operation_id=_('Get MaxKB related information'), # type: ignore
  21. responses=SystemProfileAPI.get_response(),
  22. tags=[_('System parameters')] # type: ignore
  23. )
  24. def get(self, request: Request):
  25. return result.success(SystemProfileSerializer.profile())