package com.gci.boot.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * @author chenzw
 * @date 2023/8/3
 */
@ConfigurationProperties(prefix = "gci.cache.redis")
@Data
public class GciRedisCacheProperties {

	/** 全局过期时间，单位毫秒，<=0不过期 ,默认一个小时 */
	private long defaultTtl = 3600000;
	/** 默认缓存前缀 */
	private String defaultKeyPrefix;

	private boolean cacheNullValues = true;

	/**每个key的单独配置*/
	private Map<String, KeyConfig> keys = new HashMap<>();

	@Data
	public  class KeyConfig{
		private String prefix;
		private long ttl = 3600000;
		private boolean cacheNullValues = true;
	}
}
