- Neue Spalte 'settings' in users-Tabelle (Migration via TryAddColumn) - SettingsEndpoint: GET/PUT /api/settings - DatabaseService: GetUserSettings() + UpdateUserSettings() - Frontend: currentSettings als globaler State in app.js - settings-page.js: localStorage komplett entfernt, nutzt API - Settings werden beim App-Start aus DB geladen und angewendet
25 lines
717 B
C#
25 lines
717 B
C#
namespace Gott.Models;
|
|
|
|
public class UserRecord
|
|
{
|
|
public int Id { get; set; }
|
|
public string UserId { get; set; }
|
|
public string Username { get; set; }
|
|
public string PasswordHash { get; set; }
|
|
public string DisplayName { get; set; }
|
|
public string CreatedAt { get; set; }
|
|
public string UpdatedAt { get; set; }
|
|
public bool IsAdmin { get; set; }
|
|
public string Persona { get; set; }
|
|
public string Settings { get; set; }
|
|
|
|
public string GetEffectivePersona()
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(Persona))
|
|
return Persona;
|
|
|
|
var name = !string.IsNullOrWhiteSpace(DisplayName) ? DisplayName : Username;
|
|
return $"Mein Name ist **{name}**.";
|
|
}
|
|
}
|