mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 18:32:48 +00:00
48 lines
1.3 KiB
Python
48 lines
1.3 KiB
Python
# coding=utf-8
|
||
"""
|
||
@project: MaxKB
|
||
@Author:虎虎
|
||
@file: application.py
|
||
@date:2025/5/26 16:59
|
||
@desc:
|
||
"""
|
||
from django.utils.translation import gettext_lazy as _
|
||
from drf_spectacular.types import OpenApiTypes
|
||
from drf_spectacular.utils import OpenApiParameter
|
||
from rest_framework import serializers
|
||
|
||
from application.serializers.application import ApplicationCreateSerializer
|
||
from common.mixins.api_mixin import APIMixin
|
||
from common.result import ResultSerializer
|
||
|
||
|
||
class ApplicationCreateRequest(ApplicationCreateSerializer.SimplateRequest):
|
||
work_flow = serializers.DictField(required=True, label=_("Workflow Objects"))
|
||
|
||
|
||
class ApplicationCreateResponse(ResultSerializer):
|
||
def get_data(self):
|
||
return ApplicationCreateSerializer.ApplicationResponse()
|
||
|
||
|
||
class ApplicationCreateAPI(APIMixin):
|
||
@staticmethod
|
||
def get_parameters():
|
||
return [
|
||
OpenApiParameter(
|
||
name="workspace_id",
|
||
description="工作空间id",
|
||
type=OpenApiTypes.STR,
|
||
location='path',
|
||
required=True,
|
||
)
|
||
]
|
||
|
||
@staticmethod
|
||
def get_request():
|
||
return ApplicationCreateRequest
|
||
|
||
@staticmethod
|
||
def get_response():
|
||
return ApplicationCreateResponse
|