feat: redeem items support optional duration (permanent/timed)
- Add duration_minutes column to redeem_items (0 = permanent) - Backend: update RedeemItem/RedeemItemWrite structs, all CRUD SQL - Backend: EnsureColumn migration for existing databases - Frontend: add duration selector dropdown (永久/15min/30min/1h/2h/3h/custom) - Frontend: show ♾️ Permanent or ⏱️ duration in item list Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
这个提交包含在:
@@ -524,6 +524,7 @@ CREATE TABLE IF NOT EXISTS redeem_items (
|
||||
unit_label TEXT NOT NULL DEFAULT "小时",
|
||||
holiday_cost INTEGER NOT NULL DEFAULT 5,
|
||||
studyday_cost INTEGER NOT NULL DEFAULT 25,
|
||||
duration_minutes INTEGER NOT NULL DEFAULT 0,
|
||||
is_active INTEGER NOT NULL DEFAULT 1,
|
||||
is_global INTEGER NOT NULL DEFAULT 1,
|
||||
created_by INTEGER NOT NULL DEFAULT 0,
|
||||
@@ -594,6 +595,8 @@ CREATE TABLE IF NOT EXISTS daily_task_logs (
|
||||
EnsureColumn(db, "problem_solutions", "complexity",
|
||||
"complexity TEXT NOT NULL DEFAULT ''");
|
||||
EnsureColumn(db, "problem_solutions", "tags_json", "tags_json TEXT NOT NULL DEFAULT '[]'");
|
||||
EnsureColumn(db, "redeem_items", "duration_minutes",
|
||||
"duration_minutes INTEGER NOT NULL DEFAULT 0");
|
||||
|
||||
// Build indexes after compatibility ALTERs so old schemas won't fail on
|
||||
// missing columns (e.g. legacy submissions table without contest_id).
|
||||
|
||||
在新工单中引用
屏蔽一个用户