use json::{JsonValue, object}; use br_plugin::addon::AddonTemp; use br_plugin::model::{Model, ModelTemp}; use br_plugin::action::{Action, ActionTemp}; pub struct {{model}} { pub addon: {{addon}} } impl Model for {{model}} { fn name(&mut self) -> &'static str { "{{model_name}}" } fn title(&mut self) -> &'static str { "{{title}}"} fn table(&mut self) -> &'static str { "{{plugin_model}}"} fn unique(&mut self) -> Vec<&'static str> { vec![] } fn index(&mut self) -> Vec> { vec![] } fn fields(&mut self) -> JsonValue { let fields = object! {}; return fields; } fn action(&mut self, name: &str) -> Box { match name { "menu" => Box::new({{model}}Menu { model: {{model}} {addon: {{addon}} {}} }), "table" => Box::new({{model}}Table { model: {{model}} {addon: {{addon}} {}} }), "add" => Box::new({{model}}Add { model: {{model}} {addon: {{addon}} {}} }), "del" => Box::new({{model}}Del { model: {{model}} {addon: {{addon}} {}} }), "get" => Box::new({{model}}Get { model: {{model}} {addon: {{addon}} {}} }), "put" => Box::new({{model}}Put { model: {{model}} {addon: {{addon}} {}} }), "select" => Box::new({{model}}Select { model: {{model}} {addon: {{addon}} {}} }), _ => Box::new(ActionTemp { model: ModelTemp { addon: AddonTemp {} } }), } } } pub mod menu; pub mod table; pub mod add; pub mod del; pub mod get; pub mod put; pub mod select;