Commit 6d17b883 authored by uuo00_n's avatar uuo00_n

chore: 更新.env文件中的数据库配置

将生产环境数据库配置注释掉,启用本地开发环境配置
修改数据库名称为llm_filter_db
parent e13c1477
# 数据库配置
# 注意:生产环境请通过安全的环境变量管理传递凭据,避免将敏感信息提交到版本库
MONGODB_URL=mongodb://llm:fSjFMwyShmcH4GdR@datacenter.dldzxx.cn:27017/llm?authSource=llm
# MONGODB_URL=mongodb://localhost:27017/
DB_NAME=llm
# MONGODB_URL=mongodb://llm:fSjFMwyShmcH4GdR@datacenter.dldzxx.cn:27017/llm?authSource=llm
MONGODB_URL=mongodb://localhost:27017/
DB_NAME=llm_filter_db
# JWT配置
SECRET_KEY=your_secret_key_here
......
......@@ -196,9 +196,18 @@ async def homeroom_current_summary(current_user: Dict[str, Any]) -> Dict[str, An
weekday = await _weekday()
period = await _current_period()
current_lesson_id = f"W{weekday}-P{period}"
uid = ObjectId(current_user["_id"])
# 获取当前用户的教师绑定信息
binding = await _get_primary_binding(current_user["_id"])
if binding.get("type") != "teacher":
raise HTTPException(status_code=403, detail="当前绑定非教师")
teacher = await _get_teacher_entity(current_user["_id"], binding)
teacher_person_id = teacher.get("person_id")
classes = []
cursor = db.db.classes.find({"head_teacher_person_id": uid})
# 使用 person_id 查询班级
cursor = db.db.classes.find({"head_teacher_person_id": teacher_person_id})
async for c in cursor:
classes.append(c)
class_ids = [c.get("class_id") for c in classes]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment