package gaf3.core.cache


import gaf3.core.util.ValidityUtil
import org.springframework.boot.context.properties.ConfigurationProperties
import javax.validation.constraints.Pattern

@ConfigurationProperties(prefix = "gaf.cache")
class GafCacheConfigure {

    /**
     * 默认缓存配置
     */
    var useRedis = false
    var namespace:String? = null
    @Pattern(regexp = ValidityUtil.VALIDITY_REGEXP)
    var validity: String? = "2h"
    val validitySec: Long get() = ValidityUtil.parseValidity(validity)

}