Trait Action

Source
pub trait Action {
Show 32 methods // Required methods fn title(&mut self) -> &'static str; fn index(&mut self, header: JsonValue, request: JsonValue) -> Response; // Provided methods fn author(&mut self) -> &'static str { ... } fn api(&mut self) -> String { ... } fn mode(&mut self) -> Vec<&'static str> { ... } fn icon(&mut self) -> &'static str { ... } fn menu_sort(&mut self) -> usize { ... } fn openapi(&mut self) -> bool { ... } fn token(&mut self) -> bool { ... } fn describe(&mut self) -> &'static str { ... } fn public(&mut self) -> bool { ... } fn auth(&mut self) -> bool { ... } fn interface_type(&mut self) -> InterfaceType { ... } fn dependent(&mut self) -> Vec<&'static str> { ... } fn params(&mut self) -> JsonValue { ... } fn _check(&mut self, request: JsonValue) -> (bool, String, JsonValue) { ... } fn run(&mut self, header: JsonValue, request: JsonValue) -> Response { ... } fn get( &mut self, header: JsonValue, request: JsonValue, ) -> Result<JsonValue, String> { ... } fn success(&mut self, data: JsonValue, msg: &str) -> Response { ... } fn fail(&mut self, msg: &str) -> Response { ... } fn error(&mut self, code: usize, msg: String) -> Response { ... } fn notify(&mut self, msg: &str, btn_name: &str, path: &str) -> Response { ... } fn login(&mut self, msg: &str) -> Response { ... } fn download(&mut self, filename: &str) -> Response { ... } fn download_delete_dir(&mut self, filename: &str) -> Response { ... } fn redirect(&mut self, url: &str) -> Response { ... } fn tools(&mut self) -> Tools { ... } fn menu_info(&mut self, title: &str) -> JsonValue { ... } fn btn_info_data(&mut self, title: &str) -> JsonValue { ... } fn btn_info( &mut self, title: &str, mode: BtnMode, color: BtnColor, match_condition: Vec<Vec<&str>>, ) -> JsonValue { ... } fn btn_info_to( &mut self, title: &str, path: &str, mode: BtnMode, color: BtnColor, match_condition: Vec<Vec<&str>>, ) -> JsonValue { ... } fn btn_custom_info(&mut self, title: &str) -> JsonValue { ... }
}
Expand description

动作

Required Methods§

Source

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

动标题

Source

fn index(&mut self, header: JsonValue, request: JsonValue) -> Response

Provided Methods§

Source

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

作者

Source

fn api(&mut self) -> String

动作api

Source

fn mode(&mut self) -> Vec<&'static str>

支持模式 org 企业模式 admin 平台模式 user 普通模式

Source

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

菜单 icon

Source

fn menu_sort(&mut self) -> usize

菜单排序

Source

fn openapi(&mut self) -> bool

是否开放接口

Source

fn token(&mut self) -> bool

是否使用密钥

Source

fn describe(&mut self) -> &'static str

API描述

Source

fn public(&mut self) -> bool

是否公开

Source

fn auth(&mut self) -> bool

是否权限组显示

Source

fn interface_type(&mut self) -> InterfaceType

接口类型 btn api menu

Source

fn dependent(&mut self) -> Vec<&'static str>

依赖接口

Source

fn params(&mut self) -> JsonValue

请求参数入口

Source

fn _check(&mut self, request: JsonValue) -> (bool, String, JsonValue)

检测

Source

fn run(&mut self, header: JsonValue, request: JsonValue) -> Response

执行参数入口

Source

fn get( &mut self, header: JsonValue, request: JsonValue, ) -> Result<JsonValue, String>

执行参数入口

Source

fn success(&mut self, data: JsonValue, msg: &str) -> Response

业务成功返回

Source

fn fail(&mut self, msg: &str) -> Response

业务错误返回

Source

fn error(&mut self, code: usize, msg: String) -> Response

业务错误返回

Source

fn notify(&mut self, msg: &str, btn_name: &str, path: &str) -> Response

Source

fn login(&mut self, msg: &str) -> Response

登陆返回

Source

fn download(&mut self, filename: &str) -> Response

下载返回

Source

fn download_delete_dir(&mut self, filename: &str) -> Response

下载并删除文件所在目录

Source

fn redirect(&mut self, url: &str) -> Response

重定型返回

Source

fn tools(&mut self) -> Tools

获取工具集合

Source

fn menu_info(&mut self, title: &str) -> JsonValue

获取菜单信息

  • title 菜单名称
Source

fn btn_info_data(&mut self, title: &str) -> JsonValue

Source

fn btn_info( &mut self, title: &str, mode: BtnMode, color: BtnColor, match_condition: Vec<Vec<&str>>, ) -> JsonValue

获取按钮信息

  • title 菜单名称
  • mode 按钮模式
  • color 按钮颜色
  • match_condition 显示条件
Source

fn btn_info_to( &mut self, title: &str, path: &str, mode: BtnMode, color: BtnColor, match_condition: Vec<Vec<&str>>, ) -> JsonValue

获取跳转按钮信息

  • title 菜单名称
  • mode 按钮模式
  • color 按钮颜色
  • match_condition 显示条件
Source

fn btn_custom_info(&mut self, title: &str) -> JsonValue

获取自定义页面按钮信息

  • title 菜单名称
  • mode 按钮模式
  • color 按钮颜色
  • match_condition 显示条件

Implementors§