|  |  |  | from typing import Union, Optional, List | 
					
						
							|  |  |  | from pydantic import BaseModel, ConfigDict, Field | 
					
						
							|  |  |  | from datetime import datetime | 
					
						
							|  |  |  | from pydantic.alias_generators import to_camel | 
					
						
							|  |  |  | from module_admin.annotation.pydantic_annotation import as_query | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ConnectionParams(BaseModel): | 
					
						
							|  |  |  |     model_config = ConfigDict(alias_generator=to_camel, from_attributes=True) | 
					
						
							|  |  |  |     user: str = Field(description="Database user") | 
					
						
							|  |  |  |     password: str = Field(description="Database password") | 
					
						
							|  |  |  |     address: str = Field(description="Database address") | 
					
						
							|  |  |  |     database: str = Field(description="Database name") | 
					
						
							|  |  |  |     jdbc_url: str = Field(alias="jdbcUrl", description="JDBC URL") | 
					
						
							|  |  |  |     driver_class_name: str = Field(alias="driverClassName", description="JDBC driver class name") | 
					
						
							|  |  |  |     validation_query: str = Field(description="Validation query") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class DataSource(BaseModel): | 
					
						
							|  |  |  |     model_config = ConfigDict(alias_generator=to_camel, from_attributes=True) | 
					
						
							|  |  |  |     id: int = Field(description="Primary key ID") | 
					
						
							|  |  |  |     user_id: int = Field(alias="userId", description="User ID") | 
					
						
							|  |  |  |     user_name: str = Field(alias="userName", description="Username") | 
					
						
							|  |  |  |     name: str = Field(description="Datasource name") | 
					
						
							|  |  |  |     note: Optional[str] = Field(default=None, description="Datasource note") | 
					
						
							|  |  |  |     type: str = Field(description="Datasource type") | 
					
						
							|  |  |  |     connection_params: ConnectionParams = Field(alias="connectionParams", description="Connection parameters") | 
					
						
							|  |  |  |     create_time: datetime = Field(alias="createTime", description="Creation time") | 
					
						
							|  |  |  |     update_time: datetime = Field(alias="updateTime", description="Update time") | 
					
						
							|  |  |  | class dsSchedule(BaseModel): | 
					
						
							|  |  |  |     model_config = ConfigDict(alias_generator=to_camel, from_attributes=True) | 
					
						
							|  |  |  |     id: int = Field(description="Primary key ID") | 
					
						
							|  |  |  |     releaseState: Optional[str] = Field(alias="releaseState", description="releaseState") | 
					
						
							|  |  |  | class WorkerGroup(BaseModel): | 
					
						
							|  |  |  |     name: str= Field(description="Datasource name") | 
					
						
							|  |  |  | class AlertGroups(BaseModel): | 
					
						
							|  |  |  |     id: int = Field(description="Primary key ID") | 
					
						
							|  |  |  |     description: str = Field(description="Datasource name") | 
					
						
							|  |  |  |     alertInstanceIds: str = Field(description="Datasource name") | 
					
						
							|  |  |  |     groupName: str = Field(description="Datasource name") | 
					
						
							|  |  |  | class Environment(BaseModel): | 
					
						
							|  |  |  |     id: int = Field(description="Primary key ID") | 
					
						
							|  |  |  |     code: int = Field(description="Primary key ID") | 
					
						
							|  |  |  |     operator: int = Field(description="Primary key ID") | 
					
						
							|  |  |  |     description: str = Field(description="Datasource name") | 
					
						
							|  |  |  |     config: str = Field(description="Datasource name") | 
					
						
							|  |  |  |     name: str = Field(description="Datasource name") | 
					
						
							|  |  |  |     workerGroups: list[str]= Field(description="Datasource name") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Datasouceall(BaseModel): | 
					
						
							|  |  |  |     workerGroup:List[WorkerGroup]=[] | 
					
						
							|  |  |  |     alertGroups:List[AlertGroups]=[] | 
					
						
							|  |  |  |     environment:List[Environment]=[] | 
					
						
							|  |  |  | class ProcessDefinition(BaseModel): | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     processDefinitionCode: Optional[int] = Field(None, description="Process definition code") | 
					
						
							|  |  |  |     failureStrategy: Optional[str] = Field(None, description="Failure strategy") | 
					
						
							|  |  |  |     warningType: Optional[str] = Field(None, description="Warning type") | 
					
						
							|  |  |  |     warningGroupId: Optional[int] = Field(None, description="Warning group ID") | 
					
						
							|  |  |  |     execType: Optional[str] = Field(None, description="Execution type") | 
					
						
							|  |  |  |     # startNodeList: Optional[List[str]] = Field(default_factory=list, description="Start node list") | 
					
						
							|  |  |  |     startNodeList: Optional[str] = Field(default_factory=list, description="Start node list") | 
					
						
							|  |  |  |     taskDependType: Optional[str] = Field(None, description="Task depend type") | 
					
						
							|  |  |  |     complementDependentMode: Optional[str] = Field(None, description="Complement dependent mode") | 
					
						
							|  |  |  |     runMode: Optional[str] = Field(None, description="Run mode") | 
					
						
							|  |  |  |     processInstancePriority: Optional[str] = Field(None, description="Process instance priority") | 
					
						
							|  |  |  |     workerGroup: Optional[str] = Field(None, description="Worker group") | 
					
						
							|  |  |  |     startParams: Optional[str] = Field(None, description="Worker group") | 
					
						
							|  |  |  |     environmentCode: Optional[int] = Field(None, description="Environment code") | 
					
						
							|  |  |  |     expectedParallelismNumber: Optional[int] = Field(None, description="Expected parallelism number") | 
					
						
							|  |  |  |     dryRun: Optional[int] = Field(None, description="Dry run flag") | 
					
						
							|  |  |  |     scheduleTime: Optional[str] = Field(None, description="Schedule time")    | 
					
						
							|  |  |  | # class Schedule(BaseModel): | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  | #     startTime: Optional[datetime] = Field(default=None, description='更新时间') | 
					
						
							|  |  |  | #     endTime: Optional[datetime] = Field(default=None, description='更新时间') | 
					
						
							|  |  |  | #     crontab: Optional[str] = Field(default=None, description='更新时间') | 
					
						
							|  |  |  | #     timezoneId: Optional[str] = Field(default=None, description='更新时间') | 
					
						
							|  |  |  | class ParmSchedule(BaseModel): | 
					
						
							|  |  |  |     schedule: Optional[str]= Field(default=None, description='更新时间') | 
					
						
							|  |  |  |     failureStrategy: Optional[str] = Field(None, description="Failure strategy") | 
					
						
							|  |  |  |     warningType: Optional[str] = Field(None, description="Warning type") | 
					
						
							|  |  |  |     warningGroupId: Optional[int] = Field(None, description="Warning group ID") | 
					
						
							|  |  |  |     workerGroup: Optional[str] = Field(None, description="Worker group") | 
					
						
							|  |  |  |     environmentCode: Optional[int] = Field(None, description="Environment code") | 
					
						
							|  |  |  |     processInstancePriority: Optional[str] = Field(None, description="Process instance priority") | 
					
						
							|  |  |  |     processDefinitionCode: Optional[int] = Field(None, description="Process definition code") | 
					
						
							|  |  |  | class ParmScheduleVo(BaseModel): | 
					
						
							|  |  |  |     warningGroupId: Optional[int] = Field(None, description="Warning group ID") | 
					
						
							|  |  |  |     metaTaskId: Optional[int] = Field(None, description="metaTaskId") | 
					
						
							|  |  |  |     workerGroup: Optional[str] = Field(None, description="Worker group") | 
					
						
							|  |  |  |     environmentCode: Optional[int] = Field(None, description="Environment code") | 
					
						
							|  |  |  |     processDefinitionCode: Optional[int] = Field(None, description="Process definition code") | 
					
						
							|  |  |  |     crontab: Optional[str] = Field(default=None, description='更新时间') | 
					
						
							|  |  |  |     beginTime: Optional[datetime] = Field(default=None, description='更新时间') | 
					
						
							|  |  |  |     endTime: Optional[datetime] = Field(default=None, description='更新时间') | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ProcessInstancePage(BaseModel): | 
					
						
							|  |  |  |     searchVal: Optional[str] = Field(default=None,  description="Name of the task node") | 
					
						
							|  |  |  |     page_num: int = Field(default=1, description='当前页码') | 
					
						
							|  |  |  |     page_size: int = Field(default=10, description='每页记录数') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class TaskNode(BaseModel): | 
					
						
							|  |  |  |     id: int = Field(..., description="Unique identifier for the task node") | 
					
						
							|  |  |  |     name: Optional[str] = Field(None, description="Name of the task node") | 
					
						
							|  |  |  |     taskCode: Optional[int] = Field(None, description="Task code identifier") | 
					
						
							|  |  |  |     taskType: Optional[str] = Field(None, description="Type of the task") | 
					
						
							|  |  |  |     processInstanceId: Optional[int] = Field(None, description="Associated process instance ID") | 
					
						
							|  |  |  |     processInstanceName: Optional[str] = Field(None, description="Name of the associated process instance") | 
					
						
							|  |  |  |     startTime: Optional[datetime] = Field(None, description="Start time of the task") | 
					
						
							|  |  |  |     endTime: Optional[datetime] = Field(None, description="End time of the task") | 
					
						
							|  |  |  |     submitTime: Optional[datetime] = Field(None, description="Time when the task was submitted") | 
					
						
							|  |  |  |     firstSubmitTime: Optional[datetime] = Field(None, description="Time of the first task submission") | 
					
						
							|  |  |  |     executorId: Optional[int] = Field(None, description="Executor ID") | 
					
						
							|  |  |  |     host: Optional[str] = Field(None, description="Host where the task is executed") | 
					
						
							|  |  |  |     logPath: Optional[str] = Field(None, description="Log file path for the task execution") | 
					
						
							|  |  |  |     executePath: Optional[str] = Field(None, description="Execution path of the task") | 
					
						
							|  |  |  |     state: Optional[str] = Field(None, description="Current state of the task") | 
					
						
							|  |  |  |     duration: Optional[str] = Field(None, description="Duration of the task execution") | 
					
						
							|  |  |  |     dryRun: Optional[int] = Field(0, description="Indicates if the task is a dry run") | 
					
						
							|  |  |  |     alertFlag: Optional[str] = Field(None, description="Alert flag for task issues") | 
					
						
							|  |  |  |     blockingTask: Optional[bool] = Field(False, description="Indicates if the task is blocking other tasks") | 
					
						
							|  |  |  |     conditionsTask: Optional[bool] = Field(False, description="Indicates if the task has conditions") | 
					
						
							|  |  |  |     dependTask: Optional[bool] = Field(False, description="Indicates if the task is dependent on another task") | 
					
						
							|  |  |  |     cpuQuota: Optional[int] = Field(-1, description="CPU quota allocated for the task") | 
					
						
							|  |  |  |     memoryMax: Optional[int] = Field(-1, description="Maximum memory allocation for the task") | 
					
						
							|  |  |  |     flag: Optional[str] = Field(None, description="Task execution flag") | 
					
						
							|  |  |  |     maxRetryTimes: Optional[int] = Field(0, description="Maximum retry attempts for the task") | 
					
						
							|  |  |  |     retryInterval: Optional[int] = Field(1, description="Interval between retries") | 
					
						
							|  |  |  |     retryTimes: Optional[int] = Field(0, description="Number of retries attempted") | 
					
						
							|  |  |  |     subProcess: Optional[bool] = Field(False, description="Indicates if the task is a subprocess") | 
					
						
							|  |  |  |     switchTask: Optional[bool] = Field(False, description="Indicates if the task is a switch task") | 
					
						
							|  |  |  |     taskComplete: Optional[bool] = Field(True, description="Indicates if the task has completed execution") | 
					
						
							|  |  |  |     taskExecuteType: Optional[str] = Field(None, description="Execution type of the task") | 
					
						
							|  |  |  |     taskDefinitionVersion: Optional[int] = Field(None, description="Version of the task definition") | 
					
						
							|  |  |  |     taskGroupId: Optional[int] = Field(0, description="Group ID of the task") | 
					
						
							|  |  |  |     taskGroupPriority: Optional[int] = Field(0, description="Priority within the task group") | 
					
						
							|  |  |  |     taskInstancePriority: Optional[str] = Field(None, description="Priority of the task instance") | 
					
						
							|  |  |  |     taskParams: Optional[str] = Field(None, description="Parameters for the task execution") | 
					
						
							|  |  |  |     environmentCode: Optional[int] = Field(None, description="Environment code for the task") | 
					
						
							|  |  |  |     workerGroup: Optional[str] = Field(None, description="Worker group handling the task") | 
					
						
							|  |  |  |     varPool: Optional[str] = Field(None, description="Variable pool for the task execution") | 
					
						
							|  |  |  |     delayTime: Optional[int] = Field(0, description="Delay time for task execution") | 
					
						
							|  |  |  |     dependency: Optional[str] = Field(None, description="Task dependencies") | 
					
						
							|  |  |  |     dependentResult: Optional[str] = Field(None, description="Result of the task dependencies") | 
					
						
							|  |  |  |     switchDependency: Optional[str] = Field(None, description="Switch dependency") |