想只在子模块上配置注解让所有子模块入口函数都用相同的注解
3 回复
@IocBean
@At("test")
@RequiresRoles(value = {"admin","factory"},logical = Logical.OR)//想把注解写在这,然后下面的入口函数都会校验用户是否属于该角色,但是测试了一下写在这注解不会生效
public class Router
{
@At("/test1")
@Ok("raw")
@Fail("jsp:jsp.500")
//@RequiresRoles(value = {"factory","admin"},logical = Logical.OR)
public String test1(int a, int b, @Attr("me")int me)
{
if(me==0)
throw new RuntimeException("");
return "ok1";
}
@At("/test2")
@Ok("raw")
@Fail("jsp:jsp.500")
//@RequiresRoles(value = {"factory","admin"},logical = Logical.OR)
public String test2(int a, int b, @Attr("me")int me)
{
if(me==0)
throw new RuntimeException("");
return "ok2";
}
}
添加回复
请先登陆