br_addon::action

Trait Action

Source
pub trait Action {
Show 20 methods // Required methods fn title(&self) -> String; fn index(&mut self, request: Request) -> ApiResponse; // Provided methods fn name(&self) -> String { ... } fn api(&self) -> String { ... } fn token(&self) -> bool { ... } fn version(&self) -> String { ... } fn description(&self) -> String { ... } fn public(&mut self) -> bool { ... } fn auth(&mut self) -> bool { ... } fn interface_type(&mut self) -> InterfaceType { ... } fn method(&mut self) -> Method { ... } fn content_type(&mut self) -> ContentType { ... } 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) -> Result<(), ApiResponse> { ... } fn params_table_list(&mut self) -> JsonValue { ... } fn tools(&mut self) -> Tools { ... } fn btn_info( &mut self, btn_type: BtnType, btn_color: BtnColor, title: &str, desc: &str, url: &str, cnd: Vec<JsonValue>, ) -> JsonValue { ... }
}
Expand description

功能接口

Required Methods§

Source

fn title(&self) -> String

功能标题

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) -> String

版本号

Source

fn description(&self) -> String

功能描述

Source

fn public(&mut self) -> bool

是否公开

Source

fn auth(&mut self) -> bool

是否权限组显示

Source

fn interface_type(&mut self) -> InterfaceType

接口类型 btn api menu

Source

fn method(&mut self) -> Method

允许的请求类型

Source

fn content_type(&mut self) -> ContentType

请求类型

Source

fn params(&mut self) -> JsonValue

请求参数

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) -> Result<(), ApiResponse>

入参验证

Source

fn params_table_list(&mut self) -> JsonValue

表格接收参数

Source

fn tools(&mut self) -> Tools

使用工具

Source

fn btn_info( &mut self, btn_type: BtnType, btn_color: BtnColor, title: &str, desc: &str, url: &str, cnd: Vec<JsonValue>, ) -> JsonValue

按钮信息

  • cnd 显示条件

Implementors§