mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
add some more protobuf messages
This commit is contained in:
parent
8a3a4cb10d
commit
8df5f49c52
2 changed files with 41 additions and 1 deletions
|
@ -11,9 +11,11 @@ message BackendInput {
|
||||||
oneof value {
|
oneof value {
|
||||||
TemplateRequirementsIn template_requirements = 16;
|
TemplateRequirementsIn template_requirements = 16;
|
||||||
SchedTimingTodayIn sched_timing_today = 17;
|
SchedTimingTodayIn sched_timing_today = 17;
|
||||||
|
Empty deck_tree = 18;
|
||||||
|
FindCardsIn find_cards = 19;
|
||||||
|
BrowserRowsIn browser_rows = 20;
|
||||||
|
|
||||||
PlusOneIn plus_one = 2046; // temporary, for testing
|
PlusOneIn plus_one = 2046; // temporary, for testing
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +23,9 @@ message BackendOutput {
|
||||||
oneof value {
|
oneof value {
|
||||||
TemplateRequirementsOut template_requirements = 16;
|
TemplateRequirementsOut template_requirements = 16;
|
||||||
SchedTimingTodayOut sched_timing_today = 17;
|
SchedTimingTodayOut sched_timing_today = 17;
|
||||||
|
DeckTreeOut deck_tree = 18;
|
||||||
|
FindCardsOut find_cards = 19;
|
||||||
|
BrowserRowsOut browser_rows = 20;
|
||||||
|
|
||||||
PlusOneOut plus_one = 2046; // temporary, for testing
|
PlusOneOut plus_one = 2046; // temporary, for testing
|
||||||
|
|
||||||
|
@ -87,3 +92,35 @@ message SchedTimingTodayOut {
|
||||||
uint32 days_elapsed = 1;
|
uint32 days_elapsed = 1;
|
||||||
int64 next_day_at = 2;
|
int64 next_day_at = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message DeckTreeOut {
|
||||||
|
DeckTreeNode top = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DeckTreeNode {
|
||||||
|
// the components of a deck, split on ::
|
||||||
|
repeated string names = 1;
|
||||||
|
int64 deck_id = 2;
|
||||||
|
uint32 review_count = 3;
|
||||||
|
uint32 learn_count = 4;
|
||||||
|
uint32 new_count = 5;
|
||||||
|
repeated DeckTreeNode children = 6;
|
||||||
|
bool collapsed = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
message FindCardsIn {
|
||||||
|
string search = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message FindCardsOut {
|
||||||
|
repeated int64 card_ids = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message BrowserRowsIn {
|
||||||
|
repeated int64 card_ids = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message BrowserRowsOut {
|
||||||
|
// just sort fields for proof of concept
|
||||||
|
repeated string sort_fields = 1;
|
||||||
|
}
|
||||||
|
|
|
@ -89,6 +89,9 @@ impl Backend {
|
||||||
Value::SchedTimingToday(input) => {
|
Value::SchedTimingToday(input) => {
|
||||||
OValue::SchedTimingToday(self.sched_timing_today(input))
|
OValue::SchedTimingToday(self.sched_timing_today(input))
|
||||||
}
|
}
|
||||||
|
Value::DeckTree(_) => todo!(),
|
||||||
|
Value::FindCards(_) => todo!(),
|
||||||
|
Value::BrowserRows(_) => todo!(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue