reaction.go 797 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package store
  2. import (
  3. "context"
  4. )
  5. type Reaction struct {
  6. ID int32
  7. CreatedTs int64
  8. CreatorID int32
  9. // ContentID is the id of the content that the reaction is for.
  10. // This can be a memo. e.g. memos/101
  11. ContentID string
  12. ReactionType string
  13. }
  14. type FindReaction struct {
  15. ID *int32
  16. CreatorID *int32
  17. ContentID *string
  18. }
  19. type DeleteReaction struct {
  20. ID int32
  21. }
  22. func (s *Store) UpsertReaction(ctx context.Context, upsert *Reaction) (*Reaction, error) {
  23. return s.driver.UpsertReaction(ctx, upsert)
  24. }
  25. func (s *Store) ListReactions(ctx context.Context, find *FindReaction) ([]*Reaction, error) {
  26. return s.driver.ListReactions(ctx, find)
  27. }
  28. func (s *Store) DeleteReaction(ctx context.Context, delete *DeleteReaction) error {
  29. return s.driver.DeleteReaction(ctx, delete)
  30. }