refactor: 用单独的文件管理commands

This commit is contained in:
lanyeeee
2025-07-09 05:28:56 +08:00
parent ea9b7449d6
commit eaa078feee
2 changed files with 8 additions and 6 deletions
+5
View File
@@ -0,0 +1,5 @@
#[tauri::command]
#[specta::specta]
pub fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust!", name)
}
+3 -6
View File
@@ -1,11 +1,8 @@
mod commands;
use tauri::Wry;
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
#[tauri::command]
#[specta::specta]
fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust!", name)
}
use crate::commands::*;
fn generate_context() -> tauri::Context<Wry> {
tauri::generate_context!()