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

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

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