Rust service refactor: app data, session windows & client config pt 2

This commit is contained in:
2026-03-10 15:46:49 +08:00
parent 341dd48132
commit 858858ab48
23 changed files with 308 additions and 347 deletions

View File

@@ -2,9 +2,10 @@ use crate::{
lock_r,
models::app_data::UserData,
services::{
app_data::{init_app_data_scoped, AppDataRefreshScope},
friends, presence_modules::models::ModuleMetadata, sprite,
},
state::{init_app_data_scoped, AppDataRefreshScope, FDOLL},
state::FDOLL,
};
#[tauri::command]

View File

@@ -1,7 +1,7 @@
use crate::{
lock_w,
services::client_config_manager::{
load_app_config, open_config_manager_window, save_app_config, AppConfig,
services::client_config::{
load_app_config, open_config_window, save_app_config, AppConfig,
},
state::FDOLL,
};
@@ -29,6 +29,6 @@ pub fn save_client_config(config: AppConfig) -> Result<(), String> {
#[tauri::command]
#[specta::specta]
pub async fn open_client_config_manager() -> Result<(), String> {
open_config_manager_window().map_err(|e| e.to_string())
pub async fn open_client_config() -> Result<(), String> {
open_config_window().map_err(|e| e.to_string())
}

View File

@@ -1,11 +1,11 @@
use crate::{
commands::{is_active_doll, refresh_app_data, refresh_app_data_conditionally},
models::dolls::{CreateDollDto, DollDto, UpdateDollDto},
remotes::{
dolls::DollsRemote,
user::UserRemote,
},
state::AppDataRefreshScope,
commands::{refresh_app_data, refresh_app_data_conditionally, is_active_doll},
services::app_data::AppDataRefreshScope,
};
#[tauri::command]

View File

@@ -2,8 +2,8 @@ use crate::remotes::friends::FriendRemote;
use crate::models::friends::{
FriendRequestResponseDto, FriendshipResponseDto, SendFriendRequestDto, UserBasicDto,
};
use crate::state::AppDataRefreshScope;
use crate::commands::refresh_app_data;
use crate::services::app_data::AppDataRefreshScope;
#[tauri::command]
#[specta::specta]

View File

@@ -9,7 +9,10 @@ pub mod petpet;
pub mod sprite;
use crate::lock_r;
use crate::state::{init_app_data_scoped, AppDataRefreshScope, FDOLL};
use crate::{
services::app_data::{init_app_data_scoped, AppDataRefreshScope},
state::FDOLL,
};
use tauri::async_runtime;
/// Helper to execute a mutation operation and refresh app data scopes in the background.