format code

This commit is contained in:
2025-04-16 09:38:48 +08:00
parent 455af11120
commit 619309e345
15 changed files with 686 additions and 353 deletions

View File

@@ -1,8 +1,9 @@
import json
import os
from pymongo import MongoClient
import json
# 连接到 MongoDB
client = MongoClient('mongodb://root:lostecho@192.168.31.3:27017/')
# 选择数据库
@@ -32,6 +33,7 @@ def insert_course_content(file_path):
except Exception as e:
print(f"错误:处理文件 {file_path} 时出现未知错误:{e}")
def get_course_content(id_to_query):
try:
@@ -53,4 +55,4 @@ def get_course_content(id_to_query):
else:
print(f"未找到 _id 为 {id_to_query} 的文档。")
except Exception as e:
print(f"错误:查询或处理数据时出现未知错误:{e}")
print(f"错误:查询或处理数据时出现未知错误:{e}")