NutzCN Logo
问答 请问nutzboot的@At可以如何实现入口统一
发布于 2078天前 作者 文涛(wentao) 1782 次浏览 复制 上一个帖子 下一个帖子
标签:

具体想实现注解里面的重复编写,想法如下:
我在http://localhost/manage/ 下面有n个页面

http://localhost/manage/user
http://localhost/manage/city
http://localhost/manage/config

我现在的方法不能实现,方法:
父类:

@At("/manage")
public class BaseModule() {}

子类

@At("/user")
public class UserModule() {}

现在只能访问:http://localhost/user
不能访问:http://localhost/manage/user

5 回复

修正,子类是这样的:

@At("/user")
public class UserModule extends BaseModule() {} 

在MainLauncher添加一个@At

因为我还有其他模块,所以不能在MainLauncher中加这个

public class BaseModule() {}

@At("/manage/user")
public class UserModule extends BaseModule() {} 

@At("/manage/city")
public class CityModule extends BaseModule() {} 

BaseModule 只写共用函数和变量,不写任何 @At
不知道是否满足你的需求。

添加回复
请先登陆
回到顶部