feat: Sites feature backend

This commit is contained in:
Florian Sylvain committed 2026-10-14 03:56:50 +02:00
1 parent 45fcbd890d
commit a11338094e
98 files changed
+5365 -214

No files matched your search

+1
View File
@@ -30,6 +30,7 @@ type Article struct {
Title string `json:"title"`
Body string `json:"body"`
IsOnline bool `json:"is_online"`
SiteID uint32 `json:"site_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
@@ -30,6 +30,7 @@ func DefaultSort() Sort {
type Filters struct {
IsOnline *bool
SiteID *uint32
Page int
Size int
Q string
@@ -37,6 +38,11 @@ type Filters struct {
Sort Sort
}
type Update struct {
Body *string
SiteID *uint32
}
type Counts struct {
All int `json:"all"`
Online int `json:"online"`
@@ -57,6 +63,7 @@ type Repository interface {
GetAll() []Article
Create(post Article) (Article, error)
UpdateBody(id uint32, body string) (Article, error)
Update(id uint32, update Update) (Article, error)
UpdateIsOnline(id uint32, isOnline bool) (Article, error)
Delete(id uint32) error
FindByBodyContaining(filename string) ([]Article, error)