forked from niuhuan/pica-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdto.go
492 lines (431 loc) · 11.8 KB
/
dto.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
package pica
import "time"
// Response 返回体格式
type Response struct {
Code int `json:"code"`
Error string `json:"error"`
Message string `json:"message"`
Detail string `json:"detail"`
}
// PageData 分页格式
type PageData struct {
Total int `json:"total"`
Limit int `json:"limit"`
Page int `json:"page"`
Pages int `json:"pages"`
}
// Image 图片资源
type Image struct {
OriginalName string `json:"originalName"`
Path string `json:"path"`
FileServer string `json:"fileServer"`
}
// RegisterDto 注册接口请求体
type RegisterDto struct {
Email string `json:"email"` // 邮箱
Password string `json:"password"` // 8字以上
Name string `json:"name"` // 2 - 50 字
Birthday string `json:"birthday"` // 2012-01-01
Gender string `json:"gender"` // m, f, bot
Answer1 string `json:"answer1"`
Answer2 string `json:"answer2"`
Answer3 string `json:"answer3"`
Question1 string `json:"question1"`
Question2 string `json:"question2"`
Question3 string `json:"question3"`
}
// UserBasic 用户的基本信息
type UserBasic struct {
Id string `json:"_id"`
Gender string `json:"gender"`
Name string `json:"name"`
Title string `json:"title"`
Verified bool `json:"verified"`
Exp int `json:"exp"`
Level int `json:"level"`
Characters []string `json:"characters"`
Avatar Image `json:"avatar"`
Slogan string `json:"slogan"` // 有可能是null, 从未设置过slogan的人
}
// LoginRequest 登录的请求体 (PS:Email字段为账号, 并不一定是邮箱格式)
type LoginRequest struct {
Email string `json:"email"`
Password string `json:"password"`
}
// LoginResponse 登录的返回体
type LoginResponse struct {
Response
Data struct {
Token string `json:"token"`
} `json:"data"`
}
// UserProfileResponse 获取个人信息接口返回体
type UserProfileResponse struct {
Data struct {
User UserProfile `json:"user"`
} `json:"data"`
}
// UserProfile 获取个人信息接口返回内容 | 个人信息
type UserProfile struct {
UserBasic
Birthday string `json:"birthday"`
Email string `json:"email"`
CreatedAt time.Time `json:"created_at"`
IsPunched bool `json:"isPunched"` // 是否打了哔咔
}
// PunchResponse 打哔咔接口返回体
type PunchResponse struct {
Response
Data struct {
Res PunchStatus `json:"res"`
} `json:"data"`
}
// PunchStatus 打哔咔接口返回内容
type PunchStatus struct {
Status string `json:"status"`
PunchInLastDay string `json:"punchInLastDay"`
}
// CategoriesResponse 获取分类接口返回体
type CategoriesResponse struct {
Response
Data struct {
Categories []Category `json:"categories"`
} `json:"data"`
}
// Category 分类
type Category struct {
Id string `json:"_id"`
Title string `json:"title"`
Description string `json:"description"`
Thumb Image `json:"thumb"`
IsWeb bool `json:"isWeb"`
Active bool `json:"active"`
Link string `json:"link"`
}
// ComicsPageResponse 漫画列表接口返回体
type ComicsPageResponse struct {
Response
Data struct {
Comics ComicsPage `json:"comics"`
} `json:"data"`
}
// ComicsPage 漫画的分页
type ComicsPage struct {
PageData
Docs []ComicSimple `json:"docs"`
}
// ComicsResponse 漫画列表返回体 用于随机漫画, 排行榜等不分页的接口
type ComicsResponse struct {
Response
Data struct {
Comics []ComicSimple `json:"comics"`
} `json:"data"`
}
// ComicSimple 漫画摘要内容, 列表页面使用
type ComicSimple struct {
Id string `json:"_id"`
Title string `json:"title"`
Author string `json:"author"`
PagesCount int `json:"pagesCount"`
EpsCount int `json:"epsCount"`
Finished bool `json:"finished"`
Categories []string `json:"categories"`
Thumb Image `json:"thumb"`
LikesCount int `json:"likesCount"`
}
// ComicInfoResponse 获取漫画详情接口返回体
type ComicInfoResponse struct {
Response
Data struct {
Comic ComicInfo `json:"comic"`
} `json:"data" `
}
// ComicInfo 漫画详情
type ComicInfo struct {
ComicSimple
Creator Creator `json:"_creator"`
Description string `json:"description"`
ChineseTeam string `json:"chineseTeam"`
Tags []string `json:"tags"`
UpdatedAt time.Time `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
AllowDownload bool `json:"allowDownload"`
ViewsCount int `json:"viewsCount"`
IsFavourite bool `json:"isFavourite"`
IsLiked bool `json:"isLiked"`
CommentsCount int `json:"commentsCount"`
}
// Creator 漫画的创建人
type Creator struct {
UserBasic
Role string `json:"role"`
Character string `json:"character"`
}
// EpPageResponse 获取漫画章节列表接口返回体
type EpPageResponse struct {
Response
Data struct {
Eps EpPage `json:"eps"`
} `json:"data"`
}
// EpPage 漫画的章节的分页
type EpPage struct {
PageData
Docs []Ep `json:"docs"`
}
// Ep 漫画的章节
type Ep struct {
Id string `json:"_id"`
Title string `json:"title"`
Order int `json:"order"`
UpdatedAt time.Time `json:"updated_at"`
}
// ComicPicturePageResponse 获取章节图片接口返回体
type ComicPicturePageResponse struct {
Response
Data struct {
Pages ComicPicturePage `json:"pages"`
Ep Ep `json:"ep"`
} `json:"data"`
}
// ComicPicturePage 章节图片的分页
type ComicPicturePage struct {
PageData
Docs []ComicPicture `json:"docs"`
}
// ComicPicture 章节的图片
type ComicPicture struct {
Media Image `json:"media"`
Id string `json:"_id"`
}
// ActionResponse 点赞,收藏 等接口返回体
type ActionResponse struct {
Data struct {
Action string `json:"action"`
} `json:"data"`
}
// CommentBase 评论
type CommentBase struct {
Id string `json:"_id"`
Content string `json:"content"`
User CommentUser `json:"_user"`
IsTop bool `json:"isTop"`
Hide bool `json:"hide"`
CreatedAt time.Time `json:"created_at"`
LikesCount int `json:"likesCount"`
CommentsCount int `json:"commentsCount"`
IsLiked bool `json:"isLiked"`
}
// ChildOfComment 自评的字段
type ChildOfComment struct {
Parent string `json:"_parent"`
}
// CommentUser 发出此评论的人
type CommentUser struct {
UserBasic
Role string `json:"role"`
}
// CommentsResponse 获取漫画评论接口返回体
type CommentsResponse struct {
Response
Data struct {
Comments CommentsPage `json:"comments"`
TopComments []Comment `json:"topComments"`
} `json:"data"`
}
// CommentsPage 漫画评论的分页
type CommentsPage struct {
PageData
Docs []Comment `json:"docs"`
}
// Comment 漫画的评论
type Comment struct {
CommentBase
Comic string `json:"_comic"`
}
// CommentChildrenResponse 获取子评论接口返回体
type CommentChildrenResponse struct {
Response
Data struct {
Comments CommentChildrenPage `json:"comments"`
} `json:"data"`
}
// CommentChildrenPage 子评论分页
type CommentChildrenPage struct {
PageData
Docs []CommentChild `json:"docs"`
}
// CommentChild 子评论
type CommentChild struct {
Comment
ChildOfComment
}
// MyCommentsPageResponse 我的评论接口返回体
type MyCommentsPageResponse struct {
Response
Data struct {
Comments MyCommentsPage `json:"comments"`
} `json:"data"`
}
// MyCommentsPage 我的评论分页
type MyCommentsPage struct {
PageData
Docs []MyComment `json:"docs"`
}
// MyComment 我的评论
type MyComment struct {
Id string `json:"_id"`
Content string `json:"content"`
Comic struct {
Id string `json:"_id"`
Title string `json:"title"`
} `json:"_comic"`
Hide bool `json:"hide"`
CreatedAt time.Time `json:"created_at"`
LikesCount int `json:"likesCount"`
CommentsCount int `json:"commentsCount"`
IsLiked bool `json:"isLiked"`
}
// LeaderboardOfKnightResponse 骑士榜接口返回体
type LeaderboardOfKnightResponse struct {
Response
Data struct {
Users []Knight `json:"users"`
} `json:"data"`
}
// Knight 用户(骑士榜)
type Knight struct {
UserBasic
Role string `json:"role"`
Character string `json:"character"`
ComicsUploaded int `json:"comicsUploaded"`
}
// HotKeywordsResponse 大家搜在搜接口返回体
type HotKeywordsResponse struct {
Response
Data struct {
Keywords []string `json:"keywords"`
} `json:"data"`
}
// GamePageResponse 游戏列表接口返回体
type GamePageResponse struct {
Response
Data struct {
Games GamePage `json:"games"`
} `json:"data"`
}
// GamePage 游戏列表
type GamePage struct {
PageData
Docs []GameSimple `json:"docs"`
}
// GameSimple 游戏摘要
type GameSimple struct {
Id string `json:"_id"`
Title string `json:"title"`
Version string `json:"version"`
Icon Image `json:"icon"`
Publisher string `json:"publisher"`
Adult bool `json:"adult"`
Suggest bool `json:"suggest"`
LikesCount int `json:"likesCount"`
Android bool `json:"android"`
Ios bool `json:"ios"`
}
// GameResponse 游戏详情接口返回体
type GameResponse struct {
Response
Data struct {
Game GameInfo `json:"game"`
} `json:"data"`
}
// GameInfo 游戏详情
type GameInfo struct {
GameSimple
Description string `json:"description"`
UpdateContent string `json:"updateContent"`
VideoLink string `json:"videoLink"`
Screenshots []Image `json:"screenshots"`
CommentsCount int `json:"commentsCount"`
DownloadsCount int `json:"downloadsCount"`
IsLiked bool `json:"isLiked"`
AndroidLinks []string `json:"androidLinks"`
AndroidSize float32 `json:"androidSize"`
IosLinks []string `json:"iosLinks"`
IosSize float32 `json:"iosSize"`
UpdatedAt time.Time `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
}
// GameCommentsResponse 获取漫画评论接口返回体
type GameCommentsResponse struct {
Response
Data struct {
Comments GameCommentsPage `json:"comments"`
TopComments []Comment `json:"topComments"`
} `json:"data"`
}
// GameCommentsPage 游戏评论的分页
type GameCommentsPage struct {
PageData
Docs []GameComment `json:"docs"`
}
// GameComment 游戏的评论
type GameComment struct {
CommentBase
Game string `json:"_game"`
}
// GameCommentChildrenResponse 获取游戏子评论接口返回体
type GameCommentChildrenResponse struct {
Response
Data struct {
Comments GameCommentChildrenPage `json:"comments"`
} `json:"data"`
}
// GameCommentChildrenPage 游戏子评论分页
type GameCommentChildrenPage struct {
PageData
Docs []GameCommentChild `json:"docs"`
}
// GameCommentChild 游戏子评论
type GameCommentChild struct {
GameComment
ChildOfComment
}
// CollectionsResponse 合集返回体
type CollectionsResponse struct {
Response
Data struct {
Collections []Collection `json:"collections"`
} `json:"data"`
}
// Collection 合集
type Collection struct {
Title string `json:"title"`
Comics []ComicSimple `json:"comics"`
}
// ForgotPasswordResult 找回密码-获取问题-返回DATA
type ForgotPasswordResult struct {
Question1 string `json:"question1"`
Question2 string `json:"question2"`
Question3 string `json:"question3"`
}
// ForgotPasswordResponse 找回密码-获取问题-返回
type ForgotPasswordResponse struct {
Response
Data ForgotPasswordResult `json:"data"`
}
// ResetPasswordResult 找回密码-根据答案重置密码
type ResetPasswordResult struct {
Password string `json:"password"`
}
// ResetPasswordResponse 找回密码-获取问题-返回
type ResetPasswordResponse struct {
Response
Data ResetPasswordResult `json:"data"`
}
type InitInfo struct {
Status string `json:"status"`
Addresses []string `json:"addresses"`
Waka string `json:"waka"`
AdKeyword string `json:"adKeyword"`
}