Add poll support

Currenlty only voting is possible.
This commit is contained in:
r 2020-02-09 13:42:16 +00:00
parent a68a09a83e
commit cfec7879e3
9 changed files with 182 additions and 39 deletions

View file

@ -42,6 +42,7 @@ type Service interface {
UnLike(ctx context.Context, c *model.Client, id string) (count int64, err error)
Retweet(ctx context.Context, c *model.Client, id string) (count int64, err error)
UnRetweet(ctx context.Context, c *model.Client, id string) (count int64, err error)
Vote(ctx context.Context, c *model.Client, id string, choices []string) (err error)
Follow(ctx context.Context, c *model.Client, id string) (err error)
UnFollow(ctx context.Context, c *model.Client, id string) (err error)
Mute(ctx context.Context, c *model.Client, id string) (err error)
@ -843,6 +844,15 @@ func (svc *service) UnRetweet(ctx context.Context, c *model.Client, id string) (
return
}
func (svc *service) Vote(ctx context.Context, c *model.Client, id string,
choices []string) (err error) {
_, err = c.Vote(ctx, id, choices)
if err != nil {
return
}
return
}
func (svc *service) Follow(ctx context.Context, c *model.Client, id string) (err error) {
_, err = c.AccountFollow(ctx, id)
return