cmd.rs 540 B

1234567891011121314151617181920212223
  1. // Copyright 2019-2021 Tauri Programme within The Commons Conservancy
  2. // SPDX-License-Identifier: Apache-2.0
  3. // SPDX-License-Identifier: MIT
  4. use serde::Deserialize;
  5. use tauri::command;
  6. #[derive(Debug, Deserialize)]
  7. pub struct RequestBody {
  8. id: i32,
  9. name: String,
  10. }
  11. #[command]
  12. pub fn log_operation(event: String, payload: Option<String>) {
  13. println!("{} {:?}", event, payload);
  14. }
  15. #[command]
  16. pub fn perform_request(endpoint: String, body: RequestBody) -> String {
  17. println!("{} {:?}", endpoint, body);
  18. "message response".into()
  19. }