categorisation for gifs

This commit is contained in:
onysd 2026-08-24 23:09:08 +03:00
parent 5e18bd3830
commit d0669bdc5e
15 changed files with 468 additions and 49 deletions

View file

@ -290,13 +290,14 @@ type GifCatalogRow struct {
DocumentID int64 `json:"DocumentID,string"`
Enabled bool
SortOrder int
Category string
CreatedBy string
CreatedAt time.Time
}
func (s *readStore) ListGifCatalog(ctx context.Context) ([]GifCatalogRow, error) {
rows, err := s.pool.Query(ctx, `
SELECT id, title, document_id, enabled, sort_order, created_by, created_at
SELECT id, title, document_id, enabled, sort_order, category, created_by, created_at
FROM gif_catalog
ORDER BY sort_order, id`)
if err != nil {
@ -306,7 +307,7 @@ ORDER BY sort_order, id`)
out := make([]GifCatalogRow, 0)
for rows.Next() {
var item GifCatalogRow
if err := rows.Scan(&item.ID, &item.Title, &item.DocumentID, &item.Enabled, &item.SortOrder, &item.CreatedBy, &item.CreatedAt); err != nil {
if err := rows.Scan(&item.ID, &item.Title, &item.DocumentID, &item.Enabled, &item.SortOrder, &item.Category, &item.CreatedBy, &item.CreatedAt); err != nil {
return nil, err
}
out = append(out, item)