df-plugin 0.1.5

This is an Plugin
Documentation
use json::object;
use df_plugin::{Model, Plugin};

fn main() {
    let (code, data, msg) = plugin("goods").model("origin").action("count").run(object! {
        name:111,
        // code:2222
    });
    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 {})
    }
}