@IocBean // 还记得@IocBy吗? 这个跟@IocBy有很大的关系哦
@At("/user")
@Ok("json")
@Fail("http:500")
public class UserModule {
@Inject
protected Dao dao; // 就这么注入了,有@IocBean它才会生效
@At("/login")
public String login() {
return String.valueOf(dao.count(User.class));
}
public String Test()
{
return "test";
}
}
17-07-05 10:38:02.464 DEBUG [qtp949314262-40] Search mapping for [GET] path=/ : NOT Action match
17-07-05 10:38:21.079 DEBUG [qtp949314262-17] Search mapping for [GET] path=/user : NOT Action match
17-07-05 10:38:30.128 DEBUG [qtp949314262-16] Search mapping for [GET] path=/user/login : NOT Action match