Trait Action

Source
pub trait Action {
Show 40 methods // Required methods fn title(&self) -> &'static str; fn index(&mut self, request: Request) -> ApiResponse; // Provided methods fn _name(&self) -> String { ... } fn api(&self) -> String { ... } fn token(&self) -> bool { ... } fn version(&self) -> &'static str { ... } fn author(&self) -> &'static str { ... } fn sort(&self) -> usize { ... } fn description(&self) -> &'static str { ... } fn path(&self) -> &'static str { ... } fn query(&self) -> JsonValue { ... } fn tags(&self) -> &'static [&'static str] { ... } fn icon(&self) -> &'static str { ... } fn public(&self) -> bool { ... } fn auth(&self) -> bool { ... } fn interface_type(&self) -> InterfaceType { ... } fn method(&mut self) -> Method { ... } fn content_type(&mut self) -> ContentType { ... } fn params_check(&mut self) -> bool { ... } fn params(&mut self) -> JsonValue { ... } fn success(&mut self) -> ApiResponse { ... } fn error(&mut self) -> ApiResponse { ... } fn run(&mut self, request: Request) -> Result<ApiResponse, ApiResponse> { ... } fn check( &mut self, request: &mut JsonValue, params: JsonValue, ) -> Result<(), ApiResponse> { ... } fn params_table_select(&mut self, params: JsonValue) -> JsonValue { ... } fn table_select( &mut self, request: JsonValue, table_name: &str, fields: Vec<&str>, ) -> JsonValue { ... } fn params_table_menu(&mut self, params: JsonValue) -> JsonValue { ... } fn table_menu( &mut self, request: JsonValue, table_name: &str, label_field: &str, fields: JsonValue, hidd_field: Vec<&str>, show_field: Vec<&str>, search_fields: Vec<&str>, _filter_fields: Vec<&str>, ) -> JsonValue { ... } fn params_table_tree(&mut self, params: JsonValue) -> JsonValue { ... } fn table_tree( &mut self, request: JsonValue, table_name: &str, pid_field: &str, label_field: &str, fields: JsonValue, hidd_field: Vec<&str>, show_field: Vec<&str>, search_fields: Vec<&str>, _filter_fields: Vec<&str>, ) -> JsonValue { ... } fn params_table_list(&mut self, params: JsonValue) -> JsonValue { ... } fn table_list( &mut self, request: JsonValue, table_name: &str, fields: JsonValue, hidd_field: Vec<&str>, show_field: Vec<&str>, search_fields: Vec<&str>, filter_fields: Vec<&str>, ) -> JsonValue { ... } fn table_column(&mut self, field: JsonValue) -> JsonValue { ... } fn filter_column(&mut self, field: JsonValue) -> JsonValue { ... } fn tools(&mut self) -> Tools { ... } fn config(&mut self, name: &str) -> JsonValue { ... } fn btn(&mut self) -> Btn { ... } 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 { ... }
}
Expand description

功能接口

Required Methods§

Source

fn title(&self) -> &'static str

功能标题

Source

fn index(&mut self, request: Request) -> ApiResponse

内部入口

Provided Methods§

Source

fn _name(&self) -> String

功能名称

Source

fn api(&self) -> String

API 名称

Source

fn token(&self) -> bool

是否需要密钥

Source

fn version(&self) -> &'static str

版本号

Source

fn author(&self) -> &'static str

作者

Source

fn sort(&self) -> usize

Source

fn description(&self) -> &'static str

功能描述

Source

fn path(&self) -> &'static str

请求地址路径

Source

fn query(&self) -> JsonValue

请求地址参数

Source

fn tags(&self) -> &'static [&'static str]

归属标签

Source

fn icon(&self) -> &'static str

Source

fn public(&self) -> bool

是否公开

Source

fn auth(&self) -> bool

是否权限组显示

Source

fn interface_type(&self) -> InterfaceType

接口类型 btn api menu

Source

fn method(&mut self) -> Method

允许的请求类型

Source

fn content_type(&mut self) -> ContentType

请求类型

Source

fn params_check(&mut self) -> bool

是否检查参数

Source

fn params(&mut self) -> JsonValue

请求body参数

Source

fn success(&mut self) -> ApiResponse

成功响应

Source

fn error(&mut self) -> ApiResponse

失败响应

Source

fn run(&mut self, request: Request) -> Result<ApiResponse, ApiResponse>

外部入口

Source

fn check( &mut self, request: &mut JsonValue, params: JsonValue, ) -> Result<(), ApiResponse>

入参验证

Source

fn params_table_select(&mut self, params: JsonValue) -> JsonValue

Source

fn table_select( &mut self, request: JsonValue, table_name: &str, fields: Vec<&str>, ) -> JsonValue

Source

fn params_table_menu(&mut self, params: JsonValue) -> JsonValue

菜单表格接收参数

Source

fn table_menu( &mut self, request: JsonValue, table_name: &str, label_field: &str, fields: JsonValue, hidd_field: Vec<&str>, show_field: Vec<&str>, search_fields: Vec<&str>, _filter_fields: Vec<&str>, ) -> JsonValue

Source

fn params_table_tree(&mut self, params: JsonValue) -> JsonValue

树型表格接收参数

Source

fn table_tree( &mut self, request: JsonValue, table_name: &str, pid_field: &str, label_field: &str, fields: JsonValue, hidd_field: Vec<&str>, show_field: Vec<&str>, search_fields: Vec<&str>, _filter_fields: Vec<&str>, ) -> JsonValue

Source

fn params_table_list(&mut self, params: JsonValue) -> JsonValue

表格接收参数

Source

fn table_list( &mut self, request: JsonValue, table_name: &str, fields: JsonValue, hidd_field: Vec<&str>, show_field: Vec<&str>, search_fields: Vec<&str>, filter_fields: Vec<&str>, ) -> JsonValue

列表表格渲染

  • table_name 表名
  • fields 全部模型字段集合
  • hidd_field 需要隐藏的字段集合
  • show_field 需要显示的字段集合
  • search_fields 搜索字段集合
  • filter_fields 高级搜索字段集合
Source

fn table_column(&mut self, field: JsonValue) -> JsonValue

Source

fn filter_column(&mut self, field: JsonValue) -> JsonValue

Source

fn tools(&mut self) -> Tools

使用工具

Source

fn config(&mut self, name: &str) -> JsonValue

使用配置

Source

fn btn(&mut self) -> Btn

按钮信息

  • cnd 显示条件 vec![vec![“xxx”,“=”,“yyy”],vec![“zzz”,“=”,“eee”]]
Source

fn set_global_data(&mut self, key: &str, value: JsonValue)

设置全局变量

Source

fn get_global_data(&mut self) -> JsonValue

获取全局变量数据

Source

fn get_global_data_key(&mut self, key: &str) -> JsonValue

获取全局变量指定字段数据

Implementors§