-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparam.go
130 lines (116 loc) · 5.58 KB
/
param.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
package nagato
type idParam struct {
ID int `validate:"gt=0"`
}
type usernameParam struct {
Username string `validate:"required" mod:"trim,default=@me"`
}
// GetAnimeListParam is get anime list param model.
type GetAnimeListParam struct {
Query string `validate:"required,gte=3,lte=64" mod:"trim"`
NSFW bool ``
Limit int `validate:"gt=0,lte=100" mod:"default=100"`
Offset int `validate:"gte=0"`
}
// GetAnimeRankingParam is get anime ranking param.
type GetAnimeRankingParam struct {
RankingType RankingType `validate:"oneof=all airing upcoming tv ova movie special bypopularity favorite" mod:"trim,default=all"`
NSFW bool ``
Limit int `validate:"gt=0,lte=500" mod:"default=100"`
Offset int `validate:"gte=0"`
}
// GetSeasonalAnimeParam is get seasonal anime param.
type GetSeasonalAnimeParam struct {
Year int `validate:"gt=0"`
Season SeasonType `validate:"required,oneof=winter spring summer fall" mod:"trim"`
NSFW bool ``
Sort SeasonalAnimeSortType `validate:"oneof=anime_num_list_users anime_score" mod:"trim,default=anime_num_list_users"`
Limit int `validate:"gt=0,lte=500" mod:"default=100"`
Offset int `validate:"gte=0"`
}
// GetSuggestedAnimeParam is get suggested anime param.
type GetSuggestedAnimeParam struct {
NSFW bool ``
Limit int `validate:"gt=0,lte=100" mod:"default=100"`
Offset int `validate:"gte=0"`
}
// GetMangaListParam is get manga list param model.
type GetMangaListParam struct {
Query string `validate:"required,gte=3,lte=64" mod:"trim"`
NSFW bool ``
Limit int `validate:"gt=0,lte=100" mod:"default=100"`
Offset int `validate:"gte=0"`
}
// GetMangaRankingParam is get manga ranking param.
type GetMangaRankingParam struct {
RankingType RankingType `validate:"oneof=all manga novels oneshots doujin manhwa manhua bypopularity favorite" mod:"trim,default=all"`
NSFW bool ``
Limit int `validate:"gt=0,lte=500" mod:"default=100"`
Offset int `validate:"gte=0"`
}
// GetUserAnimeListParam is get user anime list param.
type GetUserAnimeListParam struct {
Username string `validate:"required,gte=3,lte=64" mod:"trim"`
Status UserAnimeStatusType `validate:"oneof='' watching completed on_hold dropped plan_to_watch" mod:"trim"`
NSFW bool ``
Sort UserAnimeSortType `validate:"oneof=list_score list_updated_at anime_title anime_start_date anime_id" mod:"trim,default=anime_title"`
Limit int `validate:"gt=0,lte=1000" mod:"default=100"`
Offset int `validate:"gte=0"`
}
// GetUserMangaListParam is get user manga list param.
type GetUserMangaListParam struct {
Username string `validate:"required,gte=3,lte=64" mod:"trim"`
Status UserMangaStatusType `validate:"oneof='' reading completed on_hold dropped plan_to_read" mod:"trim"`
NSFW bool ``
Sort UserMangaSortType `validate:"oneof=list_score list_updated_at manga_title manga_start_date manga_id" mod:"trim,default=manga_title"`
Limit int `validate:"gt=0,lte=1000" mod:"default=100"`
Offset int `validate:"gte=0"`
}
// UpdateMyAnimeListStatusParam is update my anime list status param.
type UpdateMyAnimeListStatusParam struct {
ID int `validate:"required,gt=0"`
Status UserAnimeStatusType `validate:"oneof='' watching completed on_hold dropped plan_to_watch" mod:"trim,default=plan_to_watch"`
IsRewatching bool ``
Score int `validate:"gte=0,lte=10"`
Episode int `validate:"gte=0"`
Priority PriorityType `validate:"gte=0,lte=2"`
RewatchedTimes int `validate:"gte=0"`
RewatchValue RewatchValueType `validate:"gte=0,lte=5"`
Tags []string ``
Comment string `mod:"trim"`
StartDate Date ``
FinishDate Date ``
}
// UpdateMyMangaListStatusParam is update my manga list status param.
type UpdateMyMangaListStatusParam struct {
ID int `validate:"required,gt=0"`
Status UserMangaStatusType `validate:"oneof='' reading completed on_hold dropped plan_to_read" mod:"trim,default=plan_to_read"`
IsRereading bool ``
Score int `validate:"gte=0,lte=10"`
Volume int `validate:"gte=0"`
Chapter int `validate:"gte=0"`
Priority PriorityType `validate:"gte=0,lte=2"`
RereadTimes int `validate:"gte=0"`
RereadValue RereadValueType `validate:"gte=0,lte=5"`
Tags []string ``
Comment string `mod:"trim"`
StartDate Date ``
FinishDate Date ``
}
// GetForumTopicsParam is get forum topics param.
type GetForumTopicsParam struct {
BoardID int `validate:"gte=0"`
SubboardID int `validate:"gte=0"`
Query string `mod:"trim"`
TopicUsername string `mod:"trim"`
Username string `mod:"trim"`
Sort ForumTopicSortType `validate:"oneof=recent" mod:"trim,default=recent"`
Limit int `validate:"gt=0,lte=100" mod:"default=100"`
Offset int `validate:"gte=0"`
}
// GetForumTopicDetailsParam is get forum topic details param.
type GetForumTopicDetailsParam struct {
ID int `validate:"gt=0"`
Limit int `validate:"gt=0,lte=100" mod:"default=100"`
Offset int `validate:"gte=0"`
}