Trait df_plugin::Action

source ·
pub trait Action {
    // Required methods
    fn title(&mut self) -> String;
    fn name(&mut self) -> String;
    fn index(
&mut self,
header: JsonValue,
request: JsonValue,
tools: Tools
) -> Response; // Provided methods fn token(&mut self) -> bool { ... } fn public(&mut self) -> bool { ... } fn extend(&mut self) -> Vec<&str> { ... } fn params(&mut self) -> JsonValue { ... } fn _check(&mut self, request: JsonValue) -> (bool, String, JsonValue) { ... } fn run(
&mut self,
header: JsonValue,
request: JsonValue,
tools: Tools
) -> Response { ... } fn success(&mut self, data: JsonValue, msg: &str) -> Response { ... } fn fail(&mut self, msg: &str) -> Response { ... } fn login(&mut self, msg: &str) -> Response { ... } }
Expand description

动作

Required Methods§

source

fn title(&mut self) -> String

标题

source

fn name(&mut self) -> String

api名称

source

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

Provided Methods§

source

fn token(&mut self) -> bool

是否使用密钥

source

fn public(&mut self) -> bool

是否公开

source

fn extend(&mut self) -> Vec<&str>

扩展 db cache kafka

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, tools: Tools) -> Response

执行参数入口

source

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

source

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

source

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

Implementors§