【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>
一、定义注解
import java.lang.annotation.*;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Deduplication {
String value();
}
二、定义aop类
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Slf4j
@Aspect
@Component
public class DeduplicationAspect {
private static final String CACHE_KEY = "deduplication";