use collab_user::core::Reminder; use flowy_derive::ProtoBuf; #[derive(ProtoBuf, Default, Clone)] pub struct ReminderPB { #[pb(index = 1)] pub id: String, #[pb(index = 2)] pub scheduled_at: i64, #[pb(index = 3)] pub is_ack: bool, #[pb(index = 4)] pub ty: i64, #[pb(index = 5)] pub title: String, #[pb(index = 6)] pub message: String, #[pb(index = 7)] pub reminder_object_id: String, } #[derive(ProtoBuf, Default, Clone)] pub struct RepeatedReminderPB { #[pb(index = 1)] pub items: Vec, } impl From for Reminder { fn from(value: ReminderPB) -> Self { Self { id: value.id, scheduled_at: value.scheduled_at, is_ack: value.is_ack, ty: value.ty, title: value.title, message: value.message, reminder_object_id: value.reminder_object_id, } } } impl From for ReminderPB { fn from(value: Reminder) -> Self { Self { id: value.id, scheduled_at: value.scheduled_at, is_ack: value.is_ack, ty: value.ty, title: value.title, message: value.message, reminder_object_id: value.reminder_object_id, } } } impl From> for RepeatedReminderPB { fn from(value: Vec) -> Self { Self { items: value } } }