feat(imggen): фон питомца, обложки курсов, аватары и доска через ИИ
Питомец: кастомный фон (миграция 068 pet_bg_custom, POST /api/pet/bg/custom, карточка «Свой фон (ИИ)» в гардеробной, применение картинкой). Курсы: обложка-картинка (миграция 069 cover_image, генерация в модалке редактирования, рендер вместо эмодзи). Аватар: кнопка «Сгенерировать (ИИ)» в загрузке → кадрирование → модерация. Доска (classroom): кнопка-инструмент «Сгенерировать картинку (ИИ)». Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,7 @@ function courseRow(row) {
|
||||
title: row.title,
|
||||
description: row.description || '',
|
||||
coverEmoji: row.cover_emoji,
|
||||
coverImage: row.cover_image || null,
|
||||
orderIndex: row.order_index,
|
||||
isPublished: row.is_published === 1,
|
||||
createdBy: row.created_by,
|
||||
@@ -403,14 +404,15 @@ function duplicate(req, res) {
|
||||
function update(req, res) {
|
||||
const row = db.prepare('SELECT * FROM courses WHERE id = ?').get(req.params.id);
|
||||
if (!row) return res.status(404).json({ error: 'Course not found' });
|
||||
const { title, description, coverEmoji, orderIndex, isPublished, subjectSlug } = req.body;
|
||||
const { title, description, coverEmoji, coverImage, orderIndex, isPublished, subjectSlug } = req.body;
|
||||
|
||||
db.prepare(`
|
||||
UPDATE courses SET title=?,description=?,cover_emoji=?,order_index=?,is_published=?,subject_slug=? WHERE id=?
|
||||
UPDATE courses SET title=?,description=?,cover_emoji=?,cover_image=?,order_index=?,is_published=?,subject_slug=? WHERE id=?
|
||||
`).run(
|
||||
title ?? row.title,
|
||||
description !== undefined ? description : row.description,
|
||||
coverEmoji ?? row.cover_emoji,
|
||||
coverImage !== undefined ? (coverImage || null) : row.cover_image,
|
||||
orderIndex ?? row.order_index,
|
||||
isPublished !== undefined ? (isPublished ? 1 : 0) : row.is_published,
|
||||
subjectSlug ?? row.subject_slug,
|
||||
|
||||
Reference in New Issue
Block a user