feat(diary): Phase 1.3 完善修复 — 贴纸/主题 CRUD + 管理端对接 + HMS 清理
Some checks failed
Main Merge / backend (push) Has been cancelled
Main Merge / frontend (push) Has been cancelled

H7 贴纸 CRUD:
- POST /diary/sticker-packs — 创建贴纸包
- DELETE /diary/sticker-packs/:id — 软删除贴纸包
- POST /diary/sticker-packs/:id/stickers — 添加贴纸

H8 主题编辑/停用:
- PUT /diary/topics/:id — 编辑主题 (标题/描述/截止日期)
- PATCH /diary/topics/:id/deactivate — 停用主题

管理端前端:
- ClassList.tsx 对接 update/deactivate/reset-code (含 Popconfirm 确认)
- JournalList.tsx 班级筛选改用 classApi.listAll()
- classes.ts 新增 listAll/update/deactivate/resetCode API

M2 HMS 遗留清理:
- 删除 copilot.ts, healthFixtures.ts, healthHandlers.ts
- AuditLogViewer 资源类型 → 日记模块
- auth.test.ts / renderWithProviders health.* → diary.*

M4 编辑器加载:
- EditorPage journalId 非空时从 Isar 恢复笔画/元素/标签/心情/标题

77 tests passed, cargo check , tsc , flutter analyze 
This commit is contained in:
iven
2026-06-02 23:01:13 +08:00
parent 94bfb3297a
commit 8ea1032c9d
6 changed files with 470 additions and 8 deletions

View File

@@ -189,6 +189,51 @@ pub struct CreateCommentReq {
pub content: String,
}
/// 更新主题请求
#[derive(Debug, Deserialize, ToSchema)]
pub struct UpdateTopicReq {
/// 主题标题
pub title: Option<String>,
/// 主题描述
pub description: Option<String>,
/// 截止日期
pub due_date: Option<chrono::NaiveDate>,
/// 乐观锁版本号
pub version: i32,
}
/// 创建贴纸包请求
#[derive(Debug, Deserialize, ToSchema)]
pub struct CreateStickerPackReq {
/// 贴纸包名称
pub name: String,
/// 描述
pub description: Option<String>,
/// 缩略图 URL
pub thumbnail_url: Option<String>,
/// 是否免费
#[serde(default = "default_true")]
pub is_free: bool,
/// 价格(积分)
#[serde(default)]
pub price: i32,
/// 分类
pub category: Option<String>,
}
fn default_true() -> bool { true }
/// 创建贴纸请求
#[derive(Debug, Deserialize, ToSchema)]
pub struct CreateStickerReq {
/// 贴纸名称
pub name: String,
/// 图片 URL
pub image_url: String,
/// 分类
pub category: Option<String>,
}
/// 评语响应
#[derive(Debug, Serialize, ToSchema)]
pub struct CommentResp {