package com.ruoyi.analytics.domain;

import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 统计缓存对象 dc_statistics_cache
 * 
 * @author ruoyi
 * @date 2025-12-19
 */
public class StatisticsCache extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 缓存ID */
    private Long cacheId;

    /** 缓存键 */
    @Excel(name = "缓存键")
    @NotBlank(message = "缓存键不能为空")
    @Size(max = 200, message = "缓存键长度不能超过200个字符")
    private String cacheKey;

    /** 数据类型 */
    @Excel(name = "数据类型")
    @NotBlank(message = "数据类型不能为空")
    @Size(max = 50, message = "数据类型长度不能超过50个字符")
    private String dataType;

    /** 统计维度 */
    @Excel(name = "统计维度")
    @NotBlank(message = "统计维度不能为空")
    @Size(max = 100, message = "统计维度长度不能超过100个字符")
    private String dimension;

    /** 缓存数据 */
    private String cacheData;

    /** 计算时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "计算时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "计算时间不能为空")
    private Date calculateTime;

    /** 过期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "过期时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "过期时间不能为空")
    private Date expireTime;

    /** 缓存状态 */
    @Excel(name = "缓存状态")
    @NotBlank(message = "缓存状态不能为空")
    @Size(max = 50, message = "缓存状态长度不能超过50个字符")
    private String cacheStatus;

    /** 访问次数 */
    @Excel(name = "访问次数")
    private Long accessCount;

    /** 最后访问时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最后访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date lastAccessTime;

    public void setCacheId(Long cacheId) 
    {
        this.cacheId = cacheId;
    }

    public Long getCacheId() 
    {
        return cacheId;
    }
    public void setCacheKey(String cacheKey) 
    {
        this.cacheKey = cacheKey;
    }

    public String getCacheKey() 
    {
        return cacheKey;
    }
    public void setDataType(String dataType) 
    {
        this.dataType = dataType;
    }

    public String getDataType() 
    {
        return dataType;
    }
    public void setDimension(String dimension) 
    {
        this.dimension = dimension;
    }

    public String getDimension() 
    {
        return dimension;
    }
    public void setCacheData(String cacheData) 
    {
        this.cacheData = cacheData;
    }

    public String getCacheData() 
    {
        return cacheData;
    }
    public void setCalculateTime(Date calculateTime) 
    {
        this.calculateTime = calculateTime;
    }

    public Date getCalculateTime() 
    {
        return calculateTime;
    }
    public void setExpireTime(Date expireTime) 
    {
        this.expireTime = expireTime;
    }

    public Date getExpireTime() 
    {
        return expireTime;
    }
    public void setCacheStatus(String cacheStatus) 
    {
        this.cacheStatus = cacheStatus;
    }

    public String getCacheStatus() 
    {
        return cacheStatus;
    }
    public void setAccessCount(Long accessCount) 
    {
        this.accessCount = accessCount;
    }

    public Long getAccessCount() 
    {
        return accessCount;
    }
    public void setLastAccessTime(Date lastAccessTime) 
    {
        this.lastAccessTime = lastAccessTime;
    }

    public Date getLastAccessTime() 
    {
        return lastAccessTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("cacheId", getCacheId())
            .append("cacheKey", getCacheKey())
            .append("dataType", getDataType())
            .append("dimension", getDimension())
            .append("cacheData", getCacheData())
            .append("calculateTime", getCalculateTime())
            .append("expireTime", getExpireTime())
            .append("cacheStatus", getCacheStatus())
            .append("accessCount", getAccessCount())
            .append("lastAccessTime", getLastAccessTime())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}