use json::object;
use df_plugin::{Model, Plugin};
fn main() {
let (code, data, msg) = plugin("goods").model("origin").action("count").run(object! {
name:111,
});
println!("{} {} {}", code, msg, data);
}
struct Goods {}
impl Plugin for Goods {
fn model(&mut self, name: &str) -> Box<dyn Model> {
todo!()
}
}
fn plugin(name: &str) -> Box<dyn Plugin> {
match name {
"goods" => Box::new(Goods {}),
_ => Box::new(Goods {})
}
}