pub trait Module:
Send
+ Sync
+ 'static {
Show 27 methods
// Required methods
fn title(&self) -> &'static str;
fn action(&mut self, name: &str) -> Result<Box<dyn Action>, String>;
// Provided methods
fn _name(&self) -> &'static str { ... }
fn module_name(&self) -> &'static str { ... }
fn description(&self) -> &'static str { ... }
fn tags(&self) -> &'static [&'static str] { ... }
fn icon(&self) -> &'static str { ... }
fn table(&self) -> bool { ... }
fn _table_name(&self) -> &'static str { ... }
fn table_key(&self) -> &'static str { ... }
fn table_unique(&self) -> &'static [&'static str] { ... }
fn table_index(&self) -> &'static [&'static [&'static str]] { ... }
fn table_partition(&self) -> bool { ... }
fn table_partition_columns(&self) -> JsonValue { ... }
fn fields(&mut self) -> JsonValue { ... }
fn init_data(&mut self) -> JsonValue { ... }
fn tools(&mut self) -> Tools { ... }
fn set_global_data(&mut self, key: &str, value: JsonValue) { ... }
fn get_global_data(&mut self) -> JsonValue { ... }
fn get_global_data_key(&mut self, key: &str) -> JsonValue { ... }
fn db_table(&mut self) -> Db { ... }
fn db_find(&mut self, id: &str) -> JsonValue { ... }
fn db_select(&mut self, ids: &str) -> JsonValue { ... }
fn db_insert(&mut self, data: JsonValue) -> String { ... }
fn db_delete(&mut self, id: &str) -> usize { ... }
fn db_update(&mut self, id: &str, data: JsonValue) -> usize { ... }
fn handle(&mut self) { ... }
}Expand description
模型配置
Required Methods§
Provided Methods§
Sourcefn module_name(&self) -> &'static str
fn module_name(&self) -> &'static str
模型名称 xxx.xxx
Sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
模型描述
可用范围
Sourcefn _table_name(&self) -> &'static str
fn _table_name(&self) -> &'static str
数据库表名称
Sourcefn table_unique(&self) -> &'static [&'static str]
fn table_unique(&self) -> &'static [&'static str]
唯一索引
Sourcefn table_index(&self) -> &'static [&'static [&'static str]]
fn table_index(&self) -> &'static [&'static [&'static str]]
查询索引
Sourcefn table_partition(&self) -> bool
fn table_partition(&self) -> bool
是否分区
Sourcefn table_partition_columns(&self) -> JsonValue
fn table_partition_columns(&self) -> JsonValue
分区配置 *列名 *分区key *实例 array![str, array![range1, range2, range3…]] *如果在已有分区的情况下想要修改分区的参照列,先要将当前分区代码删除后刷库,然后写新的分区规则再刷库
Sourcefn set_global_data(&mut self, key: &str, value: JsonValue)
fn set_global_data(&mut self, key: &str, value: JsonValue)
设置全局变量
Sourcefn get_global_data(&mut self) -> JsonValue
fn get_global_data(&mut self) -> JsonValue
获取全局变量数据
Sourcefn get_global_data_key(&mut self, key: &str) -> JsonValue
fn get_global_data_key(&mut self, key: &str) -> JsonValue
获取全局变量指定字段数据