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

在一个方法上添加两个自定义annotation,这两个自定义annotation都用@Before修饰,而只有一个Before的invokeBy类中的方法被调用。 #49

Closed
qianqian78 opened this issue Sep 25, 2021 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@qianqian78
Copy link

//第一个annotation
@retention(AnnotationRetention.RUNTIME)
@target(AnnotationTarget.FUNCTION)
@MustBeDocumented

@before(invokeBy = [RoleCheck::class])
annotation class PreRole(
val value: String,
)
//第二个annotation
@retention(AnnotationRetention.RUNTIME)
@target(AnnotationTarget.FUNCTION)
@MustBeDocumented

@before(invokeBy = [PermissionCheck::class])
annotation class PreAuthorize(
val value: String,
)

//
@API("/api/log")
class LogController : Resource() {

@GET("/list")
@PreRole("admin")
@PreAuthorize("log:list")
suspend fun list() {
  //......
}

}

跟踪代码发现:
问题在NextServer.kt 第169行,beforeRouteHandlersTable[resourceUrl]?.get(httpMethod)?.plus(annotation)

@T-baby T-baby self-assigned this Sep 26, 2021
@T-baby T-baby added the feature label Sep 26, 2021
@T-baby T-baby added this to the 3.0.2.0 milestone Sep 26, 2021
@T-baby T-baby added bug Something isn't working and removed feature labels Sep 26, 2021
@T-baby
Copy link
Contributor

T-baby commented Sep 26, 2021

预计下版本解决。

@T-baby
Copy link
Contributor

T-baby commented Sep 26, 2021

已经在开发分支上修复:f6b5231

@T-baby
Copy link
Contributor

T-baby commented Sep 26, 2021

3.0.2.0-SNAPSHOT 版本已经更新了这个提交。

@T-baby T-baby closed this as completed in f6b5231 Oct 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants