refactor(backend): 重构后端异常处理和模型管理

- 新增自定义异常类 BizException、NoteError 和 ProviderError
- 优化了模型管理相关的逻辑,包括加载、删除和测试连接等功能
- 改进了 Douyin 下载器的错误处理
- 调整了任务重试逻辑和笔记生成的异常处理- 更新了相关组件和页面以适应新的异常处理机制
This commit is contained in:
JefferyHcool
2025-06-06 21:30:23 +08:00
parent df5c0f771a
commit 8b1bc54f2d
34 changed files with 661 additions and 660 deletions

View File

@@ -31,10 +31,9 @@ def delete_model(model_id: int):
return R.error(f"删除模型失败: {e}")
@router.get("/model_list/{provider_id}")
def model_list(provider_id):
try:
return R.success(modelService.get_all_models_by_id(provider_id))
except Exception as e:
return R.error(e)
return R.success(modelService.get_all_models_by_id(provider_id))
@router.post("/models")
def create_model(data: CreateModelRequest):