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

pub struct TestAction {
    pub model: TestModel,
}

impl Action for TestAction {
    fn title(&mut self) -> &'static str { "测试动作" }
    fn name(&mut self) -> &'static str { "tests.test.test" }
    fn params(&mut self) -> JsonValue {
        return object! {};
    }
    fn index(&mut self, _header: JsonValue, _request: JsonValue) -> Response {
        self.success(object! {}, "动作不存在");
        self.fail("动作不存在")
    }
}