V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
kikione
V2EX  ›  程序员

公共模块 spring aop ,想要扫描所有模块的 controller 接口,切点如何配置?

  •  
  •   kikione · Oct 20, 2021 · 1762 views
    This topic created in 1660 days ago, the information mentioned may be changed or developed.

    公共模块 aop,扫描所有模块的 controller 接口,切点如何配置?

    execution(* com.hao.mimi.controller...(..)))"

    类似这种只能扫描自己的模块

    6 replies    2021-10-20 18:05:37 +08:00
    BQsummer
        1
    BQsummer  
       Oct 20, 2021
    @Pointcut("within(@org.springframework.web.bind.annotation.RestController *) || within(@org.springframework.stereotype.Controller *)")
    kikione
        2
    kikione  
    OP
       Oct 20, 2021
    @BQsummer 谢谢大哥
    icelo
        3
    icelo  
       Oct 20, 2021 via iPhone
    我觉得用自定义注解配置会很好
    icelo
        4
    icelo  
       Oct 20, 2021 via iPhone
    如果是所有的当我没说
    kikione
        5
    kikione  
    OP
       Oct 20, 2021
    @icelo 本来是想自定义注解,要加的太多了,臣妾改不动了
    wolfie
        6
    wolfie  
       Oct 20, 2021
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5639 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 03:48 · PVG 11:48 · LAX 20:48 · JFK 23:48
    ♥ Do have faith in what you're doing.