q149072205
V2EX  ›  Java

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

  •  
  •   q149072205 · Dec 22, 2020 · 3069 views
    This topic created in 2150 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
    MIUIOS
    Dec 22, 2020
    1
    建议看一下文档再来提问
    RedBeanIce
    RedBeanIce
    Dec 22, 2020
    2
    请增加你的问题描述。
    terry0314
    terry0314
    Dec 22, 2020
    3
    可以直接去看看这个注解的实现啊,不过如果你用 Spring,试试 SpEL ?
    EminemW
    EminemW
    Dec 22, 2020
    4
    反射一个注解对象,然后不就能执行么
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4998 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 02:17 · PVG 10:17 · LAX 18:17 · JFK 21:17
    ♥ Do have faith in what you're doing.