• 请不要在回答技术问题时复制粘贴 AI 生成的内容
kikione
V2EX  ›  程序员

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

  •  
  •   kikione · Oct 20, 2021 · 1787 views
    This topic created in 1670 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   ·   2864 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 11:01 · PVG 19:01 · LAX 04:01 · JFK 07:01
    ♥ Do have faith in what you're doing.