29 lines
769 B
Go
29 lines
769 B
Go
package status
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.pengzhan.dev/haopengzhan/rsspipe/internal/models"
|
|
"git.pengzhan.dev/haopengzhan/rsspipe/internal/worker"
|
|
)
|
|
|
|
// NewMarkReadHandler marks an entry as read.
|
|
func NewMarkReadHandler() worker.ActionHandler {
|
|
return func(ctx context.Context, entry models.FeedEntry, params map[string]interface{}) (*worker.ActionResult, error) {
|
|
trueVal := true
|
|
return &worker.ActionResult{
|
|
MarkRead: &trueVal,
|
|
}, nil
|
|
}
|
|
}
|
|
|
|
// NewMarkStarredHandler marks an entry as starred.
|
|
func NewMarkStarredHandler() worker.ActionHandler {
|
|
return func(ctx context.Context, entry models.FeedEntry, params map[string]interface{}) (*worker.ActionResult, error) {
|
|
trueVal := true
|
|
return &worker.ActionResult{
|
|
MarkStarred: &trueVal,
|
|
}, nil
|
|
}
|
|
}
|