package com.ssyf.plugs.cache;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 缓存数据分发消息封装类
 * 目的让分发端识别消息来源
 * @author huwei
 * @date 2022/11/29 11:44
 */
@Data
@Accessors(chain = true)
public class CacheMessage implements Serializable {

    /**
     * 多级缓存的名称
     */
    private String name;

    /**
     * 一级缓存的key
     */
    private Object key;

    /**
     * 消息来源
     */
    private String uniqueKey;

    public CacheMessage(){}

    public CacheMessage(String name, Object key, String uniqueKey){
        this.name = name;
        this.key = key;
        this.uniqueKey = uniqueKey;
    }
}
