首页 新闻 会员 周边

springboot 自定义注解,并在控制器使用注解拦截访问权限

0
[待解决问题]

自定义注解

@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Permission {

String menuId() default "";

String opcode() default "";
}

 

在控制器使用注解

@Permission(menuId="1",opcode="")
@RequestMapping(value = "getconfig", method = RequestMethod.GET)
public JsonData getConfig(HttpServletRequest request) {

}

 

如何解释注解,根据menuId和opcode的值控制控制器方法是否有权限访问?

icyhoo的主页 icyhoo | 菜鸟二级 | 园豆:204
提问于:2017-07-31 10:14
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册