This commit is contained in:
2026-06-25 16:53:46 +08:00
39 changed files with 2943 additions and 866 deletions
@@ -110,6 +110,7 @@ async def async_batch_upload_material(
target_source_model = source_model_map.get(task.source_model)
# 检查资源id是否存在,非资源id
if target_source_model:
query = (
select(GeneratedResource.id)
@@ -133,6 +134,7 @@ async def async_batch_upload_material(
resource_ids_to_upload = valid_resource_ids
else:
#用户提交的直接是资源id
query = (
select(GeneratedResource.id)
.where(GeneratedResource.id.in_(task.resource_ids))
@@ -156,6 +158,11 @@ async def async_batch_upload_material(
for advertiser_id in task.advertiser_ids:
for resource_id in resource_ids_to_upload:
other_info = {}
if task.is_pre_test == "1":
other_info["is_pre_test"] = task.is_pre_test
other_info["pre_test_template"] = task.pre_test_template
task_id = generate_id()
upload_task = UploadTask(
id=task_id,
@@ -165,6 +172,7 @@ async def async_batch_upload_material(
resource_id=resource_id,
status=1,
note=None,
other_info=json.dumps(other_info) if other_info else None,
)
db.add(upload_task)
+6 -3
View File
@@ -86,7 +86,7 @@ async def juliang_callback(
await get_token(auth_code, user_id, app_id, db)
return {
"message": "授权成功,这里需要跳转页面路径到 /user-oauth/oauth_list",
"message": "授权成功",
"code": 0,
}
@@ -95,8 +95,11 @@ async def juliang_callback(
status_code=status.HTTP_400_BAD_REQUEST,
detail=str(e),
)
except HTTPException:
raise
except HTTPException as e:
raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail=f"授权失败: {str(e)}",
)
except Exception as e:
raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,