mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
* feat: try using folder2 * feat: update * feat: implement handlers * fix: compile errors * chore: add unsafe send + sync * feat: remove unsafe impl * fix: replace folder with foler2 * chore: dart compile errors * test: fix test * test: fix test * test: bypass existing tests * feat: open latest view * chore: fix dart warnings * chore: config notification * fix: folder notification bugs * fix: doesn't open the new view after creating * chore: rename struct * refactor: user id * test: fix test * chore: remove unused user_id * fix: fix read workspace views * chore: rename appflowy data folder * chore: update ref * fix: tauri build
74 lines
1.5 KiB
Rust
74 lines
1.5 KiB
Rust
use collab_folder::core::TrashInfo;
|
|
use flowy_derive::ProtoBuf;
|
|
|
|
#[derive(Eq, PartialEq, ProtoBuf, Default, Debug, Clone)]
|
|
pub struct TrashPB {
|
|
#[pb(index = 1)]
|
|
pub id: String,
|
|
|
|
#[pb(index = 2)]
|
|
pub name: String,
|
|
|
|
#[pb(index = 3)]
|
|
pub modified_time: i64,
|
|
|
|
#[pb(index = 4)]
|
|
pub create_time: i64,
|
|
}
|
|
|
|
impl std::convert::From<TrashInfo> for TrashPB {
|
|
fn from(trash_info: TrashInfo) -> Self {
|
|
TrashPB {
|
|
id: trash_info.id,
|
|
name: trash_info.name,
|
|
modified_time: trash_info.created_at,
|
|
create_time: trash_info.created_at,
|
|
}
|
|
}
|
|
}
|
|
|
|
impl std::convert::From<TrashPB> for TrashInfo {
|
|
fn from(trash: TrashPB) -> Self {
|
|
TrashInfo {
|
|
id: trash.id,
|
|
name: trash.name,
|
|
created_at: trash.create_time,
|
|
}
|
|
}
|
|
}
|
|
#[derive(PartialEq, Eq, Debug, Default, ProtoBuf, Clone)]
|
|
pub struct RepeatedTrashPB {
|
|
#[pb(index = 1)]
|
|
pub items: Vec<TrashPB>,
|
|
}
|
|
|
|
impl std::convert::From<Vec<TrashInfo>> for RepeatedTrashPB {
|
|
fn from(trash_revs: Vec<TrashInfo>) -> Self {
|
|
let items: Vec<TrashPB> = trash_revs
|
|
.into_iter()
|
|
.map(|trash_rev| trash_rev.into())
|
|
.collect();
|
|
RepeatedTrashPB { items }
|
|
}
|
|
}
|
|
|
|
#[derive(PartialEq, Eq, ProtoBuf, Default, Debug, Clone)]
|
|
pub struct TrashIdPB {
|
|
#[pb(index = 1)]
|
|
pub id: String,
|
|
}
|
|
|
|
impl std::convert::From<&TrashInfo> for TrashIdPB {
|
|
fn from(trash_info: &TrashInfo) -> Self {
|
|
TrashIdPB {
|
|
id: trash_info.id.clone(),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(PartialEq, Eq, ProtoBuf, Default, Debug, Clone)]
|
|
pub struct RepeatedTrashIdPB {
|
|
#[pb(index = 1)]
|
|
pub items: Vec<TrashIdPB>,
|
|
}
|