12345678910111213141516171819202122232425262728293031 |
- // 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<String>) {
- 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(),
- }
- }
|