Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于keys,有几个问题想请教下 #25

Closed
xingye311 opened this issue Oct 31, 2019 · 3 comments
Closed

关于keys,有几个问题想请教下 #25

xingye311 opened this issue Oct 31, 2019 · 3 comments

Comments

@xingye311
Copy link

keys里面目前支持添加常量么?还有从实体类里取值做key的时候,当某个取值是null的时候,会报空指针,这个能否优化下?多谢

@klboke
Copy link
Contributor

klboke commented Nov 29, 2019

你好,感谢提供这个宝贵的空指针的案例,我们已经在86e347c 这个提交里修复了,
另keys支持添加常量是下面代码所示的意思么:

    public static final String LOCKKEY ="#userId";
    
    @Klock(keys = {LOCKKEY})
    public String getValue(String userId,@KlockKey Integer id)throws Exception{
        Thread.sleep(60*1000);
        return "success";
    }

@lcyan
Copy link

lcyan commented Jan 3, 2020

@Klock(keys = {LOCKKEY})

类似于@klock(keys = {"100000"})这种的吧

@klboke
Copy link
Contributor

klboke commented Jan 3, 2020

可以的,但是不是通过keys设置,keys是获取业务入参的,通过name设置锁的名字,默认@klock不加任何参数,name就是类名+方法名

@klboke klboke closed this as completed May 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants