java 后台代码:
1,lock锁,不然会报io异常,强制主机关闭
package com.yx.service.common.lock;
import com.yx.service.common.redis.RedisService;
import org.springframework.core.io.ClassPathResource;
import org.springframework.data.redis.core.script.DefaultRedisScript;
import org.springframework.scripting.support.ResourceScriptSource;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public abstract class LockService {
private static DefaultRedisScript<Boolean> lockScript;
private static DefaultRedisScript<Boolean> unLockScript;
static {
lockScript = new DefaultRedisScript<>();
lockScript.setScriptSource(new ResourceScriptSource(new ClassPathResource("redis/lock.lua")));
lockScript.setResultType(Boolean.class);
unLockScript = new DefaultRedisScript<>();
unLockScript.setScriptSource(new ResourceScriptSource(new ClassP