[chore] Add interaction policy gtsmodels (#3075)

* [chore] introduce interaction policy gts models

* update migration a smidge

* fix copy paste typo

* update migration

* use int for InteractionType
This commit is contained in:
tobi 2024-07-11 16:44:29 +02:00 committed by GitHub
commit 5bc567196b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
46 changed files with 1318 additions and 531 deletions

View file

@ -27,9 +27,12 @@ type StatusFave interface {
// GetStatusFaveByAccountID gets one status fave created by the given accountID, targeting the given statusID.
GetStatusFave(ctx context.Context, accountID string, statusID string) (*gtsmodel.StatusFave, error)
// GetStatusFave returns one status fave with the given id.
// GetStatusFaveByID returns one status fave with the given id.
GetStatusFaveByID(ctx context.Context, id string) (*gtsmodel.StatusFave, error)
// GetStatusFaveByURI returns one status fave with the given uri.
GetStatusFaveByURI(ctx context.Context, uri string) (*gtsmodel.StatusFave, error)
// GetStatusFaves returns a slice of faves/likes of the status with given ID.
// This slice will be unfiltered, not taking account of blocks and whatnot, so filter it before serving it back to a user.
GetStatusFaves(ctx context.Context, statusID string) ([]*gtsmodel.StatusFave, error)
@ -40,6 +43,9 @@ type StatusFave interface {
// PutStatusFave inserts the given statusFave into the database.
PutStatusFave(ctx context.Context, statusFave *gtsmodel.StatusFave) error
// UpdateStatusFave updates one statusFave in the database.
UpdateStatusFave(ctx context.Context, statusFave *gtsmodel.StatusFave, columns ...string) error
// DeleteStatusFave deletes one status fave with the given id.
DeleteStatusFaveByID(ctx context.Context, id string) error