q149072205
V2EX  ›  Java

Java 在 aop 里执行注解里面的方法并得到结果要怎么写啊

  •  
  •   q149072205 · Dec 22, 2020 · 2626 views
    This topic created in 1972 days ago, the information mentioned may be changed or developed.

    @PreAuthorize("@ss.hasPermi('system:post:list')") public list list(SysPost post) {....}

    @PreAuthorize 我想要写一个类似这个的功能,想要在 AOP 的 Aspect 的 round 里面去执行注解里面的方法并得到结果要怎么实现啊。。

    4 replies    2020-12-22 22:07:05 +08:00
    MIUIOS
        1
    MIUIOS  
       Dec 22, 2020
    建议看一下文档再来提问
    RedBeanIce
        2
    RedBeanIce  
       Dec 22, 2020
    请增加你的问题描述。
    terry0314
        3
    terry0314  
       Dec 22, 2020
    可以直接去看看这个注解的实现啊,不过如果你用 Spring,试试 SpEL ?
    EminemW
        4
    EminemW  
       Dec 22, 2020
    反射一个注解对象,然后不就能执行么
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2873 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 11:02 · PVG 19:02 · LAX 04:02 · JFK 07:02
    ♥ Do have faith in what you're doing.