package com.cslg.ppa.common.core.redis;

import java.util.concurrent.TimeUnit;

/**
 * @ClassName
 * @Description TODO
 * @Author 陈凯裕
 * @Date 2022/7/15 18:08
 * @Version TODO
 **/
public class CacheTTLEnum {

    public static final CacheTTLEnum ONE_MINUTE = new CacheTTLEnum(1L,TimeUnit.MINUTES);

    public static final CacheTTLEnum TEN_MINUTE = new CacheTTLEnum(10L,TimeUnit.MINUTES);

    public static final CacheTTLEnum FIVE_MINUTE = new CacheTTLEnum(5L,TimeUnit.MINUTES);

    public static final CacheTTLEnum FIFTEEN_MINUTE = new CacheTTLEnum(15L,TimeUnit.MINUTES);

    public static final CacheTTLEnum THIRTY_MINUTE = new CacheTTLEnum(30L,TimeUnit.MINUTES);

    public static final CacheTTLEnum ONE_HOUR = new CacheTTLEnum(1L,TimeUnit.HOURS);

    public static final CacheTTLEnum TWELVE_HOUR = new CacheTTLEnum(12L,TimeUnit.HOURS);

    public static final CacheTTLEnum ONE_DAY = new CacheTTLEnum(1L,TimeUnit.DAYS);
    public static final CacheTTLEnum TWO_HOUR = new CacheTTLEnum(2L,TimeUnit.HOURS);


    private Long time;

    private TimeUnit unit;

    protected CacheTTLEnum(Long time, TimeUnit unit) {
        this.time = time;
        this.unit = unit;
    }

    public Long getTime() {
        return time;
    }

    public TimeUnit getUnit() {
        return unit;
    }
}
