Memperbaiki penamaan struktur
This commit is contained in:
+4
-4
@@ -1,20 +1,20 @@
|
|||||||
use tauri::{command, AppHandle, Runtime};
|
use tauri::{AppHandle, Runtime, command};
|
||||||
|
|
||||||
use crate::models::*;
|
|
||||||
use crate::BluclasExt;
|
use crate::BluclasExt;
|
||||||
use crate::Result;
|
use crate::Result;
|
||||||
|
use crate::models::*;
|
||||||
|
|
||||||
#[command]
|
#[command]
|
||||||
pub(crate) async fn daftar_perangkat<R: Runtime>(
|
pub(crate) async fn daftar_perangkat<R: Runtime>(
|
||||||
app: AppHandle<R>,
|
app: AppHandle<R>,
|
||||||
) -> Result<SBlueclasClassicResponDaftarPerangkat> {
|
) -> Result<SBlueclasResponDaftarPerangkat> {
|
||||||
return app.bluclas().daftar_perangkat();
|
return app.bluclas().daftar_perangkat();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[command]
|
#[command]
|
||||||
pub(crate) async fn kirim<R: Runtime>(
|
pub(crate) async fn kirim<R: Runtime>(
|
||||||
app: AppHandle<R>,
|
app: AppHandle<R>,
|
||||||
payload: SBlueclasClassicMuatanKirim,
|
payload: SBlueclasMuatanKirim,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
return app.bluclas().kirim(payload);
|
return app.bluclas().kirim(payload);
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -1,5 +1,5 @@
|
|||||||
use serde::de::DeserializeOwned;
|
use serde::de::DeserializeOwned;
|
||||||
use tauri::{plugin::PluginApi, AppHandle, Runtime};
|
use tauri::{AppHandle, Runtime, plugin::PluginApi};
|
||||||
|
|
||||||
use crate::models::*;
|
use crate::models::*;
|
||||||
|
|
||||||
@@ -14,11 +14,11 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
|
|||||||
pub struct Bluclas<R: Runtime>(AppHandle<R>);
|
pub struct Bluclas<R: Runtime>(AppHandle<R>);
|
||||||
|
|
||||||
impl<R: Runtime> Bluclas<R> {
|
impl<R: Runtime> Bluclas<R> {
|
||||||
pub fn daftar_perangkat(&self) -> crate::Result<SBlueclasClassicResponDaftarPerangkat> {
|
pub fn daftar_perangkat(&self) -> crate::Result<SBlueclasResponDaftarPerangkat> {
|
||||||
return Ok(SBlueclasClassicResponDaftarPerangkat { data: vec![] });
|
return Ok(SBlueclasResponDaftarPerangkat { data: vec![] });
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn kirim(&self, _: SBlueclasClassicMuatanKirim) -> crate::Result<()> {
|
pub fn kirim(&self, _: SBlueclasMuatanKirim) -> crate::Result<()> {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
use serde::de::DeserializeOwned;
|
use serde::de::DeserializeOwned;
|
||||||
use tauri::{
|
use tauri::{
|
||||||
plugin::{PluginApi, PluginHandle},
|
|
||||||
AppHandle, Runtime,
|
AppHandle, Runtime,
|
||||||
|
plugin::{PluginApi, PluginHandle},
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::models::*;
|
use crate::models::*;
|
||||||
@@ -25,14 +25,14 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
|
|||||||
pub struct Bluclas<R: Runtime>(PluginHandle<R>);
|
pub struct Bluclas<R: Runtime>(PluginHandle<R>);
|
||||||
|
|
||||||
impl<R: Runtime> Bluclas<R> {
|
impl<R: Runtime> Bluclas<R> {
|
||||||
pub fn daftar_perangkat(&self) -> crate::Result<SBlueclasClassicResponDaftarPerangkat> {
|
pub fn daftar_perangkat(&self) -> crate::Result<SBlueclasResponDaftarPerangkat> {
|
||||||
return self
|
return self
|
||||||
.0
|
.0
|
||||||
.run_mobile_plugin("daftarPerangkat", ())
|
.run_mobile_plugin("daftarPerangkat", ())
|
||||||
.map_err(Into::into);
|
.map_err(Into::into);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn kirim(&self, payload: SBlueclasClassicMuatanKirim) -> crate::Result<()> {
|
pub fn kirim(&self, payload: SBlueclasMuatanKirim) -> crate::Result<()> {
|
||||||
return self
|
return self
|
||||||
.0
|
.0
|
||||||
.run_mobile_plugin("kirim", payload)
|
.run_mobile_plugin("kirim", payload)
|
||||||
|
|||||||
+4
-4
@@ -2,20 +2,20 @@ use serde::{Deserialize, Serialize};
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct SDaftarPerangkatBlueclasClassicResponDaftarPerangkat {
|
pub struct SDaftarPerangkatBlueclasResponDaftarPerangkat {
|
||||||
pub nama: String,
|
pub nama: String,
|
||||||
pub alamat: String,
|
pub alamat: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct SBlueclasClassicResponDaftarPerangkat {
|
pub struct SBlueclasResponDaftarPerangkat {
|
||||||
pub data: Vec<SDaftarPerangkatBlueclasClassicResponDaftarPerangkat>,
|
pub data: Vec<SDaftarPerangkatBlueclasResponDaftarPerangkat>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct SBlueclasClassicMuatanKirim {
|
pub struct SBlueclasMuatanKirim {
|
||||||
pub alamat: String,
|
pub alamat: String,
|
||||||
pub data: Vec<u8>,
|
pub data: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user