// Copyright 2019-2023 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use serde::{Deserialize, Serialize}; use tauri::command; #[derive(Debug, Deserialize)] #[allow(unused)] pub struct RequestBody { id: i32, name: String, } #[command] pub fn log_operation(event: String, payload: Option) { log::info!("{} {:?}", event, payload); } #[derive(Serialize)] pub struct ApiResponse { message: String, } #[command] pub fn perform_request(endpoint: String, body: RequestBody) -> ApiResponse { println!("{} {:?}", endpoint, body); ApiResponse { message: "message response".into(), } }