package com.centreproject.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.centreproject.common.utils.StringUtils;

/**
 * 缓存信息
 *
 * @author centreproject
 */
@TableName("sys_cache") // 假设对应的表名为 sys_cache
public class SysCache
{
    /** 主键ID */
    @TableId
    private Long id;

    /** 缓存名称 */
    @TableField("cache_name")
    private String cacheName = "";

    /** 缓存键名 */
    @TableField("cache_key")
    private String cacheKey = "";

    /** 缓存内容 */
    @TableField("cache_value")
    private String cacheValue = "";

    /** 备注 */
    @TableField("remark")
    private String remark = "";

    public SysCache()
    {
    }

    public SysCache(String cacheName, String remark)
    {
        this.cacheName = cacheName;
        this.remark = remark;
    }

    public SysCache(String cacheName, String cacheKey, String cacheValue)
    {
        this.cacheName = StringUtils.replace(cacheName, ":", "");
        this.cacheKey = StringUtils.replace(cacheKey, cacheName, "");
        this.cacheValue = cacheValue;
    }

    // 新增的 getter/setter
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCacheName()
    {
        return cacheName;
    }

    public void setCacheName(String cacheName)
    {
        this.cacheName = cacheName;
    }

    public String getCacheKey()
    {
        return cacheKey;
    }

    public void setCacheKey(String cacheKey)
    {
        this.cacheKey = cacheKey;
    }

    public String getCacheValue()
    {
        return cacheValue;
    }

    public void setCacheValue(String cacheValue)
    {
        this.cacheValue = cacheValue;
    }

    public String getRemark()
    {
        return remark;
    }

    public void setRemark(String remark)
    {
        this.remark = remark;
    }
}