1#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Answer {
5 #[prost(string, tag = "1")]
7 pub question_id: ::prost::alloc::string::String,
8 #[prost(int64, tag = "2")]
10 pub user_option: i64,
11}
12#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct Badge {
15 #[prost(message, optional, tag = "1")]
17 pub background_color: ::core::option::Option<Color>,
18 #[prost(string, tag = "2")]
20 pub text: ::prost::alloc::string::String,
21}
22#[derive(Clone, PartialEq, ::prost::Message)]
24pub struct ButtonWithToggleState {
25 #[prost(message, optional, tag = "1")]
27 pub button_checked: ::core::option::Option<ButtonWithUrl>,
28 #[prost(message, optional, tag = "2")]
30 pub button_unchecked: ::core::option::Option<ButtonWithUrl>,
31 #[prost(bool, tag = "3")]
33 pub is_checked: bool,
34 #[prost(string, tag = "4")]
36 pub oid: ::prost::alloc::string::String,
37 #[prost(string, tag = "5")]
39 pub desc_text: ::prost::alloc::string::String,
40 #[prost(string, tag = "6")]
42 pub desc_img: ::prost::alloc::string::String,
43}
44#[derive(Clone, PartialEq, ::prost::Message)]
46pub struct ButtonWithUrl {
47 #[prost(string, tag = "1")]
49 pub btn_text: ::prost::alloc::string::String,
50 #[prost(string, tag = "2")]
52 pub btn_img: ::prost::alloc::string::String,
53 #[prost(string, tag = "3")]
55 pub url: ::prost::alloc::string::String,
56}
57#[derive(Clone, PartialEq, ::prost::Message)]
59pub struct CampaignBrief {
60 #[prost(string, tag = "1")]
62 pub start_time: ::prost::alloc::string::String,
63 #[prost(string, tag = "2")]
65 pub title: ::prost::alloc::string::String,
66 #[prost(string, tag = "3")]
68 pub sub_title: ::prost::alloc::string::String,
69 #[prost(string, tag = "4")]
71 pub title_image: ::prost::alloc::string::String,
72 #[prost(bool, tag = "5")]
74 pub is_active: bool,
75 #[prost(string, tag = "6")]
77 pub active_text: ::prost::alloc::string::String,
78 #[prost(bool, tag = "7")]
80 pub show_reserve_button: bool,
81 #[prost(int64, tag = "8")]
83 pub reserve_sid: i64,
84 #[prost(bool, tag = "9")]
86 pub is_reserved: bool,
87 #[prost(bool, tag = "10")]
89 pub is_finished: bool,
90 #[prost(string, tag = "11")]
92 pub finished_text: ::prost::alloc::string::String,
93 #[prost(int64, tag = "12")]
95 pub sort_idx: i64,
96}
97#[derive(Clone, PartialEq, ::prost::Message)]
99pub struct CampaignsToday {
100 #[prost(string, tag = "1")]
102 pub today_date: ::prost::alloc::string::String,
103 #[prost(message, repeated, tag = "2")]
105 pub campaigns: ::prost::alloc::vec::Vec<CampaignBrief>,
106 #[prost(bool, tag = "3")]
108 pub default_check: bool,
109 #[prost(string, tag = "4")]
111 pub today_date_image_checked: ::prost::alloc::string::String,
112 #[prost(string, tag = "5")]
114 pub today_date_image_unchecked: ::prost::alloc::string::String,
115}
116#[derive(Clone, Copy, PartialEq, ::prost::Message)]
118pub struct ClickAction {
119 #[prost(int64, tag = "1")]
121 pub r#type: i64,
122 #[prost(int64, tag = "2")]
124 pub timestamp: i64,
125 #[prost(int64, tag = "3")]
127 pub x: i64,
128 #[prost(int64, tag = "4")]
130 pub y: i64,
131 #[prost(int64, tag = "5")]
133 pub z: i64,
134 #[prost(int64, tag = "6")]
136 pub answer_type: i64,
137}
138#[derive(Clone, PartialEq, ::prost::Message)]
140pub struct Color {
141 #[prost(string, tag = "1")]
143 pub argb_light: ::prost::alloc::string::String,
144 #[prost(string, tag = "2")]
146 pub argb_dark: ::prost::alloc::string::String,
147}
148#[derive(Clone, PartialEq, ::prost::Message)]
150pub struct ComponentHeaderLotteryScratch {
151 #[prost(string, tag = "1")]
153 pub image_url: ::prost::alloc::string::String,
154 #[prost(string, tag = "2")]
156 pub text: ::prost::alloc::string::String,
157 #[prost(string, tag = "3")]
159 pub jump_url: ::prost::alloc::string::String,
160}
161#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct ImageWithHw {
164 #[prost(string, tag = "1")]
166 pub image_url: ::prost::alloc::string::String,
167 #[prost(double, tag = "2")]
169 pub height: f64,
170 #[prost(double, tag = "3")]
172 pub width: f64,
173 #[prost(string, tag = "4")]
175 pub jump_url: ::prost::alloc::string::String,
176 #[prost(string, tag = "5")]
178 pub track_data: ::prost::alloc::string::String,
179}
180#[derive(Clone, PartialEq, ::prost::Message)]
182pub struct Option {
183 #[prost(int64, tag = "1")]
185 pub index: i64,
186 #[prost(string, tag = "2")]
188 pub content: ::prost::alloc::string::String,
189 #[prost(int64, tag = "3")]
191 pub ratio: i64,
192 #[prost(bool, tag = "4")]
194 pub user_selected: bool,
195}
196#[derive(Clone, PartialEq, ::prost::Message)]
198pub struct PrizeInfo {
199 #[prost(string, tag = "1")]
201 pub img: ::prost::alloc::string::String,
202 #[prost(string, tag = "2")]
204 pub desc: ::prost::alloc::string::String,
205 #[prost(enumeration = "PrizeType", tag = "3")]
207 pub r#type: i32,
208}
209#[derive(Clone, PartialEq, ::prost::Message)]
211pub struct Question {
212 #[prost(string, tag = "1")]
214 pub id: ::prost::alloc::string::String,
215 #[prost(string, tag = "2")]
217 pub question: ::prost::alloc::string::String,
218 #[prost(message, repeated, tag = "3")]
220 pub options: ::prost::alloc::vec::Vec<Option>,
221 #[prost(int64, tag = "4")]
223 pub question_duration: i64,
224}
225#[derive(Clone, PartialEq, ::prost::Message)]
227pub struct QuestionReview {
228 #[prost(string, tag = "1")]
230 pub question: ::prost::alloc::string::String,
231 #[prost(string, tag = "2")]
233 pub answer: ::prost::alloc::string::String,
234 #[prost(bool, tag = "3")]
236 pub is_correct: bool,
237}
238#[derive(Clone, PartialEq, ::prost::Message)]
240pub struct QuizReport {
241 #[prost(bool, tag = "1")]
243 pub switch: bool,
244 #[prost(int64, tag = "2")]
246 pub answer_time: i64,
247 #[prost(message, repeated, tag = "3")]
249 pub clicks: ::prost::alloc::vec::Vec<ClickAction>,
250}
251#[derive(Clone, PartialEq, ::prost::Message)]
253pub struct QuizResultReq {
254 #[prost(string, tag = "1")]
256 pub session_id: ::prost::alloc::string::String,
257}
258#[derive(Clone, PartialEq, ::prost::Message)]
260pub struct QuizResultResp {
261 #[prost(enumeration = "UserSessionStatus", tag = "1")]
263 pub result: i32,
264 #[prost(message, repeated, tag = "2")]
266 pub questions: ::prost::alloc::vec::Vec<QuestionReview>,
267 #[prost(message, repeated, tag = "3")]
269 pub prizes: ::prost::alloc::vec::Vec<PrizeInfo>,
270 #[prost(string, tag = "4")]
272 pub button_link: ::prost::alloc::string::String,
273 #[prost(bool, tag = "5")]
275 pub stat_completed: bool,
276}
277#[derive(Clone, Copy, PartialEq, ::prost::Message)]
279pub struct QuizReviewReq {}
280#[derive(Clone, PartialEq, ::prost::Message)]
282pub struct QuizReviewResp {
283 #[prost(message, repeated, tag = "1")]
285 pub list: ::prost::alloc::vec::Vec<SessionReview>,
286}
287#[derive(Clone, PartialEq, ::prost::Message)]
289pub struct RcmdItemBrief {
290 #[prost(string, tag = "1")]
292 pub item_type: ::prost::alloc::string::String,
293 #[prost(string, tag = "2")]
295 pub item_oid: ::prost::alloc::string::String,
296 #[prost(string, tag = "3")]
298 pub title: ::prost::alloc::string::String,
299 #[prost(string, tag = "4")]
301 pub cover: ::prost::alloc::string::String,
302 #[prost(string, tag = "5")]
304 pub jump_url: ::prost::alloc::string::String,
305 #[prost(message, optional, tag = "6")]
307 pub badge: ::core::option::Option<Badge>,
308 #[prost(string, tag = "7")]
310 pub cover_left_text1: ::prost::alloc::string::String,
311 #[prost(enumeration = "PegasusIcon", tag = "8")]
313 pub cover_left_icon1: i32,
314 #[prost(string, tag = "9")]
316 pub cover_left_text2: ::prost::alloc::string::String,
317 #[prost(enumeration = "PegasusIcon", tag = "10")]
319 pub cover_left_icon2: i32,
320 #[prost(string, tag = "11")]
322 pub cover_right_text: ::prost::alloc::string::String,
323 #[prost(message, optional, tag = "12")]
325 pub bottom_text: ::core::option::Option<TextWithPrefixImage>,
326 #[prost(message, optional, tag = "13")]
328 pub background_color: ::core::option::Option<Color>,
329}
330#[derive(Clone, PartialEq, ::prost::Message)]
332pub struct Session {
333 #[prost(string, tag = "1")]
335 pub id: ::prost::alloc::string::String,
336 #[prost(enumeration = "SessionType", tag = "2")]
338 pub r#type: i32,
339 #[prost(int64, tag = "3")]
341 pub stime: i64,
342 #[prost(int64, tag = "4")]
344 pub etime: i64,
345 #[prost(int64, tag = "5")]
347 pub answer_etime: i64,
348 #[prost(string, tag = "6")]
350 pub title_img: ::prost::alloc::string::String,
351 #[prost(string, tag = "7")]
353 pub background_img: ::prost::alloc::string::String,
354 #[prost(string, tag = "8")]
356 pub after_background_img: ::prost::alloc::string::String,
357 #[prost(string, tag = "9")]
359 pub live_card_img: ::prost::alloc::string::String,
360 #[prost(string, tag = "10")]
362 pub jump_url: ::prost::alloc::string::String,
363 #[prost(int64, tag = "11")]
365 pub next_quiz_stime: i64,
366 #[prost(int64, tag = "12")]
368 pub mtime: i64,
369 #[prost(bool, tag = "13")]
371 pub show_live_card: bool,
372}
373#[derive(Clone, PartialEq, ::prost::Message)]
375pub struct SessionReview {
376 #[prost(string, tag = "1")]
378 pub session_name: ::prost::alloc::string::String,
379 #[prost(message, repeated, tag = "2")]
381 pub questions: ::prost::alloc::vec::Vec<QuestionReview>,
382 #[prost(message, repeated, tag = "3")]
384 pub prizes: ::prost::alloc::vec::Vec<PrizeInfo>,
385 #[prost(string, tag = "4")]
387 pub session_id: ::prost::alloc::string::String,
388 #[prost(enumeration = "SessionType", tag = "5")]
390 pub r#type: i32,
391}
392#[derive(Clone, Copy, PartialEq, ::prost::Message)]
394pub struct SessionStatusBriefReq {}
395#[derive(Clone, PartialEq, ::prost::Message)]
397pub struct SessionStatusBriefResp {
398 #[prost(message, optional, tag = "1")]
400 pub session: ::core::option::Option<Session>,
401 #[prost(message, optional, tag = "2")]
403 pub upcoming_session: ::core::option::Option<Session>,
404 #[prost(int64, tag = "3")]
406 pub request_random: i64,
407}
408#[derive(Clone, Copy, PartialEq, ::prost::Message)]
410pub struct SessionStatusReq {}
411#[derive(Clone, PartialEq, ::prost::Message)]
413pub struct SessionStatusResp {
414 #[prost(message, optional, tag = "1")]
416 pub session: ::core::option::Option<Session>,
417 #[prost(message, optional, tag = "2")]
419 pub upcoming_session: ::core::option::Option<Session>,
420 #[prost(enumeration = "UserSessionStatus", tag = "3")]
422 pub user_status: i32,
423 #[prost(message, repeated, tag = "4")]
425 pub questions: ::prost::alloc::vec::Vec<Question>,
426 #[prost(int64, tag = "5")]
428 pub request_random: i64,
429}
430#[derive(Clone, PartialEq, ::prost::Message)]
432pub struct StartQuizReq {
433 #[prost(string, tag = "1")]
435 pub session_id: ::prost::alloc::string::String,
436 #[prost(int64, tag = "2")]
438 pub timestamp: i64,
439 #[prost(string, tag = "3")]
441 pub sign: ::prost::alloc::string::String,
442}
443#[derive(Clone, PartialEq, ::prost::Message)]
445pub struct StartQuizResp {
446 #[prost(message, repeated, tag = "1")]
448 pub questions: ::prost::alloc::vec::Vec<Question>,
449}
450#[derive(Clone, PartialEq, ::prost::Message)]
452pub struct SubmitQuizReq {
453 #[prost(string, tag = "1")]
455 pub session_id: ::prost::alloc::string::String,
456 #[prost(message, repeated, tag = "2")]
458 pub answers: ::prost::alloc::vec::Vec<Answer>,
459 #[prost(message, optional, tag = "3")]
461 pub report: ::core::option::Option<QuizReport>,
462 #[prost(int64, tag = "4")]
464 pub timestamp: i64,
465 #[prost(string, tag = "5")]
467 pub sign: ::prost::alloc::string::String,
468}
469#[derive(Clone, PartialEq, ::prost::Message)]
471pub struct SubmitQuizResp {
472 #[prost(enumeration = "UserSessionStatus", tag = "1")]
474 pub result: i32,
475 #[prost(message, repeated, tag = "2")]
477 pub questions_review: ::prost::alloc::vec::Vec<QuestionReview>,
478 #[prost(message, repeated, tag = "3")]
480 pub prizes: ::prost::alloc::vec::Vec<PrizeInfo>,
481 #[prost(message, repeated, tag = "4")]
483 pub questions: ::prost::alloc::vec::Vec<Question>,
484 #[prost(string, tag = "5")]
486 pub button_link: ::prost::alloc::string::String,
487}
488#[derive(Clone, Copy, PartialEq, ::prost::Message)]
490pub struct TabPageComponent {}
491#[derive(Clone, PartialEq, ::prost::Message)]
493pub struct TabPageProperty {
494 #[prost(message, optional, tag = "1")]
496 pub background_color: ::core::option::Option<Color>,
497 #[prost(enumeration = "PageTheme", tag = "2")]
499 pub page_theme: i32,
500}
501#[derive(Clone, PartialEq, ::prost::Message)]
503pub struct TabSection {
504 #[prost(enumeration = "TabSectionType", tag = "1")]
506 pub section_type: i32,
507 #[prost(oneof = "tab_section::SectionData", tags = "2, 3, 4, 5, 6, 7, 8, 9, 10")]
509 pub section_data: ::core::option::Option<tab_section::SectionData>,
510}
511pub mod tab_section {
513 #[derive(Clone, PartialEq, ::prost::Oneof)]
515 pub enum SectionData {
516 #[prost(message, tag = "2")]
518 Header(super::TabSectionHeader),
519 #[prost(message, tag = "3")]
521 LongLive(super::TabSectionLongLive),
522 #[prost(message, tag = "4")]
524 CampaignScheduling(super::TabSectionCampaignScheduling),
525 #[prost(message, tag = "5")]
527 CampaignSheet(super::TabSectionCampaignSheet),
528 #[prost(message, tag = "6")]
530 Quiz(super::TabSectionQuiz),
531 #[prost(message, tag = "7")]
533 RelatedRcmd(super::TabSectionRelatedRcmd),
534 #[prost(message, tag = "8")]
536 CampaignBanners(super::TabSectionCampaignBanners),
537 #[prost(message, tag = "9")]
539 GuidanceLongLive(super::TabSectionGuidanceLongLive),
540 #[prost(message, tag = "10")]
542 BackToPegasus(super::TabSectionBackToPegasus),
543 }
544}
545#[derive(Clone, PartialEq, ::prost::Message)]
547pub struct TabSectionBackToPegasus {
548 #[prost(string, tag = "1")]
550 pub title: ::prost::alloc::string::String,
551 #[prost(string, tag = "2")]
553 pub slide_content_img: ::prost::alloc::string::String,
554 #[prost(string, tag = "3")]
556 pub slide_arrow_img: ::prost::alloc::string::String,
557 #[prost(string, tag = "4")]
559 pub background_img: ::prost::alloc::string::String,
560}
561#[derive(Clone, PartialEq, ::prost::Message)]
563pub struct TabSectionCampaignBanners {
564 #[prost(string, tag = "1")]
566 pub title: ::prost::alloc::string::String,
567 #[prost(string, tag = "2")]
569 pub title_img: ::prost::alloc::string::String,
570 #[prost(message, repeated, tag = "3")]
572 pub banners: ::prost::alloc::vec::Vec<ImageWithHw>,
573 #[prost(double, tag = "4")]
575 pub display_w_h_ratio: f64,
576}
577#[derive(Clone, PartialEq, ::prost::Message)]
579pub struct TabSectionCampaignScheduling {
580 #[prost(string, tag = "1")]
582 pub title: ::prost::alloc::string::String,
583 #[prost(string, tag = "2")]
585 pub title_img: ::prost::alloc::string::String,
586 #[prost(message, repeated, tag = "3")]
588 pub scheduling: ::prost::alloc::vec::Vec<CampaignsToday>,
589 #[prost(message, optional, tag = "4")]
591 pub view_all_btn: ::core::option::Option<ButtonWithUrl>,
592 #[prost(string, tag = "5")]
594 pub dialog_header_background_img: ::prost::alloc::string::String,
595 #[prost(string, tag = "6")]
597 pub dialog_header_title: ::prost::alloc::string::String,
598 #[prost(string, tag = "7")]
600 pub dialog_header_title_img: ::prost::alloc::string::String,
601 #[prost(string, tag = "8")]
603 pub dialog_header_close_btn_img: ::prost::alloc::string::String,
604}
605#[derive(Clone, PartialEq, ::prost::Message)]
607pub struct TabSectionCampaignSheet {
608 #[prost(string, tag = "1")]
610 pub title: ::prost::alloc::string::String,
611 #[prost(string, tag = "2")]
613 pub title_img: ::prost::alloc::string::String,
614 #[prost(message, optional, tag = "3")]
616 pub view_all_btn: ::core::option::Option<ButtonWithUrl>,
617}
618#[derive(Clone, PartialEq, ::prost::Message)]
620pub struct TabSectionGuidanceLongLive {
621 #[prost(message, optional, tag = "1")]
623 pub guidance_button: ::core::option::Option<ButtonWithUrl>,
624}
625#[derive(Clone, PartialEq, ::prost::Message)]
627pub struct TabSectionHeader {
628 #[prost(string, tag = "1")]
630 pub banner_url: ::prost::alloc::string::String,
631 #[prost(message, optional, tag = "2")]
633 pub reward_button: ::core::option::Option<ButtonWithUrl>,
634 #[prost(message, optional, tag = "3")]
636 pub rule_button: ::core::option::Option<ButtonWithUrl>,
637 #[prost(message, optional, tag = "4")]
639 pub lottery_scratch: ::core::option::Option<ComponentHeaderLotteryScratch>,
640 #[prost(message, optional, tag = "5")]
642 pub reserve_button: ::core::option::Option<ButtonWithToggleState>,
643 #[prost(string, tag = "6")]
645 pub sponsor_logo_url: ::prost::alloc::string::String,
646}
647#[derive(Clone, PartialEq, ::prost::Message)]
649pub struct TabSectionLongLive {
650 #[prost(int64, tag = "1")]
652 pub room_id: i64,
653 #[prost(bool, tag = "2")]
655 pub is_streaming: bool,
656 #[prost(string, tag = "3")]
658 pub player_url: ::prost::alloc::string::String,
659 #[prost(string, tag = "4")]
661 pub room_cover: ::prost::alloc::string::String,
662 #[prost(string, tag = "5")]
664 pub jump_url: ::prost::alloc::string::String,
665 #[prost(bool, tag = "6")]
667 pub show_co_live_users: bool,
668 #[prost(message, repeated, tag = "7")]
670 pub co_live_users_info: ::prost::alloc::vec::Vec<UserInfo>,
671 #[prost(string, tag = "8")]
673 pub co_live_user_title: ::prost::alloc::string::String,
674 #[prost(string, tag = "9")]
676 pub fallback_player_url: ::prost::alloc::string::String,
677 #[prost(int64, tag = "10")]
679 pub area_id: i64,
680 #[prost(int64, tag = "11")]
682 pub parent_area_id: i64,
683 #[prost(int64, tag = "12")]
685 pub anchor_id: i64,
686 #[prost(int64, tag = "13")]
688 pub live_id: i64,
689 #[prost(string, tag = "14")]
691 pub sub_session_key: ::prost::alloc::string::String,
692}
693#[derive(Clone, PartialEq, ::prost::Message)]
695pub struct TabSectionQuiz {
696 #[prost(message, optional, tag = "1")]
698 pub quiz_session_status: ::core::option::Option<SessionStatusResp>,
699}
700#[derive(Clone, PartialEq, ::prost::Message)]
702pub struct TabSectionRelatedRcmd {
703 #[prost(string, tag = "1")]
705 pub title: ::prost::alloc::string::String,
706 #[prost(message, repeated, tag = "2")]
708 pub item_list: ::prost::alloc::vec::Vec<RcmdItemBrief>,
709 #[prost(message, optional, tag = "3")]
711 pub bottom_button: ::core::option::Option<ButtonWithUrl>,
712 #[prost(string, tag = "4")]
714 pub background_img_top: ::prost::alloc::string::String,
715 #[prost(string, tag = "5")]
717 pub background_img_middle: ::prost::alloc::string::String,
718 #[prost(string, tag = "6")]
720 pub background_img_bottom: ::prost::alloc::string::String,
721}
722#[derive(Clone, Copy, PartialEq, ::prost::Message)]
724pub struct TabViewReq {
725 #[prost(message, optional, tag = "1")]
727 pub player_args: ::core::option::Option<
728 super::super::archive::middleware::v1::PlayerArgs,
729 >,
730 #[prost(bool, tag = "2")]
732 pub is_preload: bool,
733}
734#[derive(Clone, PartialEq, ::prost::Message)]
736pub struct TabViewResp {
737 #[prost(message, optional, tag = "1")]
739 pub page_property: ::core::option::Option<TabPageProperty>,
740 #[prost(message, optional, tag = "2")]
742 pub page_component: ::core::option::Option<TabPageComponent>,
743 #[prost(message, repeated, tag = "3")]
745 pub tab_sections: ::prost::alloc::vec::Vec<TabSection>,
746}
747#[derive(Clone, PartialEq, ::prost::Message)]
749pub struct TextWithPrefixImage {
750 #[prost(string, tag = "1")]
752 pub text_show: ::prost::alloc::string::String,
753 #[prost(string, tag = "2")]
755 pub prefix_img: ::prost::alloc::string::String,
756 #[prost(string, tag = "3")]
758 pub text_type: ::prost::alloc::string::String,
759 #[prost(string, tag = "4")]
761 pub text_oid: ::prost::alloc::string::String,
762 #[prost(string, tag = "5")]
764 pub jump_url: ::prost::alloc::string::String,
765}
766#[derive(Clone, PartialEq, ::prost::Message)]
768pub struct UserInfo {
769 #[prost(int64, tag = "1")]
771 pub mid: i64,
772 #[prost(string, tag = "2")]
774 pub name: ::prost::alloc::string::String,
775 #[prost(string, tag = "3")]
777 pub face: ::prost::alloc::string::String,
778 #[prost(bool, tag = "4")]
780 pub is_following: bool,
781}
782#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
784#[repr(i32)]
785pub enum PageTheme {
786 Invalid = 0,
788 ProjectCny = 1,
790 ProjectNewYear2025 = 2,
792}
793impl PageTheme {
794 pub fn as_str_name(&self) -> &'static str {
799 match self {
800 Self::Invalid => "Page_Theme_Invalid",
801 Self::ProjectCny => "Page_Theme_Project_CNY",
802 Self::ProjectNewYear2025 => "Page_Theme_Project_NewYear2025",
803 }
804 }
805 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
807 match value {
808 "Page_Theme_Invalid" => Some(Self::Invalid),
809 "Page_Theme_Project_CNY" => Some(Self::ProjectCny),
810 "Page_Theme_Project_NewYear2025" => Some(Self::ProjectNewYear2025),
811 _ => None,
812 }
813 }
814}
815#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
817#[repr(i32)]
818pub enum PegasusIcon {
819 Invalid = 0,
821 Plays = 1,
823 Danmakus = 3,
825}
826impl PegasusIcon {
827 pub fn as_str_name(&self) -> &'static str {
832 match self {
833 Self::Invalid => "Pegasus_Icon_Invalid",
834 Self::Plays => "Pegasus_Icon_Plays",
835 Self::Danmakus => "Pegasus_Icon_Danmakus",
836 }
837 }
838 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
840 match value {
841 "Pegasus_Icon_Invalid" => Some(Self::Invalid),
842 "Pegasus_Icon_Plays" => Some(Self::Plays),
843 "Pegasus_Icon_Danmakus" => Some(Self::Danmakus),
844 _ => None,
845 }
846 }
847}
848#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
850#[repr(i32)]
851pub enum PrizeType {
852 Unknown = 0,
854 GameCount = 1,
856 Cash = 2,
858 Gift = 3,
860}
861impl PrizeType {
862 pub fn as_str_name(&self) -> &'static str {
867 match self {
868 Self::Unknown => "PrizeTypeUnknown",
869 Self::GameCount => "PrizeTypeGameCount",
870 Self::Cash => "PrizeTypeCash",
871 Self::Gift => "PrizeTypeGift",
872 }
873 }
874 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
876 match value {
877 "PrizeTypeUnknown" => Some(Self::Unknown),
878 "PrizeTypeGameCount" => Some(Self::GameCount),
879 "PrizeTypeCash" => Some(Self::Cash),
880 "PrizeTypeGift" => Some(Self::Gift),
881 _ => None,
882 }
883 }
884}
885#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
887#[repr(i32)]
888pub enum SessionType {
889 Unknown = 0,
891 Guess = 1,
893 Quiz = 2,
895 Activity = 3,
897}
898impl SessionType {
899 pub fn as_str_name(&self) -> &'static str {
904 match self {
905 Self::Unknown => "SessionTypeUnknown",
906 Self::Guess => "SessionTypeGuess",
907 Self::Quiz => "SessionTypeQuiz",
908 Self::Activity => "SessionTypeActivity",
909 }
910 }
911 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
913 match value {
914 "SessionTypeUnknown" => Some(Self::Unknown),
915 "SessionTypeGuess" => Some(Self::Guess),
916 "SessionTypeQuiz" => Some(Self::Quiz),
917 "SessionTypeActivity" => Some(Self::Activity),
918 _ => None,
919 }
920 }
921}
922#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
924#[repr(i32)]
925pub enum TabSectionType {
926 TabSectionInvalid = 0,
928 TabSectionHeader = 1,
930 TabSectionLongLive = 2,
932 TabSectionCampaignScheduling = 3,
934 TabSectionCampaignSheet = 4,
936 TabSectionQuiz = 5,
938 TabSectionRelatedRcmd = 6,
940 TabSectionCampaignBanners = 7,
942 TabSectionGuidanceLongLive = 8,
944 TabSectionBackToPegasus = 9,
946}
947impl TabSectionType {
948 pub fn as_str_name(&self) -> &'static str {
953 match self {
954 Self::TabSectionInvalid => "Tab_Section_Invalid",
955 Self::TabSectionHeader => "Tab_Section_Header",
956 Self::TabSectionLongLive => "Tab_Section_LongLive",
957 Self::TabSectionCampaignScheduling => "Tab_Section_CampaignScheduling",
958 Self::TabSectionCampaignSheet => "Tab_Section_CampaignSheet",
959 Self::TabSectionQuiz => "Tab_Section_Quiz",
960 Self::TabSectionRelatedRcmd => "Tab_Section_RelatedRcmd",
961 Self::TabSectionCampaignBanners => "Tab_Section_CampaignBanners",
962 Self::TabSectionGuidanceLongLive => "Tab_Section_GuidanceLongLive",
963 Self::TabSectionBackToPegasus => "Tab_Section_BackToPegasus",
964 }
965 }
966 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
968 match value {
969 "Tab_Section_Invalid" => Some(Self::TabSectionInvalid),
970 "Tab_Section_Header" => Some(Self::TabSectionHeader),
971 "Tab_Section_LongLive" => Some(Self::TabSectionLongLive),
972 "Tab_Section_CampaignScheduling" => Some(Self::TabSectionCampaignScheduling),
973 "Tab_Section_CampaignSheet" => Some(Self::TabSectionCampaignSheet),
974 "Tab_Section_Quiz" => Some(Self::TabSectionQuiz),
975 "Tab_Section_RelatedRcmd" => Some(Self::TabSectionRelatedRcmd),
976 "Tab_Section_CampaignBanners" => Some(Self::TabSectionCampaignBanners),
977 "Tab_Section_GuidanceLongLive" => Some(Self::TabSectionGuidanceLongLive),
978 "Tab_Section_BackToPegasus" => Some(Self::TabSectionBackToPegasus),
979 _ => None,
980 }
981 }
982}
983#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
985#[repr(i32)]
986pub enum UserSessionStatus {
987 UserSessionNotStart = 0,
989 UserSessionParticipated = 1,
991 UserSessionSubmitted = 2,
993 UserSessionSucceed = 3,
995 UserSessionFailed = 4,
997 UserSessionInvalid = 5,
999}
1000impl UserSessionStatus {
1001 pub fn as_str_name(&self) -> &'static str {
1006 match self {
1007 Self::UserSessionNotStart => "UserSessionNotStart",
1008 Self::UserSessionParticipated => "UserSessionParticipated",
1009 Self::UserSessionSubmitted => "UserSessionSubmitted",
1010 Self::UserSessionSucceed => "UserSessionSucceed",
1011 Self::UserSessionFailed => "UserSessionFailed",
1012 Self::UserSessionInvalid => "UserSessionInvalid",
1013 }
1014 }
1015 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1017 match value {
1018 "UserSessionNotStart" => Some(Self::UserSessionNotStart),
1019 "UserSessionParticipated" => Some(Self::UserSessionParticipated),
1020 "UserSessionSubmitted" => Some(Self::UserSessionSubmitted),
1021 "UserSessionSucceed" => Some(Self::UserSessionSucceed),
1022 "UserSessionFailed" => Some(Self::UserSessionFailed),
1023 "UserSessionInvalid" => Some(Self::UserSessionInvalid),
1024 _ => None,
1025 }
1026 }
1027}
1028pub mod quiz_client {
1030 #![allow(
1031 unused_variables,
1032 dead_code,
1033 missing_docs,
1034 clippy::wildcard_imports,
1035 clippy::let_unit_value,
1036 )]
1037 use tonic::codegen::*;
1038 use tonic::codegen::http::Uri;
1039 #[derive(Debug, Clone)]
1041 pub struct QuizClient<T> {
1042 inner: tonic::client::Grpc<T>,
1043 }
1044 impl<T> QuizClient<T>
1045 where
1046 T: tonic::client::GrpcService<tonic::body::BoxBody>,
1047 T::Error: Into<StdError>,
1048 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1049 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1050 {
1051 pub fn new(inner: T) -> Self {
1052 let inner = tonic::client::Grpc::new(inner);
1053 Self { inner }
1054 }
1055 pub fn with_origin(inner: T, origin: Uri) -> Self {
1056 let inner = tonic::client::Grpc::with_origin(inner, origin);
1057 Self { inner }
1058 }
1059 pub fn with_interceptor<F>(
1060 inner: T,
1061 interceptor: F,
1062 ) -> QuizClient<InterceptedService<T, F>>
1063 where
1064 F: tonic::service::Interceptor,
1065 T::ResponseBody: Default,
1066 T: tonic::codegen::Service<
1067 http::Request<tonic::body::BoxBody>,
1068 Response = http::Response<
1069 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1070 >,
1071 >,
1072 <T as tonic::codegen::Service<
1073 http::Request<tonic::body::BoxBody>,
1074 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1075 {
1076 QuizClient::new(InterceptedService::new(inner, interceptor))
1077 }
1078 #[must_use]
1083 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1084 self.inner = self.inner.send_compressed(encoding);
1085 self
1086 }
1087 #[must_use]
1089 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1090 self.inner = self.inner.accept_compressed(encoding);
1091 self
1092 }
1093 #[must_use]
1097 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1098 self.inner = self.inner.max_decoding_message_size(limit);
1099 self
1100 }
1101 #[must_use]
1105 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1106 self.inner = self.inner.max_encoding_message_size(limit);
1107 self
1108 }
1109 pub async fn quiz_result(
1111 &mut self,
1112 request: impl tonic::IntoRequest<super::QuizResultReq>,
1113 ) -> std::result::Result<tonic::Response<super::QuizResultResp>, tonic::Status> {
1114 self.inner
1115 .ready()
1116 .await
1117 .map_err(|e| {
1118 tonic::Status::unknown(
1119 format!("Service was not ready: {}", e.into()),
1120 )
1121 })?;
1122 let codec = tonic::codec::ProstCodec::default();
1123 let path = http::uri::PathAndQuery::from_static(
1124 "/bilibili.app.project.cny.Quiz/QuizResult",
1125 );
1126 let mut req = request.into_request();
1127 req.extensions_mut()
1128 .insert(GrpcMethod::new("bilibili.app.project.cny.Quiz", "QuizResult"));
1129 self.inner.unary(req, path, codec).await
1130 }
1131 pub async fn quiz_review(
1133 &mut self,
1134 request: impl tonic::IntoRequest<super::QuizReviewReq>,
1135 ) -> std::result::Result<tonic::Response<super::QuizReviewResp>, tonic::Status> {
1136 self.inner
1137 .ready()
1138 .await
1139 .map_err(|e| {
1140 tonic::Status::unknown(
1141 format!("Service was not ready: {}", e.into()),
1142 )
1143 })?;
1144 let codec = tonic::codec::ProstCodec::default();
1145 let path = http::uri::PathAndQuery::from_static(
1146 "/bilibili.app.project.cny.Quiz/QuizReview",
1147 );
1148 let mut req = request.into_request();
1149 req.extensions_mut()
1150 .insert(GrpcMethod::new("bilibili.app.project.cny.Quiz", "QuizReview"));
1151 self.inner.unary(req, path, codec).await
1152 }
1153 pub async fn session_status(
1155 &mut self,
1156 request: impl tonic::IntoRequest<super::SessionStatusReq>,
1157 ) -> std::result::Result<
1158 tonic::Response<super::SessionStatusResp>,
1159 tonic::Status,
1160 > {
1161 self.inner
1162 .ready()
1163 .await
1164 .map_err(|e| {
1165 tonic::Status::unknown(
1166 format!("Service was not ready: {}", e.into()),
1167 )
1168 })?;
1169 let codec = tonic::codec::ProstCodec::default();
1170 let path = http::uri::PathAndQuery::from_static(
1171 "/bilibili.app.project.cny.Quiz/SessionStatus",
1172 );
1173 let mut req = request.into_request();
1174 req.extensions_mut()
1175 .insert(
1176 GrpcMethod::new("bilibili.app.project.cny.Quiz", "SessionStatus"),
1177 );
1178 self.inner.unary(req, path, codec).await
1179 }
1180 pub async fn session_status_brief(
1182 &mut self,
1183 request: impl tonic::IntoRequest<super::SessionStatusBriefReq>,
1184 ) -> std::result::Result<
1185 tonic::Response<super::SessionStatusBriefResp>,
1186 tonic::Status,
1187 > {
1188 self.inner
1189 .ready()
1190 .await
1191 .map_err(|e| {
1192 tonic::Status::unknown(
1193 format!("Service was not ready: {}", e.into()),
1194 )
1195 })?;
1196 let codec = tonic::codec::ProstCodec::default();
1197 let path = http::uri::PathAndQuery::from_static(
1198 "/bilibili.app.project.cny.Quiz/SessionStatusBrief",
1199 );
1200 let mut req = request.into_request();
1201 req.extensions_mut()
1202 .insert(
1203 GrpcMethod::new(
1204 "bilibili.app.project.cny.Quiz",
1205 "SessionStatusBrief",
1206 ),
1207 );
1208 self.inner.unary(req, path, codec).await
1209 }
1210 pub async fn start_quiz(
1212 &mut self,
1213 request: impl tonic::IntoRequest<super::StartQuizReq>,
1214 ) -> std::result::Result<tonic::Response<super::StartQuizResp>, tonic::Status> {
1215 self.inner
1216 .ready()
1217 .await
1218 .map_err(|e| {
1219 tonic::Status::unknown(
1220 format!("Service was not ready: {}", e.into()),
1221 )
1222 })?;
1223 let codec = tonic::codec::ProstCodec::default();
1224 let path = http::uri::PathAndQuery::from_static(
1225 "/bilibili.app.project.cny.Quiz/StartQuiz",
1226 );
1227 let mut req = request.into_request();
1228 req.extensions_mut()
1229 .insert(GrpcMethod::new("bilibili.app.project.cny.Quiz", "StartQuiz"));
1230 self.inner.unary(req, path, codec).await
1231 }
1232 pub async fn submit_quiz(
1234 &mut self,
1235 request: impl tonic::IntoRequest<super::SubmitQuizReq>,
1236 ) -> std::result::Result<tonic::Response<super::SubmitQuizResp>, tonic::Status> {
1237 self.inner
1238 .ready()
1239 .await
1240 .map_err(|e| {
1241 tonic::Status::unknown(
1242 format!("Service was not ready: {}", e.into()),
1243 )
1244 })?;
1245 let codec = tonic::codec::ProstCodec::default();
1246 let path = http::uri::PathAndQuery::from_static(
1247 "/bilibili.app.project.cny.Quiz/SubmitQuiz",
1248 );
1249 let mut req = request.into_request();
1250 req.extensions_mut()
1251 .insert(GrpcMethod::new("bilibili.app.project.cny.Quiz", "SubmitQuiz"));
1252 self.inner.unary(req, path, codec).await
1253 }
1254 }
1255}
1256pub mod tab_client {
1258 #![allow(
1259 unused_variables,
1260 dead_code,
1261 missing_docs,
1262 clippy::wildcard_imports,
1263 clippy::let_unit_value,
1264 )]
1265 use tonic::codegen::*;
1266 use tonic::codegen::http::Uri;
1267 #[derive(Debug, Clone)]
1269 pub struct TabClient<T> {
1270 inner: tonic::client::Grpc<T>,
1271 }
1272 impl<T> TabClient<T>
1273 where
1274 T: tonic::client::GrpcService<tonic::body::BoxBody>,
1275 T::Error: Into<StdError>,
1276 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1277 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1278 {
1279 pub fn new(inner: T) -> Self {
1280 let inner = tonic::client::Grpc::new(inner);
1281 Self { inner }
1282 }
1283 pub fn with_origin(inner: T, origin: Uri) -> Self {
1284 let inner = tonic::client::Grpc::with_origin(inner, origin);
1285 Self { inner }
1286 }
1287 pub fn with_interceptor<F>(
1288 inner: T,
1289 interceptor: F,
1290 ) -> TabClient<InterceptedService<T, F>>
1291 where
1292 F: tonic::service::Interceptor,
1293 T::ResponseBody: Default,
1294 T: tonic::codegen::Service<
1295 http::Request<tonic::body::BoxBody>,
1296 Response = http::Response<
1297 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1298 >,
1299 >,
1300 <T as tonic::codegen::Service<
1301 http::Request<tonic::body::BoxBody>,
1302 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1303 {
1304 TabClient::new(InterceptedService::new(inner, interceptor))
1305 }
1306 #[must_use]
1311 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1312 self.inner = self.inner.send_compressed(encoding);
1313 self
1314 }
1315 #[must_use]
1317 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1318 self.inner = self.inner.accept_compressed(encoding);
1319 self
1320 }
1321 #[must_use]
1325 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1326 self.inner = self.inner.max_decoding_message_size(limit);
1327 self
1328 }
1329 #[must_use]
1333 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1334 self.inner = self.inner.max_encoding_message_size(limit);
1335 self
1336 }
1337 pub async fn view(
1339 &mut self,
1340 request: impl tonic::IntoRequest<super::TabViewReq>,
1341 ) -> std::result::Result<tonic::Response<super::TabViewResp>, tonic::Status> {
1342 self.inner
1343 .ready()
1344 .await
1345 .map_err(|e| {
1346 tonic::Status::unknown(
1347 format!("Service was not ready: {}", e.into()),
1348 )
1349 })?;
1350 let codec = tonic::codec::ProstCodec::default();
1351 let path = http::uri::PathAndQuery::from_static(
1352 "/bilibili.app.project.cny.Tab/View",
1353 );
1354 let mut req = request.into_request();
1355 req.extensions_mut()
1356 .insert(GrpcMethod::new("bilibili.app.project.cny.Tab", "View"));
1357 self.inner.unary(req, path, codec).await
1358 }
1359 }
1360}
1361pub mod quiz_server {
1363 #![allow(
1364 unused_variables,
1365 dead_code,
1366 missing_docs,
1367 clippy::wildcard_imports,
1368 clippy::let_unit_value,
1369 )]
1370 use tonic::codegen::*;
1371 #[async_trait]
1373 pub trait Quiz: std::marker::Send + std::marker::Sync + 'static {
1374 async fn quiz_result(
1376 &self,
1377 request: tonic::Request<super::QuizResultReq>,
1378 ) -> std::result::Result<tonic::Response<super::QuizResultResp>, tonic::Status>;
1379 async fn quiz_review(
1381 &self,
1382 request: tonic::Request<super::QuizReviewReq>,
1383 ) -> std::result::Result<tonic::Response<super::QuizReviewResp>, tonic::Status>;
1384 async fn session_status(
1386 &self,
1387 request: tonic::Request<super::SessionStatusReq>,
1388 ) -> std::result::Result<
1389 tonic::Response<super::SessionStatusResp>,
1390 tonic::Status,
1391 >;
1392 async fn session_status_brief(
1394 &self,
1395 request: tonic::Request<super::SessionStatusBriefReq>,
1396 ) -> std::result::Result<
1397 tonic::Response<super::SessionStatusBriefResp>,
1398 tonic::Status,
1399 >;
1400 async fn start_quiz(
1402 &self,
1403 request: tonic::Request<super::StartQuizReq>,
1404 ) -> std::result::Result<tonic::Response<super::StartQuizResp>, tonic::Status>;
1405 async fn submit_quiz(
1407 &self,
1408 request: tonic::Request<super::SubmitQuizReq>,
1409 ) -> std::result::Result<tonic::Response<super::SubmitQuizResp>, tonic::Status>;
1410 }
1411 #[derive(Debug)]
1413 pub struct QuizServer<T> {
1414 inner: Arc<T>,
1415 accept_compression_encodings: EnabledCompressionEncodings,
1416 send_compression_encodings: EnabledCompressionEncodings,
1417 max_decoding_message_size: Option<usize>,
1418 max_encoding_message_size: Option<usize>,
1419 }
1420 impl<T> QuizServer<T> {
1421 pub fn new(inner: T) -> Self {
1422 Self::from_arc(Arc::new(inner))
1423 }
1424 pub fn from_arc(inner: Arc<T>) -> Self {
1425 Self {
1426 inner,
1427 accept_compression_encodings: Default::default(),
1428 send_compression_encodings: Default::default(),
1429 max_decoding_message_size: None,
1430 max_encoding_message_size: None,
1431 }
1432 }
1433 pub fn with_interceptor<F>(
1434 inner: T,
1435 interceptor: F,
1436 ) -> InterceptedService<Self, F>
1437 where
1438 F: tonic::service::Interceptor,
1439 {
1440 InterceptedService::new(Self::new(inner), interceptor)
1441 }
1442 #[must_use]
1444 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1445 self.accept_compression_encodings.enable(encoding);
1446 self
1447 }
1448 #[must_use]
1450 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1451 self.send_compression_encodings.enable(encoding);
1452 self
1453 }
1454 #[must_use]
1458 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1459 self.max_decoding_message_size = Some(limit);
1460 self
1461 }
1462 #[must_use]
1466 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1467 self.max_encoding_message_size = Some(limit);
1468 self
1469 }
1470 }
1471 impl<T, B> tonic::codegen::Service<http::Request<B>> for QuizServer<T>
1472 where
1473 T: Quiz,
1474 B: Body + std::marker::Send + 'static,
1475 B::Error: Into<StdError> + std::marker::Send + 'static,
1476 {
1477 type Response = http::Response<tonic::body::BoxBody>;
1478 type Error = std::convert::Infallible;
1479 type Future = BoxFuture<Self::Response, Self::Error>;
1480 fn poll_ready(
1481 &mut self,
1482 _cx: &mut Context<'_>,
1483 ) -> Poll<std::result::Result<(), Self::Error>> {
1484 Poll::Ready(Ok(()))
1485 }
1486 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1487 match req.uri().path() {
1488 "/bilibili.app.project.cny.Quiz/QuizResult" => {
1489 #[allow(non_camel_case_types)]
1490 struct QuizResultSvc<T: Quiz>(pub Arc<T>);
1491 impl<T: Quiz> tonic::server::UnaryService<super::QuizResultReq>
1492 for QuizResultSvc<T> {
1493 type Response = super::QuizResultResp;
1494 type Future = BoxFuture<
1495 tonic::Response<Self::Response>,
1496 tonic::Status,
1497 >;
1498 fn call(
1499 &mut self,
1500 request: tonic::Request<super::QuizResultReq>,
1501 ) -> Self::Future {
1502 let inner = Arc::clone(&self.0);
1503 let fut = async move {
1504 <T as Quiz>::quiz_result(&inner, request).await
1505 };
1506 Box::pin(fut)
1507 }
1508 }
1509 let accept_compression_encodings = self.accept_compression_encodings;
1510 let send_compression_encodings = self.send_compression_encodings;
1511 let max_decoding_message_size = self.max_decoding_message_size;
1512 let max_encoding_message_size = self.max_encoding_message_size;
1513 let inner = self.inner.clone();
1514 let fut = async move {
1515 let method = QuizResultSvc(inner);
1516 let codec = tonic::codec::ProstCodec::default();
1517 let mut grpc = tonic::server::Grpc::new(codec)
1518 .apply_compression_config(
1519 accept_compression_encodings,
1520 send_compression_encodings,
1521 )
1522 .apply_max_message_size_config(
1523 max_decoding_message_size,
1524 max_encoding_message_size,
1525 );
1526 let res = grpc.unary(method, req).await;
1527 Ok(res)
1528 };
1529 Box::pin(fut)
1530 }
1531 "/bilibili.app.project.cny.Quiz/QuizReview" => {
1532 #[allow(non_camel_case_types)]
1533 struct QuizReviewSvc<T: Quiz>(pub Arc<T>);
1534 impl<T: Quiz> tonic::server::UnaryService<super::QuizReviewReq>
1535 for QuizReviewSvc<T> {
1536 type Response = super::QuizReviewResp;
1537 type Future = BoxFuture<
1538 tonic::Response<Self::Response>,
1539 tonic::Status,
1540 >;
1541 fn call(
1542 &mut self,
1543 request: tonic::Request<super::QuizReviewReq>,
1544 ) -> Self::Future {
1545 let inner = Arc::clone(&self.0);
1546 let fut = async move {
1547 <T as Quiz>::quiz_review(&inner, request).await
1548 };
1549 Box::pin(fut)
1550 }
1551 }
1552 let accept_compression_encodings = self.accept_compression_encodings;
1553 let send_compression_encodings = self.send_compression_encodings;
1554 let max_decoding_message_size = self.max_decoding_message_size;
1555 let max_encoding_message_size = self.max_encoding_message_size;
1556 let inner = self.inner.clone();
1557 let fut = async move {
1558 let method = QuizReviewSvc(inner);
1559 let codec = tonic::codec::ProstCodec::default();
1560 let mut grpc = tonic::server::Grpc::new(codec)
1561 .apply_compression_config(
1562 accept_compression_encodings,
1563 send_compression_encodings,
1564 )
1565 .apply_max_message_size_config(
1566 max_decoding_message_size,
1567 max_encoding_message_size,
1568 );
1569 let res = grpc.unary(method, req).await;
1570 Ok(res)
1571 };
1572 Box::pin(fut)
1573 }
1574 "/bilibili.app.project.cny.Quiz/SessionStatus" => {
1575 #[allow(non_camel_case_types)]
1576 struct SessionStatusSvc<T: Quiz>(pub Arc<T>);
1577 impl<T: Quiz> tonic::server::UnaryService<super::SessionStatusReq>
1578 for SessionStatusSvc<T> {
1579 type Response = super::SessionStatusResp;
1580 type Future = BoxFuture<
1581 tonic::Response<Self::Response>,
1582 tonic::Status,
1583 >;
1584 fn call(
1585 &mut self,
1586 request: tonic::Request<super::SessionStatusReq>,
1587 ) -> Self::Future {
1588 let inner = Arc::clone(&self.0);
1589 let fut = async move {
1590 <T as Quiz>::session_status(&inner, request).await
1591 };
1592 Box::pin(fut)
1593 }
1594 }
1595 let accept_compression_encodings = self.accept_compression_encodings;
1596 let send_compression_encodings = self.send_compression_encodings;
1597 let max_decoding_message_size = self.max_decoding_message_size;
1598 let max_encoding_message_size = self.max_encoding_message_size;
1599 let inner = self.inner.clone();
1600 let fut = async move {
1601 let method = SessionStatusSvc(inner);
1602 let codec = tonic::codec::ProstCodec::default();
1603 let mut grpc = tonic::server::Grpc::new(codec)
1604 .apply_compression_config(
1605 accept_compression_encodings,
1606 send_compression_encodings,
1607 )
1608 .apply_max_message_size_config(
1609 max_decoding_message_size,
1610 max_encoding_message_size,
1611 );
1612 let res = grpc.unary(method, req).await;
1613 Ok(res)
1614 };
1615 Box::pin(fut)
1616 }
1617 "/bilibili.app.project.cny.Quiz/SessionStatusBrief" => {
1618 #[allow(non_camel_case_types)]
1619 struct SessionStatusBriefSvc<T: Quiz>(pub Arc<T>);
1620 impl<
1621 T: Quiz,
1622 > tonic::server::UnaryService<super::SessionStatusBriefReq>
1623 for SessionStatusBriefSvc<T> {
1624 type Response = super::SessionStatusBriefResp;
1625 type Future = BoxFuture<
1626 tonic::Response<Self::Response>,
1627 tonic::Status,
1628 >;
1629 fn call(
1630 &mut self,
1631 request: tonic::Request<super::SessionStatusBriefReq>,
1632 ) -> Self::Future {
1633 let inner = Arc::clone(&self.0);
1634 let fut = async move {
1635 <T as Quiz>::session_status_brief(&inner, request).await
1636 };
1637 Box::pin(fut)
1638 }
1639 }
1640 let accept_compression_encodings = self.accept_compression_encodings;
1641 let send_compression_encodings = self.send_compression_encodings;
1642 let max_decoding_message_size = self.max_decoding_message_size;
1643 let max_encoding_message_size = self.max_encoding_message_size;
1644 let inner = self.inner.clone();
1645 let fut = async move {
1646 let method = SessionStatusBriefSvc(inner);
1647 let codec = tonic::codec::ProstCodec::default();
1648 let mut grpc = tonic::server::Grpc::new(codec)
1649 .apply_compression_config(
1650 accept_compression_encodings,
1651 send_compression_encodings,
1652 )
1653 .apply_max_message_size_config(
1654 max_decoding_message_size,
1655 max_encoding_message_size,
1656 );
1657 let res = grpc.unary(method, req).await;
1658 Ok(res)
1659 };
1660 Box::pin(fut)
1661 }
1662 "/bilibili.app.project.cny.Quiz/StartQuiz" => {
1663 #[allow(non_camel_case_types)]
1664 struct StartQuizSvc<T: Quiz>(pub Arc<T>);
1665 impl<T: Quiz> tonic::server::UnaryService<super::StartQuizReq>
1666 for StartQuizSvc<T> {
1667 type Response = super::StartQuizResp;
1668 type Future = BoxFuture<
1669 tonic::Response<Self::Response>,
1670 tonic::Status,
1671 >;
1672 fn call(
1673 &mut self,
1674 request: tonic::Request<super::StartQuizReq>,
1675 ) -> Self::Future {
1676 let inner = Arc::clone(&self.0);
1677 let fut = async move {
1678 <T as Quiz>::start_quiz(&inner, request).await
1679 };
1680 Box::pin(fut)
1681 }
1682 }
1683 let accept_compression_encodings = self.accept_compression_encodings;
1684 let send_compression_encodings = self.send_compression_encodings;
1685 let max_decoding_message_size = self.max_decoding_message_size;
1686 let max_encoding_message_size = self.max_encoding_message_size;
1687 let inner = self.inner.clone();
1688 let fut = async move {
1689 let method = StartQuizSvc(inner);
1690 let codec = tonic::codec::ProstCodec::default();
1691 let mut grpc = tonic::server::Grpc::new(codec)
1692 .apply_compression_config(
1693 accept_compression_encodings,
1694 send_compression_encodings,
1695 )
1696 .apply_max_message_size_config(
1697 max_decoding_message_size,
1698 max_encoding_message_size,
1699 );
1700 let res = grpc.unary(method, req).await;
1701 Ok(res)
1702 };
1703 Box::pin(fut)
1704 }
1705 "/bilibili.app.project.cny.Quiz/SubmitQuiz" => {
1706 #[allow(non_camel_case_types)]
1707 struct SubmitQuizSvc<T: Quiz>(pub Arc<T>);
1708 impl<T: Quiz> tonic::server::UnaryService<super::SubmitQuizReq>
1709 for SubmitQuizSvc<T> {
1710 type Response = super::SubmitQuizResp;
1711 type Future = BoxFuture<
1712 tonic::Response<Self::Response>,
1713 tonic::Status,
1714 >;
1715 fn call(
1716 &mut self,
1717 request: tonic::Request<super::SubmitQuizReq>,
1718 ) -> Self::Future {
1719 let inner = Arc::clone(&self.0);
1720 let fut = async move {
1721 <T as Quiz>::submit_quiz(&inner, request).await
1722 };
1723 Box::pin(fut)
1724 }
1725 }
1726 let accept_compression_encodings = self.accept_compression_encodings;
1727 let send_compression_encodings = self.send_compression_encodings;
1728 let max_decoding_message_size = self.max_decoding_message_size;
1729 let max_encoding_message_size = self.max_encoding_message_size;
1730 let inner = self.inner.clone();
1731 let fut = async move {
1732 let method = SubmitQuizSvc(inner);
1733 let codec = tonic::codec::ProstCodec::default();
1734 let mut grpc = tonic::server::Grpc::new(codec)
1735 .apply_compression_config(
1736 accept_compression_encodings,
1737 send_compression_encodings,
1738 )
1739 .apply_max_message_size_config(
1740 max_decoding_message_size,
1741 max_encoding_message_size,
1742 );
1743 let res = grpc.unary(method, req).await;
1744 Ok(res)
1745 };
1746 Box::pin(fut)
1747 }
1748 _ => {
1749 Box::pin(async move {
1750 let mut response = http::Response::new(empty_body());
1751 let headers = response.headers_mut();
1752 headers
1753 .insert(
1754 tonic::Status::GRPC_STATUS,
1755 (tonic::Code::Unimplemented as i32).into(),
1756 );
1757 headers
1758 .insert(
1759 http::header::CONTENT_TYPE,
1760 tonic::metadata::GRPC_CONTENT_TYPE,
1761 );
1762 Ok(response)
1763 })
1764 }
1765 }
1766 }
1767 }
1768 impl<T> Clone for QuizServer<T> {
1769 fn clone(&self) -> Self {
1770 let inner = self.inner.clone();
1771 Self {
1772 inner,
1773 accept_compression_encodings: self.accept_compression_encodings,
1774 send_compression_encodings: self.send_compression_encodings,
1775 max_decoding_message_size: self.max_decoding_message_size,
1776 max_encoding_message_size: self.max_encoding_message_size,
1777 }
1778 }
1779 }
1780 pub const SERVICE_NAME: &str = "bilibili.app.project.cny.Quiz";
1782 impl<T> tonic::server::NamedService for QuizServer<T> {
1783 const NAME: &'static str = SERVICE_NAME;
1784 }
1785}
1786pub mod tab_server {
1788 #![allow(
1789 unused_variables,
1790 dead_code,
1791 missing_docs,
1792 clippy::wildcard_imports,
1793 clippy::let_unit_value,
1794 )]
1795 use tonic::codegen::*;
1796 #[async_trait]
1798 pub trait Tab: std::marker::Send + std::marker::Sync + 'static {
1799 async fn view(
1801 &self,
1802 request: tonic::Request<super::TabViewReq>,
1803 ) -> std::result::Result<tonic::Response<super::TabViewResp>, tonic::Status>;
1804 }
1805 #[derive(Debug)]
1807 pub struct TabServer<T> {
1808 inner: Arc<T>,
1809 accept_compression_encodings: EnabledCompressionEncodings,
1810 send_compression_encodings: EnabledCompressionEncodings,
1811 max_decoding_message_size: Option<usize>,
1812 max_encoding_message_size: Option<usize>,
1813 }
1814 impl<T> TabServer<T> {
1815 pub fn new(inner: T) -> Self {
1816 Self::from_arc(Arc::new(inner))
1817 }
1818 pub fn from_arc(inner: Arc<T>) -> Self {
1819 Self {
1820 inner,
1821 accept_compression_encodings: Default::default(),
1822 send_compression_encodings: Default::default(),
1823 max_decoding_message_size: None,
1824 max_encoding_message_size: None,
1825 }
1826 }
1827 pub fn with_interceptor<F>(
1828 inner: T,
1829 interceptor: F,
1830 ) -> InterceptedService<Self, F>
1831 where
1832 F: tonic::service::Interceptor,
1833 {
1834 InterceptedService::new(Self::new(inner), interceptor)
1835 }
1836 #[must_use]
1838 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1839 self.accept_compression_encodings.enable(encoding);
1840 self
1841 }
1842 #[must_use]
1844 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1845 self.send_compression_encodings.enable(encoding);
1846 self
1847 }
1848 #[must_use]
1852 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1853 self.max_decoding_message_size = Some(limit);
1854 self
1855 }
1856 #[must_use]
1860 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1861 self.max_encoding_message_size = Some(limit);
1862 self
1863 }
1864 }
1865 impl<T, B> tonic::codegen::Service<http::Request<B>> for TabServer<T>
1866 where
1867 T: Tab,
1868 B: Body + std::marker::Send + 'static,
1869 B::Error: Into<StdError> + std::marker::Send + 'static,
1870 {
1871 type Response = http::Response<tonic::body::BoxBody>;
1872 type Error = std::convert::Infallible;
1873 type Future = BoxFuture<Self::Response, Self::Error>;
1874 fn poll_ready(
1875 &mut self,
1876 _cx: &mut Context<'_>,
1877 ) -> Poll<std::result::Result<(), Self::Error>> {
1878 Poll::Ready(Ok(()))
1879 }
1880 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1881 match req.uri().path() {
1882 "/bilibili.app.project.cny.Tab/View" => {
1883 #[allow(non_camel_case_types)]
1884 struct ViewSvc<T: Tab>(pub Arc<T>);
1885 impl<T: Tab> tonic::server::UnaryService<super::TabViewReq>
1886 for ViewSvc<T> {
1887 type Response = super::TabViewResp;
1888 type Future = BoxFuture<
1889 tonic::Response<Self::Response>,
1890 tonic::Status,
1891 >;
1892 fn call(
1893 &mut self,
1894 request: tonic::Request<super::TabViewReq>,
1895 ) -> Self::Future {
1896 let inner = Arc::clone(&self.0);
1897 let fut = async move {
1898 <T as Tab>::view(&inner, request).await
1899 };
1900 Box::pin(fut)
1901 }
1902 }
1903 let accept_compression_encodings = self.accept_compression_encodings;
1904 let send_compression_encodings = self.send_compression_encodings;
1905 let max_decoding_message_size = self.max_decoding_message_size;
1906 let max_encoding_message_size = self.max_encoding_message_size;
1907 let inner = self.inner.clone();
1908 let fut = async move {
1909 let method = ViewSvc(inner);
1910 let codec = tonic::codec::ProstCodec::default();
1911 let mut grpc = tonic::server::Grpc::new(codec)
1912 .apply_compression_config(
1913 accept_compression_encodings,
1914 send_compression_encodings,
1915 )
1916 .apply_max_message_size_config(
1917 max_decoding_message_size,
1918 max_encoding_message_size,
1919 );
1920 let res = grpc.unary(method, req).await;
1921 Ok(res)
1922 };
1923 Box::pin(fut)
1924 }
1925 _ => {
1926 Box::pin(async move {
1927 let mut response = http::Response::new(empty_body());
1928 let headers = response.headers_mut();
1929 headers
1930 .insert(
1931 tonic::Status::GRPC_STATUS,
1932 (tonic::Code::Unimplemented as i32).into(),
1933 );
1934 headers
1935 .insert(
1936 http::header::CONTENT_TYPE,
1937 tonic::metadata::GRPC_CONTENT_TYPE,
1938 );
1939 Ok(response)
1940 })
1941 }
1942 }
1943 }
1944 }
1945 impl<T> Clone for TabServer<T> {
1946 fn clone(&self) -> Self {
1947 let inner = self.inner.clone();
1948 Self {
1949 inner,
1950 accept_compression_encodings: self.accept_compression_encodings,
1951 send_compression_encodings: self.send_compression_encodings,
1952 max_decoding_message_size: self.max_decoding_message_size,
1953 max_encoding_message_size: self.max_encoding_message_size,
1954 }
1955 }
1956 }
1957 pub const SERVICE_NAME: &str = "bilibili.app.project.cny.Tab";
1959 impl<T> tonic::server::NamedService for TabServer<T> {
1960 const NAME: &'static str = SERVICE_NAME;
1961 }
1962}