import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.script.DefaultRedisScript;
import org.springframework.data.redis.core.script.RedisScript;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.stereotype.Service;
import java.util.Collections;
/**
* @author hyx
*/
@Service
public class RedisLockService {
private static final Long SUCCESS = 1L;
@Autowired
private RedisTemplate redisTemplate;
/**
* 获取锁
*
* @param lockKey
* @param value
* @param expireTime 锁有效时间 单位-秒
* @return
*/
public boolean getLock(String lockKey, String value, int expireTime) {