feat(user-preferences): implement user preferences management with backend support

Added functionality for managing user preferences, including the ability to update preferences via a new API endpoint. The preferences are now stored server-side, allowing for synchronization across devices. Updated relevant components to handle user preferences, including the UserMenu and settings views. Enhanced internationalization support for error messages related to preference updates.
This commit is contained in:
wizardchen
2026-05-18 11:21:55 +08:00
committed by lyingbug
parent 3226cb97ff
commit 68ac7fb973
20 changed files with 301 additions and 24 deletions
+4
View File
@@ -222,6 +222,10 @@ CREATE TABLE IF NOT EXISTS users (
tenant_id INTEGER,
is_active BOOLEAN NOT NULL DEFAULT 1,
can_access_all_tenants BOOLEAN NOT NULL DEFAULT 0,
-- Per-user JSON preferences (memory toggle, future UI knobs).
-- SQLite has no JSONB; store as TEXT and let GORM (de)serialise via
-- the driver.Valuer / sql.Scanner methods on types.UserPreferences.
preferences TEXT NOT NULL DEFAULT '{}',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
deleted_at DATETIME