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§
Provided Methods§
Sourcefn description(&self) -> String
fn description(&self) -> String
功能描述
Sourcefn interface_type(&mut self) -> InterfaceType
fn interface_type(&mut self) -> InterfaceType
接口类型 btn api menu
Sourcefn content_type(&mut self) -> ContentType
fn content_type(&mut self) -> ContentType
请求类型
Sourcefn success(&mut self) -> ApiResponse
fn success(&mut self) -> ApiResponse
成功响应
Sourcefn error(&mut self) -> ApiResponse
fn error(&mut self) -> ApiResponse
失败响应
Sourcefn run(&mut self, request: Request) -> Result<ApiResponse, ApiResponse>
fn run(&mut self, request: Request) -> Result<ApiResponse, ApiResponse>
外部入口
Sourcefn params_table_list(&mut self) -> JsonValue
fn params_table_list(&mut self) -> JsonValue
表格接收参数