2024-10-23 09:01:19 +00:00
|
|
|
|
# coding=utf-8
|
|
|
|
|
|
"""
|
|
|
|
|
|
@project: MaxKB
|
|
|
|
|
|
@Author:虎
|
|
|
|
|
|
@file: application_version_api.py
|
|
|
|
|
|
@date:2024/10/15 17:18
|
|
|
|
|
|
@desc:
|
|
|
|
|
|
"""
|
|
|
|
|
|
from drf_yasg import openapi
|
|
|
|
|
|
|
|
|
|
|
|
from common.mixins.api_mixin import ApiMixin
|
2025-01-13 11:05:08 +00:00
|
|
|
|
from django.utils.translation import gettext_lazy as _
|
2024-10-23 09:01:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ApplicationVersionApi(ApiMixin):
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
|
def get_response_body_api():
|
|
|
|
|
|
return openapi.Schema(
|
|
|
|
|
|
type=openapi.TYPE_OBJECT,
|
|
|
|
|
|
required=['id', 'name', 'work_flow', 'create_time', 'update_time'],
|
|
|
|
|
|
properties={
|
2025-01-13 11:05:08 +00:00
|
|
|
|
'id': openapi.Schema(type=openapi.TYPE_NUMBER, title=_("Primary key id"),
|
|
|
|
|
|
description=_("Primary key id")),
|
|
|
|
|
|
'name': openapi.Schema(type=openapi.TYPE_NUMBER, title=_("Version Name"),
|
|
|
|
|
|
description=_("Version Name")),
|
|
|
|
|
|
'work_flow': openapi.Schema(type=openapi.TYPE_STRING, title=_("Workflow data"),
|
|
|
|
|
|
description=_('Workflow data')),
|
|
|
|
|
|
'create_time': openapi.Schema(type=openapi.TYPE_STRING, title=_("Creation time"),
|
|
|
|
|
|
description=_('Creation time')),
|
|
|
|
|
|
'update_time': openapi.Schema(type=openapi.TYPE_STRING, title=_("Modification time"),
|
|
|
|
|
|
description=_('Modification time'))
|
2024-10-23 09:01:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class Query(ApiMixin):
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
|
def get_request_params_api():
|
|
|
|
|
|
return [openapi.Parameter(name='application_id',
|
|
|
|
|
|
in_=openapi.IN_PATH,
|
|
|
|
|
|
type=openapi.TYPE_STRING,
|
|
|
|
|
|
required=True,
|
2025-01-13 11:05:08 +00:00
|
|
|
|
description=_('Application ID')),
|
2024-10-23 09:01:19 +00:00
|
|
|
|
openapi.Parameter(name='name',
|
|
|
|
|
|
in_=openapi.IN_QUERY,
|
|
|
|
|
|
type=openapi.TYPE_STRING,
|
|
|
|
|
|
required=False,
|
2025-01-13 11:05:08 +00:00
|
|
|
|
description=_('Version Name'))]
|
2024-10-23 09:01:19 +00:00
|
|
|
|
|
|
|
|
|
|
class Operate(ApiMixin):
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
|
def get_request_params_api():
|
|
|
|
|
|
return [openapi.Parameter(name='application_id',
|
|
|
|
|
|
in_=openapi.IN_PATH,
|
|
|
|
|
|
type=openapi.TYPE_STRING,
|
|
|
|
|
|
required=True,
|
2025-01-13 11:05:08 +00:00
|
|
|
|
description=_('Application ID')),
|
2024-10-23 09:01:19 +00:00
|
|
|
|
openapi.Parameter(name='work_flow_version_id',
|
|
|
|
|
|
in_=openapi.IN_PATH,
|
|
|
|
|
|
type=openapi.TYPE_STRING,
|
|
|
|
|
|
required=True,
|
2025-01-13 11:05:08 +00:00
|
|
|
|
description=_('Application version id')), ]
|
2024-10-23 09:01:19 +00:00
|
|
|
|
|
|
|
|
|
|
class Edit(ApiMixin):
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
|
def get_request_body_api():
|
|
|
|
|
|
return openapi.Schema(
|
|
|
|
|
|
type=openapi.TYPE_OBJECT,
|
|
|
|
|
|
required=[],
|
|
|
|
|
|
properties={
|
2025-01-13 11:05:08 +00:00
|
|
|
|
'name': openapi.Schema(type=openapi.TYPE_STRING, title=_("Version Name"),
|
|
|
|
|
|
description=_("Version Name"))
|
2024-10-23 09:01:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
)
|