use br_addon::action::Action;
use br_addon::module::Module;
use br_fields::Field;
use json::{object, JsonValue};
#[derive(Debug, Clone)]
pub struct DmsTask {}
impl Module for DmsTask {
fn title(&self) -> &'static str { "测量任务"}
fn table(&self) -> bool {false}
fn table_unique(&self) -> &'static [&'static str] { &[] }
fn table_index(&self) -> &'static [&'static [&'static str]] { &[] }
fn fields(&mut self) -> JsonValue {
let fields = object! {};
fields
}
fn action(&mut self, name: &str) -> Result<Box<dyn Action>, String> {
Ok(match name {
"table" => Box::new(DmsTaskTable {module: self.clone(),}),
"add" => Box::new(DmsTaskAdd {module: self.clone(),}),
"del" => Box::new(DmsTaskDel {module: self.clone(),}),
"get" => Box::new(DmsTaskGet {module: self.clone(),}),
"put" => Box::new(DmsTaskPut {module: self.clone(),}),
"select" => Box::new(DmsTaskSelect {module: self.clone(),}),
_ => return Err(format!("invalid action: {name}")),
})
}
}
mod table;
mod add;
mod del;
mod get;
mod put;
mod select;