Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module中的url映射需求! #860

Closed
muei opened this issue May 11, 2015 · 4 comments
Closed

module中的url映射需求! #860

muei opened this issue May 11, 2015 · 4 comments
Assignees
Labels
Milestone

Comments

@muei
Copy link

muei commented May 11, 2015

下面是当前的方式,函数都会基于类的url:

@At("/users")
public class UserModule {
      @At("/login")
      public void loginPage(){}

      @At("/login")
      @Post
      public void login(){}
      ...
}

需求是这样的,@OverriteAt后函数可以无视类的url:

@At("/users")
public class UserModule {
      @OverriteAt
      @At("/login","/users/login")
      public void loginPage(){}

      @At("/login")
      @Post
      public void login(){}
      ...
}

这个@OverriteAt是我意淫的,因为类上的@at后真的函数可以简洁很多,但是有时候又受限于这种简洁,所以...

@wendal
Copy link
Member

wendal commented May 11, 2015

其实你需要的是

@At(value="/login", top=true)

哈哈, top也是YY的,但可以考虑

@muei
Copy link
Author

muei commented May 11, 2015

nice!

@zozoh
Copy link
Member

zozoh commented May 12, 2015

@ohohco 为啥你有这个需求? 如果想顶级,为啥不写到另外一个类里?

@muei
Copy link
Author

muei commented May 12, 2015

更方便啦!当然我知道可以写在另一个类。比如api和web混合的放在一起就比较方便。

@wendal wendal closed this as completed in 7d97b1c Jun 7, 2015
@wendal wendal added the 需求 label Jun 7, 2015
@wendal wendal added this to the 1.b.53 milestone Jun 7, 2015
@wendal wendal self-assigned this Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants