added full gifts support
This commit is contained in:
parent
ea5b86de8f
commit
354128c106
35 changed files with 1502 additions and 103 deletions
27
internal/store/gif_catalog.go
Normal file
27
internal/store/gif_catalog.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package store
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"telesrv/internal/domain"
|
||||
)
|
||||
|
||||
// GifCatalogStore owns the admin-curated GIF catalog the built-in @gif inline
|
||||
// bot serves as results for the client's GIF picker.
|
||||
type GifCatalogStore interface {
|
||||
// CreateGifCatalogEntry inserts a new entry. entry.ID must already be set
|
||||
// by the caller (same convention as documents/photos elsewhere in this
|
||||
// codebase -- ids are app-generated, not database-serial).
|
||||
CreateGifCatalogEntry(ctx context.Context, entry domain.GifCatalogEntry) (domain.GifCatalogEntry, error)
|
||||
// ListGifCatalog returns every entry ordered by (sort_order, id).
|
||||
// onlyEnabled=true is what @gif serves; the admin panel lists everything.
|
||||
ListGifCatalog(ctx context.Context, onlyEnabled bool) ([]domain.GifCatalogEntry, error)
|
||||
// SetGifCatalogEnabled toggles whether an entry is served. changed=false
|
||||
// if the id doesn't exist.
|
||||
SetGifCatalogEnabled(ctx context.Context, id int64, enabled bool) (bool, error)
|
||||
// SetGifCatalogSortOrder rewrites an entry's display position.
|
||||
SetGifCatalogSortOrder(ctx context.Context, id int64, order int) (bool, error)
|
||||
// DeleteGifCatalogEntry removes an entry. The referenced document is left
|
||||
// alone -- catalog membership, not the document itself, is what's deleted.
|
||||
DeleteGifCatalogEntry(ctx context.Context, id int64) (bool, error)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue