From bb1fee0c68dd1ec2cf5ff1d0b137e5ad55ce79c5 Mon Sep 17 00:00:00 2001 From: rizky_denianto Date: Tue, 14 Apr 2026 23:32:11 +0700 Subject: [PATCH 1/2] Memperbarui deskripsi --- Cargo.toml | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6f02d8a..b00158c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "tauri-plugin-bluclas" version = "0.1.0" -authors = [ "You" ] +authors = [ "Rizky Denianto" ] description = "" -edition = "2021" -rust-version = "1.77.2" +edition = "2024" +rust-version = "1.94.1" exclude = ["/examples", "/dist-js", "/guest-js", "/node_modules"] links = "tauri-plugin-bluclas" diff --git a/package.json b/package.json index fc79e8d..431e278 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tauri-plugin-bluclas-api", "version": "0.1.0", - "author": "You", + "author": "Rizky Denianto", "description": "", "type": "module", "types": "./dist-js/index.d.ts", -- 2.52.0 From d16127348c815e298204e7eaf3f1ce4bbca32085 Mon Sep 17 00:00:00 2001 From: rizky_denianto Date: Tue, 14 Apr 2026 23:35:45 +0700 Subject: [PATCH 2/2] Memperbaiki penamaan struktur --- src/commands.rs | 8 ++++---- src/desktop.rs | 8 ++++---- src/mobile.rs | 6 +++--- src/models.rs | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 9900ebd..ec5f82d 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1,20 +1,20 @@ -use tauri::{command, AppHandle, Runtime}; +use tauri::{AppHandle, Runtime, command}; -use crate::models::*; use crate::BluclasExt; use crate::Result; +use crate::models::*; #[command] pub(crate) async fn daftar_perangkat( app: AppHandle, -) -> Result { +) -> Result { return app.bluclas().daftar_perangkat(); } #[command] pub(crate) async fn kirim( app: AppHandle, - payload: SBlueclasClassicMuatanKirim, + payload: SBlueclasMuatanKirim, ) -> Result<()> { return app.bluclas().kirim(payload); } diff --git a/src/desktop.rs b/src/desktop.rs index 14e0453..5f6ee09 100644 --- a/src/desktop.rs +++ b/src/desktop.rs @@ -1,5 +1,5 @@ use serde::de::DeserializeOwned; -use tauri::{plugin::PluginApi, AppHandle, Runtime}; +use tauri::{AppHandle, Runtime, plugin::PluginApi}; use crate::models::*; @@ -14,11 +14,11 @@ pub fn init( pub struct Bluclas(AppHandle); impl Bluclas { - pub fn daftar_perangkat(&self) -> crate::Result { - return Ok(SBlueclasClassicResponDaftarPerangkat { data: vec![] }); + pub fn daftar_perangkat(&self) -> crate::Result { + return Ok(SBlueclasResponDaftarPerangkat { data: vec![] }); } - pub fn kirim(&self, _: SBlueclasClassicMuatanKirim) -> crate::Result<()> { + pub fn kirim(&self, _: SBlueclasMuatanKirim) -> crate::Result<()> { return Ok(()); } } diff --git a/src/mobile.rs b/src/mobile.rs index d9045ad..f976f48 100644 --- a/src/mobile.rs +++ b/src/mobile.rs @@ -1,7 +1,7 @@ use serde::de::DeserializeOwned; use tauri::{ - plugin::{PluginApi, PluginHandle}, AppHandle, Runtime, + plugin::{PluginApi, PluginHandle}, }; use crate::models::*; @@ -25,14 +25,14 @@ pub fn init( pub struct Bluclas(PluginHandle); impl Bluclas { - pub fn daftar_perangkat(&self) -> crate::Result { + pub fn daftar_perangkat(&self) -> crate::Result { return self .0 .run_mobile_plugin("daftarPerangkat", ()) .map_err(Into::into); } - pub fn kirim(&self, payload: SBlueclasClassicMuatanKirim) -> crate::Result<()> { + pub fn kirim(&self, payload: SBlueclasMuatanKirim) -> crate::Result<()> { return self .0 .run_mobile_plugin("kirim", payload) diff --git a/src/models.rs b/src/models.rs index 285d0b2..4a1760a 100644 --- a/src/models.rs +++ b/src/models.rs @@ -2,20 +2,20 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Default, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] -pub struct SDaftarPerangkatBlueclasClassicResponDaftarPerangkat { +pub struct SDaftarPerangkatBlueclasResponDaftarPerangkat { pub nama: String, pub alamat: String, } #[derive(Debug, Clone, Default, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] -pub struct SBlueclasClassicResponDaftarPerangkat { - pub data: Vec, +pub struct SBlueclasResponDaftarPerangkat { + pub data: Vec, } #[derive(Debug, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] -pub struct SBlueclasClassicMuatanKirim { +pub struct SBlueclasMuatanKirim { pub alamat: String, pub data: Vec, } -- 2.52.0