All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lx.boot.lock.Lock Maven / Gradle / Ivy

Go to download

使用文档: https://a7fi97h1rc.feishu.cn/docx/X3LRdtLhkoXQ8hxgXDQc2CLOnEg?from=from_copylink

There is a newer version: 1.1
Show newest version
package com.lx.boot.lock;

import com.lx.annotation.Note;

import java.lang.annotation.*;

/**
 * @author ylx
 * @version v1
 * @summary 方法分布式锁
 */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Lock{

    @Note("redis锁的key 默认为类名+方法名, 支持spel表达式, 例如: " +
            "对象形式: #{#dto.orderNo}" +
            "Map #{#map['key']}")
    String key() default "";

    @Note("锁持续时间 单位秒 默认1分钟")
    int lockTime() default 60;

    @Note("请求锁的超时时间(单位:毫秒)")
    long timetOut() default 300L;

    @Note("未获取到锁时的提示")
    String errorMessage() default "操作过快,请稍后重试!";
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy