2025-03-18 18:34:03 +08:00

25 lines
964 B
Python
Raw Permalink 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.

"""
任务参数相关API模型
包含任务参数的请求和响应的数据模型
"""
from typing import Dict, Any, List, Optional
from pydantic import BaseModel, Field
from enum import Enum
from config.task_config import TaskInputParamType
# 任务输入参数模型
class TaskInputParamModel(BaseModel):
"""任务输入参数模型"""
param_id: Optional[str] = Field(None, description="参数ID新增参数时不需要传")
param_name: str = Field(..., description="变量名")
label: str = Field(..., description="标签")
param_type: TaskInputParamType = Field(..., description="类型")
required: bool = Field(False, description="是否必填")
default_value: Optional[Any] = Field(None, description="默认值")
description: Optional[str] = Field(None, description="说明")
class TaskInputParamsUpdateRequest(BaseModel):
"""任务输入参数更新请求"""
task_id: str
params: List[TaskInputParamModel]