📄 Lectures: backend для раздела «Обучение»

Новое:
- Таблица lectures (PDF/HTML, привязка к уровню, скачивание)
- routers/lectures.py — 6 эндпоинтов:
  - GET  /learning/lectures?level=A1 — список
  - GET  /learning/lecture/{id} — метаданные
  - GET  /learning/lecture/{id}/download — скачать файл
  - POST /admin/lectures/upload — загрузить (multipart)
  - PUT  /admin/lectures/{id} — редактировать
  - DELETE /admin/lectures/{id} — удалить
- Регистрация роутера в main.py
- Миграция в database.py::init_db()

Проверено: GET /learning/lectures → 200, {level:A1, lectures:[]}
This commit is contained in:
2026-09-26 16:46:29 +00:00
parent d6231b7b0f
commit f7859783d3
3 changed files with 370 additions and 0 deletions
+2
View File
@@ -14,6 +14,7 @@ from fastapi.staticfiles import StaticFiles
from config import FRONTEND_ORIGIN, UPLOADS_DIR, CF_IPS
from database import init_db
from routers import users, game, hints, leaderboard, sentences, achievements, wordquiz, bubblewords, pronunciation, assistant, learning, tts, typing, teacher, support, admin, feed, admin_content
from routers import lectures
from routers.sentences import init_sentences
from routers.achievements import init_achievements
from routers.learning_data import init_learning_data
@@ -359,6 +360,7 @@ app.include_router(support.router)
app.include_router(admin.router)
app.include_router(feed.router)
app.include_router(admin_content.router)
app.include_router(lectures.router)
# ============ Базовые эндпоинты ============