feat(freelance): 创建插件 crate 骨架

This commit is contained in:
iven
2026-04-19 23:45:43 +08:00
parent a7a48167ca
commit fcf20dded1
3 changed files with 38 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ members = [
"crates/erp-plugin",
"crates/erp-plugin-crm",
"crates/erp-plugin-inventory",
"crates/erp-plugin-freelance",
]
[workspace.package]

View File

@@ -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"

View File

@@ -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<u8>) -> Result<(), String> {
Ok(())
}
}
export!(FreelancePlugin);