Files
study-agent-service/service/exam_service.py
2026-08-03 22:43:09 +08:00

19 lines
440 B
Python

from sqlalchemy.ext.asyncio import AsyncSession
from models.library import ExamRecord
from schemas.exam import ExamRecordRequest
async def add_record(db: AsyncSession, data: ExamRecordRequest) -> bool:
record = ExamRecord(
subject=data.subject,
total_count=data.totalCount,
correct_count=data.correctCount,
wrong_count=data.wrongCount,
)
db.add(record)
await db.commit()
return True