@@ -192,7 +192,7 @@ async def delete_model(
192192 session .commit ()
193193
194194
195- @router .get ("/{id}/ws_mapping" , response_model = List [int ], summary = f"{ PLACEHOLDER_PREFIX } system_model_query" ,
195+ @router .get ("/{id}/ws_mapping" , response_model = List [str ], summary = f"{ PLACEHOLDER_PREFIX } system_model_query" ,
196196 description = f"{ PLACEHOLDER_PREFIX } system_model_query" )
197197@require_permissions (permission = SqlbotPermission (role = ['admin' ]))
198198async def get_model_ws_mapping_by_id (
@@ -211,21 +211,21 @@ async def get_model_ws_mapping_by_id(
211211 )
212212 ws_ids : List [int ] = session .exec (stmt ).all ()
213213
214- return ws_ids
214+ return [ str ( ws_id ) for ws_id in ws_ids ]
215215
216216
217- @router .put ("/{id}/ws_mapping" , response_model = List [int ], summary = f"{ PLACEHOLDER_PREFIX } system_model_query" ,
217+ @router .put ("/{id}/ws_mapping" , response_model = List [str ], summary = f"{ PLACEHOLDER_PREFIX } system_model_query" ,
218218 description = f"{ PLACEHOLDER_PREFIX } system_model_query" )
219219@require_permissions (permission = SqlbotPermission (role = ['admin' ]))
220220async def update_model_ws_mapping_by_id (
221221 session : SessionDep ,
222222 id : int = Path (description = "ID" ),
223- ws_ids : List [int ] = Body (description = "workspace id list" ),
223+ ws_ids : List [str ] = Body (description = "workspace id list" ),
224224):
225225 if ws_ids is None :
226226 ws_ids = []
227227 # 提前去重
228- ws_ids = list (set ( ws_ids ) )
228+ ws_ids = list ({ int ( ws_id ) for ws_id in ws_ids } )
229229
230230 db_model = session .get (AiModelDetail , id )
231231 if not db_model :
@@ -246,7 +246,7 @@ async def update_model_ws_mapping_by_id(
246246
247247 session .commit ()
248248
249- return ws_ids
249+ return [ str ( ws_id ) for ws_id in ws_ids ]
250250
251251
252252@router .get ("/list_by_ws" , response_model = AiModelBrief , summary = f"{ PLACEHOLDER_PREFIX } system_model_query" ,
0 commit comments