This repository has been archived by the owner on May 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusers.go
71 lines (61 loc) · 1.79 KB
/
users.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package shikimori
import (
"context"
"strconv"
"time"
)
type User struct {
ID int `json:"id"`
Nickname string `json:"nickname"`
Avatar string `json:"avatar"`
Image UserImage `json:"image"`
LastOnlineAt time.Time `json:"last_online_at"`
URL string `json:"url"`
}
type UserImage struct {
X160 string `json:"x160"`
X148 string `json:"x148"`
X80 string `json:"x80"`
X64 string `json:"x64"`
X48 string `json:"x48"`
X32 string `json:"x32"`
X16 string `json:"x16"`
}
type UsersAnimeRate struct {
ID int `json:"id"`
Score int `json:"score"`
Status string `json:"status"`
Text *string `json:"text,omitempty"`
Episodes *int `json:"episodes,omitempty"`
Chapters *int `json:"chapters,omitempty"`
Volumes *int `json:"volumes,omitempty"`
TextHTML string `json:"text_html"`
Rewatches int `json:"rewatches"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
User User `json:"user"`
Anime *Anime `json:"anime,omitempty"`
// Can represent Manga and Ranobe structs
Manga *interface{} `json:"manga,omitempty"`
}
type UsersAnimeRateParams struct {
// необязательно
// Validations:
//
// Must be a number between 1 and 100000.
Page int `json:"page,omitempty"`
// необязательно
// 5000 maximum
//
// Validations:
Limit int `json:"limit,omitempty"`
Status UserRateStatus `json:"status,omitempty"`
// Set to true to discard hentai, yaoi and yuri
Censored bool `json:"censored,omitempty"`
}
func (s *API) UsersAnimeRates(
ctx context.Context, id int, params *UsersAnimeRateParams,
) (resp []UsersAnimeRate, err error) {
err = s.get(ctx, &resp, "users/"+strconv.Itoa(id)+"/anime_rates", params)
return
}