批注接口 Idempotent


@Inherited @Target(METHOD) @Retention(RUNTIME) public @interface Idempotent
幂等注解
  • 可选元素概要

    可选元素
    修饰符和类型
    可选元素
    说明
    boolean
    是否在业务完成后删除key true:删除 false:不删除
    int
    有效期 默认:1 有效期要大于程序执行时间,否则请求还是可能会进来
    提示信息,可自定义
    幂等操作的唯一标识,使用spring el表达式 用#来引用方法参数
    时间单位 默认:s
  • 元素详细资料

    • key

      String key
      幂等操作的唯一标识,使用spring el表达式 用#来引用方法参数
      返回:
      Spring-EL expression
      默认值:
      ""
    • expireTime

      int expireTime
      有效期 默认:1 有效期要大于程序执行时间,否则请求还是可能会进来
      返回:
      expireTime
      默认值:
      1
    • timeUnit

      TimeUnit timeUnit
      时间单位 默认:s
      返回:
      TimeUnit
      默认值:
      SECONDS
    • info

      String info
      提示信息,可自定义
      返回:
      String
      默认值:
      "\u91cd\u590d\u8bf7\u6c42\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5"
    • delKey

      boolean delKey
      是否在业务完成后删除key true:删除 false:不删除
      返回:
      boolean
      默认值:
      false