chore: refactored lib.rs to move commands into separate folder

This commit is contained in:
2026-01-15 16:17:06 +08:00
parent 7ae501aaf0
commit 86d964943e
11 changed files with 352 additions and 315 deletions

View File

@@ -0,0 +1,18 @@
use crate::{
lock_r,
models::app_data::AppData,
state::{init_app_data, FDOLL},
};
#[tauri::command]
pub fn get_app_data() -> Result<AppData, String> {
let guard = lock_r!(FDOLL);
return Ok(guard.app_data.clone());
}
#[tauri::command]
pub async fn refresh_app_data() -> Result<AppData, String> {
init_app_data().await;
let guard = lock_r!(FDOLL);
Ok(guard.app_data.clone())
}