2021-09-25 16:56:01 +00:00
|
|
|
package domain
|
|
|
|
|
|
|
|
import "context"
|
|
|
|
|
|
|
|
type Watcher struct {
|
2021-09-25 18:02:00 +00:00
|
|
|
ID int64
|
|
|
|
CreatedAt float64
|
2021-09-25 16:56:01 +00:00
|
|
|
|
|
|
|
DeviceID int64
|
|
|
|
AccountID int64
|
|
|
|
SubredditID int64
|
|
|
|
|
|
|
|
Upvotes int64
|
|
|
|
Keyword string
|
|
|
|
Flair string
|
|
|
|
Domain string
|
2021-09-25 18:27:58 +00:00
|
|
|
Hits int64
|
2021-09-25 16:56:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type WatcherRepository interface {
|
|
|
|
GetByID(ctx context.Context, id int64) (Watcher, error)
|
|
|
|
GetBySubredditID(ctx context.Context, id int64) ([]Watcher, error)
|
2021-09-25 18:17:23 +00:00
|
|
|
GetByDeviceAPNSTokenAndAccountRedditID(ctx context.Context, apns string, rid string) ([]Watcher, error)
|
2021-09-25 16:56:01 +00:00
|
|
|
|
|
|
|
Create(ctx context.Context, watcher *Watcher) error
|
|
|
|
Update(ctx context.Context, watcher *Watcher) error
|
2021-09-25 18:27:58 +00:00
|
|
|
IncrementHits(ctx context.Context, id int64) error
|
2021-09-25 16:56:01 +00:00
|
|
|
Delete(ctx context.Context, id int64) error
|
|
|
|
}
|