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

pub struct TestAction {
    pub model: TestModel,
}

impl Action for TestAction {
    fn extend(&mut self) -> Vec<&str> {
        vec!["db", "cache", "kafka"]
    }
    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, _tools: Tools) -> Response {
        self.fail("动作不存在")
    }
}