1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use json::{JsonValue};
use crate::{Action, Model, Response};
use crate::dict::tranmode::Tranmode;
pub struct Select {
pub model: Tranmode,
}
impl Action for Select {
fn title(&mut self) -> &'static str { "数据列表" }
fn name(&mut self) -> &'static str { "dict.tranmode.select" }
fn token(&mut self) -> bool { true }
fn params(&mut self) -> JsonValue {
return self.model.table_select_fields();
}
fn index(&mut self, _header: JsonValue, request: JsonValue) -> Response {
let list = self.model.table_select(request,vec!["name", "code"], vec![]);
return self.success(list, "ok");
}
}