48 lines
1.1 KiB
Rust
48 lines
1.1 KiB
Rust
// 本文件的 struct/fn 多数是 TS 端的 Rust 镜像供序列化参考,非死代码
|
|
#![allow(dead_code)]
|
|
|
|
mod ai;
|
|
mod color;
|
|
mod commands;
|
|
mod model;
|
|
mod op;
|
|
mod oss;
|
|
|
|
pub fn run() {
|
|
let app_state = commands::AppState::new();
|
|
|
|
tauri::Builder::default()
|
|
.plugin(tauri_plugin_dialog::init())
|
|
.manage(app_state)
|
|
.invoke_handler(tauri::generate_handler![
|
|
commands::ping,
|
|
commands::app_info,
|
|
commands::exec_op,
|
|
commands::undo,
|
|
commands::redo,
|
|
commands::can_undo,
|
|
commands::can_redo,
|
|
commands::get_deck,
|
|
commands::set_navigation,
|
|
commands::save_file,
|
|
commands::ai_proxy,
|
|
commands::ai_proxy_stream,
|
|
commands::write_file,
|
|
commands::read_file,
|
|
commands::read_files,
|
|
oss::oss_upload,
|
|
])
|
|
.run(tauri::generate_context!())
|
|
.expect("error while running tauri application");
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
use super::commands;
|
|
|
|
#[test]
|
|
fn test_ping() {
|
|
assert_eq!(commands::ping(), "pong");
|
|
}
|
|
}
|