1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use json::{JsonValue, object};
use crate::{Action, Db, Response};
use crate::tests::test::TestModel;

pub struct TestAction {
    pub model: TestModel,
}

impl Action for TestAction {
    fn title(&mut self) -> String { "测试动作".to_string() }
    fn name(&mut self) -> String { "tests.test.test".to_string() }
    fn params(&mut self) -> JsonValue {
        return object! {};
    }
    fn index(&mut self, _header: JsonValue, request: JsonValue, _db: Db) -> Response {
        self.fail(-1, request, "动作不存在")
    }
}