Skip to main content

bpi_rs/dynamic/
basic_info.rs

1use crate::models::Vip;
2use serde::{Deserialize, Serialize};
3use serde_json::Value;
4// 以下结构体为API文档中未完全列出的部分,根据描述进行了推断和简化。
5// 如果您有完整的文档,请替换这些结构体。
6
7/// 动态转发列表中的转发项
8#[derive(Debug, Clone, Deserialize, Serialize)]
9pub struct RepostItem {
10    pub desc: Desc,
11    pub card: String,
12    pub extend_json: String,
13    pub display: Display,
14}
15
16#[derive(Debug, Clone, Serialize, Deserialize)]
17pub struct Desc {
18    pub uid: i64,
19    #[serde(rename = "type")]
20    pub type_field: i64,
21    pub rid: i64,
22    pub acl: i64,
23    pub view: i64,
24    pub repost: i64,
25    pub comment: i64,
26    pub like: i64,
27    pub is_liked: i64,
28    pub dynamic_id: i64,
29    pub timestamp: i64,
30    pub pre_dy_id: i64,
31    pub orig_dy_id: i64,
32    pub orig_type: i64,
33    pub user_profile: UserProfile,
34    pub spec_type: i64,
35    pub uid_type: i64,
36    pub stype: i64,
37    pub r_type: i64,
38    pub inner_id: i64,
39    pub status: i64,
40    pub dynamic_id_str: String,
41    pub pre_dy_id_str: String,
42    pub orig_dy_id_str: String,
43    pub rid_str: String,
44    pub origin: Origin,
45    pub bvid: String,
46    pub previous: Value,
47}
48
49#[derive(Debug, Clone, Serialize, Deserialize)]
50pub struct UserProfile {
51    pub info: Info,
52    pub card: Card,
53    pub vip: Vip,
54    pub pendant: Pendant,
55    pub rank: String,
56    pub sign: String,
57    pub level_info: LevelInfo,
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
61pub struct Info {
62    pub uid: i64,
63    pub uname: String,
64    pub face: String,
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
68pub struct Card {
69    pub official_verify: OfficialVerify,
70}
71
72#[derive(Debug, Clone, Serialize, Deserialize)]
73pub struct OfficialVerify {
74    #[serde(rename = "type")]
75    pub type_field: i64,
76}
77
78#[derive(Debug, Clone, Serialize, Deserialize)]
79pub struct Label {
80    pub path: String,
81    pub text: String,
82    pub label_theme: String,
83    pub text_color: String,
84    pub bg_style: i64,
85    pub bg_color: String,
86    pub border_color: String,
87}
88
89#[derive(Debug, Clone, Serialize, Deserialize)]
90pub struct Pendant {
91    pub pid: i64,
92    pub name: String,
93    pub image: String,
94    pub expire: i64,
95    pub image_enhance: String,
96    pub image_enhance_frame: String,
97}
98
99#[derive(Debug, Clone, Serialize, Deserialize)]
100pub struct LevelInfo {
101    pub current_level: i64,
102    pub current_min: i64,
103    pub current_exp: i64,
104    pub next_exp: String,
105}
106
107#[derive(Debug, Clone, Serialize, Deserialize)]
108pub struct Origin {
109    pub uid: i64,
110    #[serde(rename = "type")]
111    pub type_field: i64,
112    pub rid: i64,
113    pub acl: i64,
114    pub view: i64,
115    pub repost: i64,
116    pub comment: i64,
117    pub like: i64,
118    pub is_liked: i64,
119    pub dynamic_id: i64,
120    pub timestamp: i64,
121    pub pre_dy_id: i64,
122    pub orig_dy_id: i64,
123    pub orig_type: i64,
124    pub user_profile: Value,
125    pub spec_type: i64,
126    pub uid_type: i64,
127    pub stype: i64,
128    pub r_type: i64,
129    pub inner_id: i64,
130    pub status: i64,
131    pub dynamic_id_str: String,
132    pub pre_dy_id_str: String,
133    pub orig_dy_id_str: String,
134    pub rid_str: String,
135    pub origin: Value,
136    pub bvid: String,
137    pub previous: Value,
138}
139
140#[derive(Debug, Clone, Serialize, Deserialize)]
141pub struct Display {
142    pub origin: Origin2,
143    pub usr_action_txt: String,
144    pub relation: Relation2,
145    pub live_info: Value,
146    pub emoji_info: EmojiInfo2,
147    pub highlight: Value,
148}
149
150#[derive(Debug, Clone, Serialize, Deserialize)]
151pub struct Origin2 {
152    pub origin: Value,
153    pub usr_action_txt: String,
154    pub relation: Relation,
155    pub live_info: Value,
156    pub emoji_info: EmojiInfo,
157    pub highlight: Value,
158}
159
160#[derive(Debug, Clone, Serialize, Deserialize)]
161pub struct Relation {
162    pub status: i64,
163    pub is_follow: i64,
164    pub is_followed: i64,
165}
166
167#[derive(Debug, Clone, Serialize, Deserialize)]
168pub struct EmojiInfo {
169    pub emoji_details: Value,
170}
171
172#[derive(Debug, Clone, Serialize, Deserialize)]
173pub struct Relation2 {
174    pub status: i64,
175    pub is_follow: i64,
176    pub is_followed: i64,
177}
178
179#[derive(Debug, Clone, Serialize, Deserialize)]
180pub struct EmojiInfo2 {
181    pub emoji_details: Value,
182}
183
184/// 动态点赞列表中的点赞项
185#[derive(Debug, Clone, Deserialize, Serialize)]
186pub struct LikeItem {
187    // 由于API文档未详细列出字段,这里作为占位符。
188    // 请根据实际API响应填充此结构体。
189}
190
191/// 纯文本动态内容
192#[derive(Debug, Clone, Deserialize, Serialize)]
193pub struct PlainTextRequest {
194    // 假设纯文本动态内容有一个名为 `content` 的字段。
195    pub content: String,
196    // 其他字段...
197}
198
199/// 获取草稿列表中的单项
200#[derive(Debug, Clone, Deserialize, Serialize)]
201pub struct Draft {
202    /// 草稿id
203    pub draft_id: String,
204    /// 定时发送的秒级时间戳
205    pub publish_time: u64,
206    /// 动态类型
207    #[serde(rename = "type")]
208    pub type_num: u8,
209    /// 自己的mid
210    pub uid: u64,
211    /// 自己的用户信息
212    pub user_profile: UserProfile,
213    /// 动态内容
214    pub request: String,
215}
216
217/// 动态转发列表响应数据结构体
218#[derive(Debug, Clone, Deserialize, Serialize)]
219pub struct RepostDetailResponseData {
220    /// 是否还有下一页
221    pub has_more: Option<bool>,
222    /// 总计
223    pub total: u64,
224    /// 转发列表
225    pub items: Vec<RepostItem>,
226}
227
228/// 动态点赞列表响应数据结构体
229#[derive(Debug, Clone, Deserialize, Serialize)]
230pub struct SpecItemLikesResponseData {
231    /// 点赞信息列表主体
232    pub item_likes: Vec<LikeItem>,
233    /// 是否还有下一页
234    pub has_more: bool,
235    /// 总计点赞数
236    pub total_count: u64,
237    /// 作用尚不明确
238    pub gt: u64,
239}
240
241/// 获取草稿列表响应数据结构体
242#[derive(Debug, Clone, Deserialize, Serialize)]
243pub struct GetDraftsResponseData {
244    /// 草稿列表
245    pub drafts: Vec<Draft>,
246}