generated from project-mirai/mirai-console-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Article.kt
192 lines (181 loc) · 4.71 KB
/
Article.kt
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
package xyz.cssxsh.bilibili.data
import kotlinx.serialization.*
import xyz.cssxsh.bilibili.*
import java.time.*
sealed interface Article : Entry, WithDateTime {
val id: Long
val images: List<String>
val title: String
val published: Long
val summary: String get() = ""
val status: ArticleStatus? get() = null
val link get() = "https://www.bilibili.com/read/cv$id"
override val datetime: OffsetDateTime get() = timestamp(published)
}
@Serializable
data class BiliArticleList(
@SerialName("last")
val last: ArticleSimple,
@SerialName("list")
val list: ArticleList? = null,
@SerialName("next")
val next: ArticleSimple? = null,
@SerialName("now")
val now: Long,
@SerialName("total")
val total: Long
)
@Serializable
data class BiliArticleView(
@SerialName("attention")
val attention: Boolean,
@SerialName("author_name")
val authorName: String,
@SerialName("banner_url")
val bannerUrl: String,
@SerialName("coin")
val coin: Long,
@SerialName("favorite")
val favorite: Boolean,
@SerialName("image_urls")
val imageUrls: List<String>,
@SerialName("in_list")
val inList: Boolean,
@SerialName("is_author")
val isAuthor: Boolean,
@SerialName("like")
@Serializable(NumberToBooleanSerializer::class)
val like: Boolean,
@SerialName("mid")
val mid: Long,
@SerialName("next")
val next: Long,
@SerialName("origin_image_urls")
override val images: List<String>,
@SerialName("pre")
val pre: Long,
@SerialName("share_channels")
val shareChannels: List<ShareChannel>,
@SerialName("shareable")
val shareable: Boolean,
@SerialName("show_later_watch")
val showLaterWatch: Boolean,
@SerialName("show_small_window")
val showSmallWindow: Boolean,
@SerialName("stats")
override val status: ArticleStatus,
@SerialName("title")
override val title: String,
@SerialName("id")
override val id: Long = 0,
@SerialName("publish_time")
override val published: Long = 0,
) : Article, Owner {
override val uid: Long get() = mid
override val uname: String get() = authorName
@Serializable
data class ShareChannel(
@SerialName("name")
val name: String,
@SerialName("picture")
val picture: String,
@SerialName("share_channel")
val shareChannel: String
)
}
@Serializable
data class ArticleAuthor(
@SerialName("face")
override val face: String,
@SerialName("mid")
val mid: Long,
@SerialName("name")
val name: String
) : Owner {
override val uid: Long get() = mid
override val uname: String get() = name
}
@Serializable
data class ArticleStatus(
@SerialName("coin")
val coin: Long = 0,
@SerialName("dislike")
@Serializable(NumberToBooleanSerializer::class)
val dislike: Boolean = false,
@SerialName("dynamic")
val dynamic: Long = 0,
@SerialName("favorite")
val favorite: Long = 0,
@SerialName("like")
val like: Long = 0,
@SerialName("reply")
val reply: Long = 0,
@SerialName("share")
val share: Long = 0,
@SerialName("view")
val view: Long = 0
) : Entry
@Serializable
data class ArticleSimple(
@SerialName("categories")
val categories: List<ArticleCategory>? = null,
@SerialName("category")
val category: ArticleCategory,
@SerialName("id")
override val id: Long,
@SerialName("image_urls")
override val images: List<String>,
@SerialName("publish_time")
override val published: Long,
@SerialName("summary")
override val summary: String,
@SerialName("title")
override val title: String,
@SerialName("words")
val words: Int
) : Article
@Serializable
data class ArticleList(
@SerialName("apply_time")
val apply: String,
@SerialName("articles_count")
val count: Int,
@SerialName("check_time")
val checked: String,
@SerialName("ctime")
val created: Long,
@SerialName("id")
val id: Long,
@SerialName("image_url")
val image: String,
@SerialName("mid")
val mid: Long,
@SerialName("name")
val name: String,
@SerialName("publish_time")
val published: Long,
@SerialName("read")
val read: Int,
@SerialName("reason")
val reason: String,
@SerialName("state")
val state: Int,
@SerialName("summary")
val summary: String,
@SerialName("update_time")
val updated: Long,
@SerialName("words")
val words: Int
) : Owner {
override val uid: Long get() = mid
override val uname: String get() = name
}
@Serializable
data class ArticleCategory(
@SerialName("id")
val id: Long,
@SerialName("name")
val name: String,
@SerialName("parent_id")
val parentId: Long
)