From fcf20dded1e1cb3f41ca933ea24dd229e8a23df6 Mon Sep 17 00:00:00 2001 From: iven Date: Sun, 19 Apr 2026 23:45:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(freelance):=20=E5=88=9B=E5=BB=BA=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=20crate=20=E9=AA=A8=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.toml | 1 + crates/erp-plugin-freelance/Cargo.toml | 11 +++++++++++ crates/erp-plugin-freelance/src/lib.rs | 26 ++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 crates/erp-plugin-freelance/Cargo.toml create mode 100644 crates/erp-plugin-freelance/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index fb13659..8e034f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ members = [ "crates/erp-plugin", "crates/erp-plugin-crm", "crates/erp-plugin-inventory", + "crates/erp-plugin-freelance", ] [workspace.package] diff --git a/crates/erp-plugin-freelance/Cargo.toml b/crates/erp-plugin-freelance/Cargo.toml new file mode 100644 index 0000000..0444645 --- /dev/null +++ b/crates/erp-plugin-freelance/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "erp-plugin-freelance" +version = "0.1.0" +edition = "2024" +description = "自由职业者工作台 WASM 插件" + +[lib] +crate-type = ["cdylib"] + +[dependencies] +wit-bindgen = "0.55" diff --git a/crates/erp-plugin-freelance/src/lib.rs b/crates/erp-plugin-freelance/src/lib.rs new file mode 100644 index 0000000..d1e7b50 --- /dev/null +++ b/crates/erp-plugin-freelance/src/lib.rs @@ -0,0 +1,26 @@ +//! 自由职业者工作台 WASM 插件 + +wit_bindgen::generate!({ + path: "../erp-plugin-prototype/wit/plugin.wit", + world: "plugin-world", +}); + +use crate::exports::erp::plugin::plugin_api::Guest; + +struct FreelancePlugin; + +impl Guest for FreelancePlugin { + fn init() -> Result<(), String> { + Ok(()) + } + + fn on_tenant_created(_tenant_id: String) -> Result<(), String> { + Ok(()) + } + + fn handle_event(_event_type: String, _payload: Vec) -> Result<(), String> { + Ok(()) + } +} + +export!(FreelancePlugin);