互联网安全架构-纯手互联网API接口幂等框架

网站安全漏洞扫描

互联网API接口幂等设计

BaseRedisService封装Redis

@Component
public class BaseRedisService {

	@Autowired
	private StringRedisTemplate stringRedisTemplate;

	public void setString(String key, Object data, Long timeout) {
		if (data instanceof String) {
			String value = (String) data;
			stringRedisTemplate.opsForValue().set(key, value);
		}
		if (timeout != null) {
			stringRedisTemplate.expire(key, timeout, TimeUnit.SECONDS);
		}
	}

	public Object getString(String key) {
		return stringRedisTemplate.opsForValue().get(key);
	}

	public void delKey(String key) {
		stringRedisTemplate.delete(key);
	}

}

RedisTokenUtils工具类

@Component
public class RedisTokenUtils {
	private long timeout = 60 * 60;
	@Autowired
	private BaseR
上一篇:CMD批处理实现dot命令自动运行更新


下一篇:H7-TOOL的LUA小程序教程第5期:串口开发,含Modbus(2022-01-16)