I am looking for a pointcut expression that might satisfy my needs, I have already figured one out but seems to be having some performance issues, and I believe there should be an easier solution.
I have a lot of packages like
aaa.bbb.v3.groups.GroupController
,aaa.bbb.v3.groups.GroupService
,aaa.bbb.v3.products.ProductController
,aaa.bbb.v3.products.ProductService
.
What I wish to cover is all @RestController
calls inside my v3
package. I guess it should be something like this but cant figure it out for now:
execution(* aaa.bbb.v3.*.* Controller( * ))
My solution for now was
@Pointcut(
"within(@org.springframework.web.bind.annotation.RestController *) && " +
"execution(* aaa.bbb.v3.*..*(..))"
)
and it was working fine, but seems it has some performance issues as its analyzing all the code, and it should only be for controllers.