feat(accounts): add admin accounts and user preferences

Remove public registration, support administrator-managed accounts, and persist personal preferences.

Refs #2 #5

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 19:54:06 +01:00
parent 1b0625f91c
commit 50bde816ed
46 changed files with 1362 additions and 256 deletions

View File

@ -30,23 +30,24 @@ type UserAsset struct {
}
type Source struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Enabled bool `json:"enabled"`
CreatedAt time.Time `json:"created_at"`
ArticleLimit int `json:"article_limit"`
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Enabled bool `json:"enabled"`
CreatedAt time.Time `json:"created_at"`
}
type Article struct {
ID string `json:"id"`
SourceID string `json:"source_id"`
SourceName string `json:"source_name,omitempty"`
Title string `json:"title"`
Content string `json:"content"`
URL string `json:"url"`
PublishedAt sql.NullTime `json:"published_at"`
CreatedAt time.Time `json:"created_at"`
Symbols []string `json:"symbols,omitempty"`
ID string `json:"id"`
SourceID string `json:"source_id"`
SourceName string `json:"source_name,omitempty"`
Title string `json:"title"`
Content string `json:"content"`
URL string `json:"url"`
PublishedAt sql.NullTime `json:"published_at"`
CreatedAt time.Time `json:"created_at"`
Symbols []string `json:"symbols,omitempty"`
}
type ArticleSymbol struct {
@ -64,33 +65,33 @@ type ScrapeCredential struct {
}
type ScrapeJob struct {
ID string `json:"id"`
SourceID string `json:"source_id"`
SourceName string `json:"source_name,omitempty"`
Status string `json:"status"`
StartedAt sql.NullTime `json:"started_at"`
FinishedAt sql.NullTime `json:"finished_at"`
ArticlesFound int `json:"articles_found"`
ErrorMsg string `json:"error_msg"`
CreatedAt time.Time `json:"created_at"`
ID string `json:"id"`
SourceID string `json:"source_id"`
SourceName string `json:"source_name,omitempty"`
Status string `json:"status"`
StartedAt sql.NullTime `json:"started_at"`
FinishedAt sql.NullTime `json:"finished_at"`
ArticlesFound int `json:"articles_found"`
ErrorMsg string `json:"error_msg"`
CreatedAt time.Time `json:"created_at"`
}
type AIProvider struct {
ID string `json:"id"`
Name string `json:"name"`
APIKeyEncrypted string `json:"-"`
Model string `json:"model"`
Endpoint string `json:"endpoint"`
IsActive bool `json:"is_active"`
CreatedAt time.Time `json:"created_at"`
ID string `json:"id"`
Name string `json:"name"`
APIKeyEncrypted string `json:"-"`
Model string `json:"model"`
Endpoint string `json:"endpoint"`
IsActive bool `json:"is_active"`
CreatedAt time.Time `json:"created_at"`
}
type Summary struct {
ID string `json:"id"`
UserID string `json:"user_id"`
Content string `json:"content"`
AIProviderID *string `json:"ai_provider_id"`
GeneratedAt time.Time `json:"generated_at"`
ID string `json:"id"`
UserID string `json:"user_id"`
Content string `json:"content"`
AIProviderID *string `json:"ai_provider_id"`
GeneratedAt time.Time `json:"generated_at"`
}
type Setting struct {
@ -99,10 +100,10 @@ type Setting struct {
}
type ScheduleSlot struct {
ID string `json:"id"`
DayOfWeek int `json:"day_of_week"` // 0=dimanche, 1=lundi ... 6=samedi
Hour int `json:"hour"`
Minute int `json:"minute"`
ID string `json:"id"`
DayOfWeek int `json:"day_of_week"` // 0=dimanche, 1=lundi ... 6=samedi
Hour int `json:"hour"`
Minute int `json:"minute"`
}
type Report struct {