1717
1818
1919@router .get ('/all' , summary = '获取所有任务调度' , dependencies = [DependsJwtAuth ])
20- async def get_all_task_schedulers () -> ResponseModel :
20+ async def get_all_task_schedulers () -> ResponseSchemaModel [ list [ GetTaskSchedulerDetail ]] :
2121 schedulers = await task_scheduler_service .get_all ()
2222 return response_base .success (data = schedulers )
2323
2424
2525@router .get ('/{pk}' , summary = '获取任务调度详情' , dependencies = [DependsJwtAuth ])
26- async def get_task_scheduler (pk : Annotated [int , Path (description = '任务调度 ID' )]):
26+ async def get_task_scheduler (
27+ pk : Annotated [int , Path (description = '任务调度 ID' )],
28+ ) -> ResponseSchemaModel [GetTaskSchedulerDetail ]:
2729 task_scheduler = await task_scheduler_service .get (pk = pk )
2830 return response_base .success (data = task_scheduler )
2931
@@ -54,7 +56,7 @@ async def get_task_scheduler_paged(
5456 DependsRBAC ,
5557 ],
5658)
57- async def create_task_scheduler (obj : CreateTaskSchedulerParam ):
59+ async def create_task_scheduler (obj : CreateTaskSchedulerParam ) -> ResponseModel :
5860 await task_scheduler_service .create (obj = obj )
5961 return response_base .success ()
6062
@@ -67,7 +69,9 @@ async def create_task_scheduler(obj: CreateTaskSchedulerParam):
6769 DependsRBAC ,
6870 ],
6971)
70- async def update_task_scheduler (pk : Annotated [int , Path (description = '任务调度 ID' )], obj : UpdateTaskSchedulerParam ):
72+ async def update_task_scheduler (
73+ pk : Annotated [int , Path (description = '任务调度 ID' )], obj : UpdateTaskSchedulerParam
74+ ) -> ResponseModel :
7175 count = await task_scheduler_service .update (pk = pk , obj = obj )
7276 if count > 0 :
7377 return response_base .success ()
@@ -82,7 +86,7 @@ async def update_task_scheduler(pk: Annotated[int, Path(description='任务调
8286 DependsRBAC ,
8387 ],
8488)
85- async def update_task_scheduler_status (pk : Annotated [int , Path (description = '任务调度 ID' )]):
89+ async def update_task_scheduler_status (pk : Annotated [int , Path (description = '任务调度 ID' )]) -> ResponseModel :
8690 count = await task_scheduler_service .update_status (pk = pk )
8791 if count > 0 :
8892 return response_base .success ()
@@ -97,7 +101,7 @@ async def update_task_scheduler_status(pk: Annotated[int, Path(description='任
97101 DependsRBAC ,
98102 ],
99103)
100- async def delete_task_scheduler (pk : Annotated [int , Path (description = '任务调度 ID' )]):
104+ async def delete_task_scheduler (pk : Annotated [int , Path (description = '任务调度 ID' )]) -> ResponseModel :
101105 count = await task_scheduler_service .delete (pk = pk )
102106 if count > 0 :
103107 return response_base .success ()
@@ -112,7 +116,7 @@ async def delete_task_scheduler(pk: Annotated[int, Path(description='任务调
112116 DependsRBAC ,
113117 ],
114118)
115- async def execute_task (pk : Annotated [int , Path (description = '任务调度 ID' )]) -> ResponseSchemaModel [ str ] :
119+ async def execute_task (pk : Annotated [int , Path (description = '任务调度 ID' )]) -> ResponseModel :
116120 await task_scheduler_service .execute (pk = pk )
117121 return response_base .success ()
118122
0 commit comments