summaryrefslogtreecommitdiff
path: root/legacy_data/src/data/local/latest_info.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-03-21 16:37:51 +0800
committer魏曹先生 <1992414357@qq.com>2026-03-21 16:37:51 +0800
commitc811c5818d21a67280ef9dd35ad40f6f5411daa5 (patch)
tree46062311242da24771466ad99be26b530e83d497 /legacy_data/src/data/local/latest_info.rs
parent9a60751a901f568bdeb154c4115235d4f3a0f8b9 (diff)
Good Bye! Legacy JVCS
Diffstat (limited to 'legacy_data/src/data/local/latest_info.rs')
-rw-r--r--legacy_data/src/data/local/latest_info.rs81
1 files changed, 0 insertions, 81 deletions
diff --git a/legacy_data/src/data/local/latest_info.rs b/legacy_data/src/data/local/latest_info.rs
deleted file mode 100644
index 5748793..0000000
--- a/legacy_data/src/data/local/latest_info.rs
+++ /dev/null
@@ -1,81 +0,0 @@
-use std::{
- collections::{HashMap, HashSet},
- path::{Path, PathBuf},
- time::SystemTime,
-};
-
-use cfg_file::ConfigFile;
-use serde::{Deserialize, Serialize};
-
-use crate::{
- constants::{CLIENT_FILE_LATEST_INFO, CLIENT_FILE_LATEST_INFO_NOSET, KEY_ACCOUNT},
- data::{
- member::{Member, MemberId},
- sheet::{SheetData, SheetName, SheetPathBuf},
- vault::{
- mapping_share::{Share, SheetShareId},
- virtual_file::VirtualFileId,
- },
- },
-};
-
-/// # Latest Info
-/// Locally cached latest information,
-/// used to cache personal information from upstream for querying and quickly retrieving member information.
-#[derive(Default, Serialize, Deserialize, ConfigFile)]
-#[cfg_file(path = CLIENT_FILE_LATEST_INFO_NOSET)]
-pub struct LatestInfo {
- // Sheets
- /// Visible sheets,
- /// indicating which sheets I can edit
- #[serde(rename = "my")]
- pub visible_sheets: Vec<SheetName>,
-
- /// Invisible sheets,
- /// indicating which sheets I can export files to (these sheets are not readable to me)
- #[serde(rename = "others")]
- pub invisible_sheets: Vec<SheetInfo>,
-
- /// Reference sheets,
- /// indicating sheets owned by the host, visible to everyone,
- /// but only the host can modify or add mappings within them
- #[serde(rename = "refsheets")]
- pub reference_sheets: HashSet<SheetName>,
-
- /// Reference sheet data, indicating what files I can get from the reference sheet
- #[serde(rename = "ref")]
- pub ref_sheet_content: SheetData,
-
- /// Reverse mapping from virtual file IDs to actual paths in reference sheets
- #[serde(rename = "ref_vfs")]
- pub ref_sheet_vfs_mapping: HashMap<VirtualFileId, SheetPathBuf>,
-
- /// Shares in my sheets, indicating which external merge requests have entries that I can view
- #[serde(rename = "shares")]
- pub shares_in_my_sheets: HashMap<SheetName, HashMap<SheetShareId, Share>>,
-
- /// Update instant
- #[serde(rename = "update")]
- pub update_instant: Option<SystemTime>,
-
- // Members
- /// All member information of the vault, allowing me to contact them more conveniently
- #[serde(rename = "members")]
- pub vault_members: Vec<Member>,
-}
-
-impl LatestInfo {
- /// Get the path to the latest info file for a given workspace and member ID
- pub fn latest_info_path(local_workspace_path: &Path, member_id: &MemberId) -> PathBuf {
- local_workspace_path.join(CLIENT_FILE_LATEST_INFO.replace(KEY_ACCOUNT, member_id))
- }
-}
-
-#[derive(Default, Serialize, Deserialize)]
-pub struct SheetInfo {
- #[serde(rename = "name")]
- pub sheet_name: SheetName,
-
- #[serde(rename = "holder")]
- pub holder_name: Option<MemberId>,
-}