MaxKB/apps/chat/views/chat_embed.py
shaohuzhang1 43654bddaf
Some checks failed
sync2gitee / repo-sync (push) Has been cancelled
feat: application operate api (#3176)
2025-05-30 20:02:39 +08:00

33 lines
1.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# coding=utf-8
"""
@project: MaxKB
@Author虎虎
@file chat_embed.py
@date2025/5/30 15:22
@desc:
"""
from django.utils.translation import gettext_lazy as _
from drf_spectacular.utils import extend_schema
from rest_framework.request import Request
from rest_framework.views import APIView
from chat.api.chat_embed_api import ChatEmbedAPI
from chat.serializers.chat_embed_serializers import ChatEmbedSerializer
class ChatEmbedView(APIView):
@extend_schema(
methods=['GET'],
description=_('Import Application'),
summary=_('Import Application'),
operation_id=_('Import Application'), # type: ignore
parameters=ChatEmbedAPI.get_parameters(),
responses=ChatEmbedAPI.get_response(),
tags=[_('Application')] # type: ignore
)
def get(self, request: Request):
return ChatEmbedSerializer(
data={'protocol': request.query_params.get('protocol'), 'token': request.query_params.get('token'),
'host': request.query_params.get('host'), }).get_embed(params=request.query_params)